From 1562d4d3b0ede228e2bb42ad871c06db02ff2bcf Mon Sep 17 00:00:00 2001 From: xoreo Date: Tue, 14 Nov 2023 15:31:10 +0100 Subject: [PATCH] Bug fix in lcd_display_text() --- project/Core/Src/lcd_api.c | 3 +- project/project Debug.launch | 82 ++++++++++++++++++++++++++++++++++++ 2 files changed, 84 insertions(+), 1 deletion(-) create mode 100644 project/project Debug.launch diff --git a/project/Core/Src/lcd_api.c b/project/Core/Src/lcd_api.c index 310b558..9608462 100644 --- a/project/Core/Src/lcd_api.c +++ b/project/Core/Src/lcd_api.c @@ -45,7 +45,8 @@ void lcd_display_text(uint8_t* text, uint16_t x_pos, uint16_t y_pos, uint32_t co if ((x_pos) > BSP_LCD_GetXSize() - (font->Width)*2) { if (isalpha(text[i-1]) && isalpha(text[i])) { BSP_LCD_DisplayChar(x_pos, y_pos, '-'); - i -= 1; + } else { + BSP_LCD_DisplayChar(x_pos, y_pos, text[i]); } x_pos = 0; y_pos += font->Height; diff --git a/project/project Debug.launch b/project/project Debug.launch new file mode 100644 index 0000000..e766d28 --- /dev/null +++ b/project/project Debug.launch @@ -0,0 +1,82 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +