diff --git a/app/Makefile b/app/Makefile index fba1326d1..d662c1a4d 100644 --- a/app/Makefile +++ b/app/Makefile @@ -1,6 +1,6 @@ app_objs += $(addprefix app/,\ app.o\ - text_input.o) + utils.o) products += $(app_objs) app.elf app.hex app.bin app.elf: $(app_objs) diff --git a/app/app.cpp b/app/app.cpp index 043984995..eede4f5e7 100644 --- a/app/app.cpp +++ b/app/app.cpp @@ -6,7 +6,7 @@ extern "C" { #include -#include "text_input.h" +#include "utils.h" void draw_lines_from_center() { KDCoordinate width = SCREEN_WIDTH; @@ -60,16 +60,6 @@ void funnyPlot() { delete e; } -static void clear_screen() { - KDRect r; - r.x = 0; - r.y = 0; - r.width = SCREEN_WIDTH; - r.height = SCREEN_HEIGHT; - KDFillRect(r, 0x00); -} - - static void interactive_expression_parsing() { while (1) { char * text_input = get_text(); diff --git a/app/text_input.cpp b/app/utils.cpp similarity index 92% rename from app/text_input.cpp rename to app/utils.cpp index 522203310..f0e1c16d4 100644 --- a/app/text_input.cpp +++ b/app/utils.cpp @@ -7,6 +7,15 @@ extern "C" { #define PROMPT_HEIGHT 30 +void clear_screen() { + KDRect r; + r.x = 0; + r.y = 0; + r.width = SCREEN_WIDTH; + r.height = SCREEN_HEIGHT; + KDFillRect(r, 0x00); +} + static void clear_prompt() { KDRect r; r.x = 0; diff --git a/app/text_input.h b/app/utils.h similarity index 61% rename from app/text_input.h rename to app/utils.h index b7490c2ff..ca78fcae1 100644 --- a/app/text_input.h +++ b/app/utils.h @@ -1,8 +1,10 @@ -#ifndef APP_TEXTINPUT_H -#define APP_TEXTINPUT_H +#ifndef APP_UTILS_H +#define APP_UTILS_H /* Returns a pointer to an input text, allocated by the functions (it is thus * the caller's role to free it). */ char* get_text(); -#endif // APP_TEXTINPUT_H +void clear_screen(); + +#endif // APP_UTILS_H