SayoriOS  0.3.3
status_loggers.c
1 #include <io/ports.h>
2 #include <drv/beeper.h>
3 #include <io/status_loggers.h>
4 #include <io/status_sounds.h>
5 #include <io/tty.h>
6 
7 void tty_error(char* format, ...)
8 {
9  uint32_t orig = tty_getcolor();
10 
11  ERROR_sound();
12  tty_setcolor(COLOR_ERROR);
13 
14  va_list args;
15  va_start(args, format);
16 
17  tty_print(format, args);
18 
19  va_end(args);
20 
21  tty_setcolor(orig);
22 }
23 
24 void tty_attention(char* format, ...)
25 {
26  uint32_t orig = tty_getcolor();
27 
28  ATTENTION_sound();
29  tty_setcolor(COLOR_ATENTION);
30 
31  va_list args;
32  va_start(args, format);
33 
34  tty_print(format, args);
35 
36  va_end(args);
37 
38  tty_setcolor(orig);
39 }
40 
41 void tty_alert(char* format, ...)
42 {
43  uint32_t orig = tty_getcolor();
44 
45  ALERT_sound();
46  tty_setcolor(COLOR_ALERT);
47 
48  va_list args;
49  va_start(args, format);
50 
51  tty_print(format, args);
52 
53  va_end(args);
54 
55  tty_setcolor(orig);
56 }
57 
58 void tty_global_error(char* format, ...)
59 {
60  uint32_t orig = tty_getcolor();
61 
62  GLOBAL_ERROR_sound();
63  tty_setcolor(COLOR_ERROR);
64 
65  va_list args;
66  va_start(args, format);
67 
68  tty_print(format, args);
69 
70  va_end(args);
71 
72  tty_setcolor(orig);
73 }
Definition: stdarg.h:9
void tty_setcolor(uint32_t color)
Изменение цвета текста
Definition: tty.c:108