diff options
Diffstat (limited to 'Software/Code_Composer/twine_graphicslib')
| -rw-r--r-- | Software/Code_Composer/twine_graphicslib/graphics_adapter.c | 8 | ||||
| -rw-r--r-- | Software/Code_Composer/twine_graphicslib/graphics_adapter.h | 2 |
2 files changed, 8 insertions, 2 deletions
diff --git a/Software/Code_Composer/twine_graphicslib/graphics_adapter.c b/Software/Code_Composer/twine_graphicslib/graphics_adapter.c index 5d165599f..6990a58d9 100644 --- a/Software/Code_Composer/twine_graphicslib/graphics_adapter.c +++ b/Software/Code_Composer/twine_graphicslib/graphics_adapter.c @@ -14,7 +14,8 @@ #include "drivers/frame.h" #include "drivers/kentec320x240x16_ssd2119.h" -#define LINE_HEIGHT 25 +#define LINE_HEIGHT 12 +#define MAX_POSITION 240 int current_position = 0; char current_line[100]; @@ -49,6 +50,11 @@ void draw_string(char* data, size_t length) void writeLine(char* text) { + if (current_position >= MAX_POSITION) + { + clear(); + } + strcpy(current_line, text); GrStringDraw(&g_sContext, current_line, strlen(current_line), 0, current_position, true); current_position += LINE_HEIGHT; diff --git a/Software/Code_Composer/twine_graphicslib/graphics_adapter.h b/Software/Code_Composer/twine_graphicslib/graphics_adapter.h index 405b88166..134312def 100644 --- a/Software/Code_Composer/twine_graphicslib/graphics_adapter.h +++ b/Software/Code_Composer/twine_graphicslib/graphics_adapter.h @@ -18,7 +18,7 @@ // //***************************************************************************** static tContext g_sContext; -#define TEXT_FONT g_psFontCmss18b +#define TEXT_FONT g_psFontCmss12 #define TEXT_HEIGHT (GrFontHeightGet(TEXT_FONT)) #define BUFFER_METER_HEIGHT TEXT_HEIGHT #define BUFFER_METER_WIDTH 150 |
