From 66e6b0d3f813cf097558fd0e3acb2873eadbdf2e Mon Sep 17 00:00:00 2001 From: antifallobst Date: Mon, 1 May 2023 01:14:14 +0200 Subject: [PATCH] refacotr (TTY): removed not needed function tty_alloc --- inc/drivers/tty.h | 2 -- src/drivers/tty.c | 21 +++++++-------------- 2 files changed, 7 insertions(+), 16 deletions(-) diff --git a/inc/drivers/tty.h b/inc/drivers/tty.h index b9b2ae8..e11034d 100644 --- a/inc/drivers/tty.h +++ b/inc/drivers/tty.h @@ -16,8 +16,6 @@ typedef struct { } tty_T; void tty_init (); - -tty_T* tty_alloc (); void tty_update (); uint32_t tty_write (string_t string); diff --git a/src/drivers/tty.c b/src/drivers/tty.c index 8a24c82..6ba5d99 100644 --- a/src/drivers/tty.c +++ b/src/drivers/tty.c @@ -7,20 +7,13 @@ tty_T* g_tty; void tty_init() { - g_tty = tty_alloc(); -} - -tty_T* tty_alloc() { - tty_T* tty = memory_allocate(sizeof(tty_T)); - - tty->graphics_buffer = graphics_buffer_request(0, 0, graphics_renderer_get_width(), graphics_renderer_get_height(), GRAPHICS_BUFFER_STANDARD); - tty->cursor.x = 0; - tty->cursor.y = 0; - tty->color = g_color_palette[COLOR_PAL_GREY_LIGHT]; - tty->output = NULL; - pipe_init(&tty->input, NULL, tty_update); - - return tty; + g_tty = memory_allocate(sizeof(tty_T)); + g_tty->graphics_buffer = graphics_buffer_request(0, 0, graphics_renderer_get_width(), graphics_renderer_get_height(), GRAPHICS_BUFFER_STANDARD); + g_tty->cursor.x = 0; + g_tty->cursor.y = 0; + g_tty->color = g_color_palette[COLOR_PAL_GREY_LIGHT]; + g_tty->output = NULL; + pipe_init(&g_tty->input, NULL, tty_update); } void tty_update() {