From 6efc9f4c88cd18ab15629a5d2cc511724b6c4f02 Mon Sep 17 00:00:00 2001 From: Rene Zeldenthuis Date: Tue, 5 Mar 2024 17:14:15 +0100 Subject: [PATCH] Typo refactor --- src/esp32_smartdisplay.c | 14 +++++++------- src/esp_lcd_touch_xpt2046.c | 2 +- src/lvgl_cst816s_i2c.c | 2 +- src/lvgl_gt911_i2c.c | 2 +- src/lvgl_xpt2046_spi.c | 2 +- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/esp32_smartdisplay.c b/src/esp32_smartdisplay.c index 4e866ec..adb6083 100644 --- a/src/esp32_smartdisplay.c +++ b/src/esp32_smartdisplay.c @@ -24,7 +24,7 @@ touch_calibration_data_t touch_calibration_data; void (*driver_touch_read_cb)(struct _lv_indev_drv_t *indev_drv, lv_indev_data_t *data); #endif -#if LV_USE_LOG +#ifdef LV_USE_LOG void lvgl_log(const char *buf) { log_printf("%s", buf); @@ -33,9 +33,9 @@ void lvgl_log(const char *buf) // Called when driver parameters are updated (rotation) // Top of the display is top left when connector is at the bottom -static void lvgl_update_callback(lv_disp_drv_t *drv) +void lvgl_update_callback(lv_disp_drv_t *drv) { - log_d("lvgl_update_callback"); + log_v("drv:0x%08x", drv); esp_lcd_panel_handle_t panel_handle = disp_drv.user_data; switch (drv->rotated) { @@ -108,7 +108,7 @@ static void lvgl_update_callback(lv_disp_drv_t *drv) // Set backlight intensity void smartdisplay_lcd_set_backlight(float duty) { - log_d("smartdisplay_lcd_set_backlight. duty:%2f", duty); + log_v("duty:%2f", duty); if (duty > 1.0) duty = 1.0f; if (duty < 0.0) @@ -172,6 +172,7 @@ void smartdisplay_led_set_rgb(bool r, bool g, bool b) // See: https://www.maximintegrated.com/en/design/technical-documents/app-notes/5/5296.html void lvgl_touch_calibration_transform(lv_indev_drv_t *drv, lv_indev_data_t *data) { + log_v("drv:0x%08x, data:0x%08x", drv, data); // Call low level read from the driver driver_touch_read_cb(drv, data); // Check if transformation is required @@ -188,8 +189,7 @@ void lvgl_touch_calibration_transform(lv_indev_drv_t *drv, lv_indev_data_t *data touch_calibration_data_t smartdisplay_compute_touch_calibration(const lv_point_t screen[3], const lv_point_t touch[3]) { - log_d("smartdisplay_compute_touch_calibration"); - touch_calibration_data.valid = false; + log_v("screen:0x%08x, touch:0x%08x", screen, touch); const float delta = ((touch[0].x - touch[2].x) * (touch[1].y - touch[2].y)) - ((touch[1].x - touch[2].x) * (touch[0].y - touch[2].y)); touch_calibration_data_t touch_calibration_data = { .valid = true, @@ -201,7 +201,7 @@ touch_calibration_data_t smartdisplay_compute_touch_calibration(const lv_point_t .deltaY = ((screen[0].y * (touch[1].x * touch[2].y - touch[2].x * touch[1].y)) - (screen[1].y * (touch[0].x * touch[2].y - touch[2].x * touch[0].y)) + (screen[2].y * (touch[0].x * touch[1].y - touch[1].x * touch[0].y))) / delta, }; - log_i("Calibration (alphaX, betaX, deltaX, alphaY, betaY, deltaY) = (%f, %f, %f, %f, %f, %f)", touch_calibration_data.alphaX, touch_calibration_data.betaX, touch_calibration_data.deltaX, touch_calibration_data.alphaY, touch_calibration_data.betaY, touch_calibration_data.deltaY); + log_i("alphaX: %f, betaX: %f, deltaX: %f, alphaY: %f, betaY: %f, deltaY: %f", touch_calibration_data.alphaX, touch_calibration_data.betaX, touch_calibration_data.deltaX, touch_calibration_data.alphaY, touch_calibration_data.betaY, touch_calibration_data.deltaY); return touch_calibration_data; }; #endif diff --git a/src/esp_lcd_touch_xpt2046.c b/src/esp_lcd_touch_xpt2046.c index 0981ce5..f1b8567 100644 --- a/src/esp_lcd_touch_xpt2046.c +++ b/src/esp_lcd_touch_xpt2046.c @@ -242,7 +242,7 @@ extern "C" log_v("th:0x%08x, output:0x%08x", th, output); assert(th != NULL); - assert(outhut != NULL); + assert(output != NULL); esp_err_t res; uint16_t level; diff --git a/src/lvgl_cst816s_i2c.c b/src/lvgl_cst816s_i2c.c index 7705b85..4f85f26 100644 --- a/src/lvgl_cst816s_i2c.c +++ b/src/lvgl_cst816s_i2c.c @@ -5,7 +5,7 @@ #include "esp_lcd_touch.h" #include "esp_lcd_touch_cst816s.h" -static void cst816s_lvgl_touch_cb(lv_indev_drv_t *drv, lv_indev_data_t *data) +void cst816s_lvgl_touch_cb(lv_indev_drv_t *drv, lv_indev_data_t *data) { esp_lcd_touch_handle_t touch_handle = drv->user_data; diff --git a/src/lvgl_gt911_i2c.c b/src/lvgl_gt911_i2c.c index 6a45095..40c8a66 100644 --- a/src/lvgl_gt911_i2c.c +++ b/src/lvgl_gt911_i2c.c @@ -4,7 +4,7 @@ #include #include -static void gt911_lvgl_touch_cb(lv_indev_drv_t *drv, lv_indev_data_t *data) +void gt911_lvgl_touch_cb(lv_indev_drv_t *drv, lv_indev_data_t *data) { esp_lcd_touch_handle_t touch_handle = drv->user_data; diff --git a/src/lvgl_xpt2046_spi.c b/src/lvgl_xpt2046_spi.c index b24fee1..6de1827 100644 --- a/src/lvgl_xpt2046_spi.c +++ b/src/lvgl_xpt2046_spi.c @@ -4,7 +4,7 @@ #include #include -static void xpt2046_lvgl_touch_cb(lv_indev_drv_t *drv, lv_indev_data_t *data) +void xpt2046_lvgl_touch_cb(lv_indev_drv_t *drv, lv_indev_data_t *data) { esp_lcd_touch_handle_t touch_handle = drv->user_data;