Droni e Droidi / Mbed OS F746NG_TestAll

Dependencies:   TS_DISCO_F746NG LCD_DISCO_F746NG BSP_DISCO_F746NG BUTTON_GROUP Arduino

Revision:
4:0ce191d3f0ce
Parent:
3:e7e663758e6d
Child:
5:19f1743cecb1
--- a/Functions.h	Sun Dec 20 14:23:23 2020 +0000
+++ b/Functions.h	Mon Dec 21 00:02:17 2020 +0000
@@ -53,7 +53,6 @@
 void GestioneTouch()
 {
     static uint16_t x=0, y=0;
-    uint8_t text[30];
     uint8_t idx;
     uint8_t cleared = 0;
     uint8_t prev_nb_touches = 0;
@@ -66,24 +65,22 @@
             }
         }
         prev_nb_touches = TS_State.touchDetected;
-
         cleared = 0;
-
-        sprintf((char*)text, "Touches: %d", TS_State.touchDetected);
-        BSP_LCD_DisplayStringAt(0, LINE(0), (uint8_t *)&text, LEFT_MODE);
+        sprintf(str, "Touches: %d", TS_State.touchDetected);
+        BSP_LCD_DisplayStringAt(0, LINE(0), (uint8_t *)str, LEFT_MODE);
 
         BSP_LCD_DrawPixel(x, y, LCD_COLOR_BLACK);
         for (idx = 0; idx < TS_State.touchDetected; idx++) {
             x = TS_State.touchX[idx];
             y = TS_State.touchY[idx];
-            sprintf((char*)text, "Touch %d: x=%d y=%d    ", idx+1, x, y);
-            BSP_LCD_DisplayStringAt(0, LINE(idx+1), (uint8_t *)&text, LEFT_MODE);
+            sprintf(str, "Touch %d: x=%d y=%d    ", idx+1, x, y);
+            BSP_LCD_DisplayStringAt(0, LINE(idx+1), (uint8_t *)str, LEFT_MODE);
         }
 
         BSP_LCD_DrawPixel(TS_State.touchX[0], TS_State.touchY[0], LCD_COLOR_WHITE);
     } else {
         if (!cleared) {
-            sprintf((char*)text, "Touches: 0");
+            sprintf(str, "Touches: 0");
             BSP_LCD_DisplayStringAt(0, LINE(0), (uint8_t *)&text, LEFT_MODE);
             cleared = 1;
         }