Skip to content

Commit

Permalink
Typo refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
rzeldent committed Mar 5, 2024
1 parent bb278c0 commit 6efc9f4
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
14 changes: 7 additions & 7 deletions src/esp32_smartdisplay.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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)
{
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand All @@ -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,
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/esp_lcd_touch_xpt2046.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/lvgl_cst816s_i2c.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion src/lvgl_gt911_i2c.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#include <esp_lcd_touch_gt911.h>
#include <driver/i2c.h>

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;

Expand Down
2 changes: 1 addition & 1 deletion src/lvgl_xpt2046_spi.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#include <esp_lcd_touch_xpt2046.h>
#include <driver/spi_master.h>

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;

Expand Down

0 comments on commit 6efc9f4

Please sign in to comment.