diff options
Diffstat (limited to 'terminal')
| -rw-r--r-- | terminal/terminal.c | 13 | ||||
| -rw-r--r-- | terminal/terminal.h | 4 |
2 files changed, 11 insertions, 6 deletions
diff --git a/terminal/terminal.c b/terminal/terminal.c index 7fc6f93..ccea64e 100644 --- a/terminal/terminal.c +++ b/terminal/terminal.c @@ -8,9 +8,6 @@ #include "kernel/kmalloc.h" #include "driver/screen.h" -#define SET_LFNL true -#define SET_BUFF false -#define SET_ECHO true typedef enum { @@ -238,6 +235,10 @@ terminal_tty terminal_init(term_out *screen,term_in *input) tty.data=kballoc(2); + tty.set_buff=true; + tty.set_lfnl=true; + tty.set_echo=true; + tty.command=kballoc(1); tty.command_l=0; @@ -262,9 +263,9 @@ terminal_tty terminal_init(term_out *screen,term_in *input) void terminal_kb(terminal_tty *tty, uint8_t c) { - if(SET_ECHO)terminal_put(tty,c); + if(tty->set_echo)terminal_put(tty,c); - if(SET_BUFF) + if(tty->set_buff) { tty->command[tty->command_l]=c; (tty->command_l)++; @@ -328,7 +329,7 @@ bool terminal_put(terminal_tty *tty, uint8_t c) set_char(tty,x,tty->y,' ',tty->fg,tty->bg); } tty->y++; - if(SET_LFNL)tty->x=0; + if(tty->set_lfnl)tty->x=0; } else // { diff --git a/terminal/terminal.h b/terminal/terminal.h index e97a413..5e97cc1 100644 --- a/terminal/terminal.h +++ b/terminal/terminal.h @@ -48,6 +48,10 @@ typedef struct terminal_tty_struct uint8_t fg; uint8_t bg; + bool set_buff; + bool set_lfnl; + bool set_echo; + uint32_t width; uint32_t height; uint32_t x; |
