Dependencies:   BSP_DISCO_F746NG

Revision:
5:071136c3eefa
Parent:
3:4f5dc253eb7b
--- a/hal_stm_lvgl/touchpad/touchpad.c	Sun Apr 25 12:35:07 2021 +0000
+++ b/hal_stm_lvgl/touchpad/touchpad.c	Tue Jun 15 19:35:57 2021 +0000
@@ -7,8 +7,9 @@
  *      INCLUDES
  *********************/
 #include "hal_stm_lvgl/tft/tft.h"
-#include "lvgl/src/lv_hal/lv_hal.h"
+#include "lvgl/lvgl.h"
 
+#include "stm32f7xx.h"
 #include "stm32746g_discovery.h"
 #include "stm32746g_discovery_ts.h"
 
@@ -23,7 +24,7 @@
 /**********************
  *  STATIC PROTOTYPES
  **********************/
-static bool touchpad_read(lv_indev_drv_t *drv, lv_indev_data_t *data);
+static void touchpad_read(lv_indev_drv_t *drv, lv_indev_data_t *data);
 
 /**********************
  *  STATIC VARIABLES
@@ -45,7 +46,7 @@
 {
     BSP_TS_Init(TFT_HOR_RES, TFT_VER_RES);
 
-    lv_indev_drv_t indev_drv;                       /*Descriptor of an input device driver*/
+    static lv_indev_drv_t indev_drv;                       /*Descriptor of an input device driver*/
     lv_indev_drv_init(&indev_drv);                  /*Basic initialization*/
     indev_drv.type = LV_INDEV_TYPE_POINTER;         /*The touchpad is pointer type device*/
     indev_drv.read_cb = touchpad_read;
@@ -64,7 +65,7 @@
  * @param y put the y coordinate here
  * @return true: the device is pressed, false: released
  */
-static bool touchpad_read(lv_indev_drv_t *indev, lv_indev_data_t *data)
+static void touchpad_read(lv_indev_drv_t *indev, lv_indev_data_t *data)
 {
     /* Read your touchpad */
     static int16_t last_x = 0;
@@ -83,7 +84,4 @@
             data->point.y = last_y;
             data->state = LV_INDEV_STATE_REL;
     }
-
-    return false;   /*false: no more data to read because we are no buffering*/
 }
-