aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Code_Composer/twine_graphicslib/graphics_adapter.c
diff options
context:
space:
mode:
Diffstat (limited to 'Software/Code_Composer/twine_graphicslib/graphics_adapter.c')
-rw-r--r--Software/Code_Composer/twine_graphicslib/graphics_adapter.c8
1 files changed, 7 insertions, 1 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;