ra8875: Replace ESP_LOG with LVGL logging

This commit is contained in:
C47D 2021-10-13 23:29:34 -05:00
parent 18569b6c17
commit 6b6b756da3

View file

@ -5,7 +5,6 @@
/********************* /*********************
* INCLUDES * INCLUDES
*********************/ *********************/
#include "esp_log.h"
#include "freertos/FreeRTOS.h" #include "freertos/FreeRTOS.h"
#include "freertos/task.h" #include "freertos/task.h"
@ -83,7 +82,7 @@ void ra8875_touch_init(void)
}; };
#define INIT_CMDS_SIZE (sizeof(init_cmds)/sizeof(init_cmds[0])) #define INIT_CMDS_SIZE (sizeof(init_cmds)/sizeof(init_cmds[0]))
ESP_LOGI(TAG, "Initializing RA8875 Touch..."); LV_LOG_INFO(TAG, "Initializing RA8875 Touch...");
// Send all the commands // Send all the commands
for (unsigned int i = 0; i < INIT_CMDS_SIZE; i++) { for (unsigned int i = 0; i < INIT_CMDS_SIZE; i++) {
@ -94,7 +93,7 @@ void ra8875_touch_init(void)
void ra8875_touch_enable(bool enable) void ra8875_touch_enable(bool enable)
{ {
ESP_LOGI(TAG, "%s touch.", enable ? "Enabling" : "Disabling"); LV_LOG_INFO(TAG, "%s touch.", enable ? "Enabling" : "Disabling");
uint8_t val = enable ? (0x80 | TPCR0_VAL) : (TPCR0_VAL); uint8_t val = enable ? (0x80 | TPCR0_VAL) : (TPCR0_VAL);
ra8875_write_cmd(RA8875_REG_TPCR0, val); ra8875_write_cmd(RA8875_REG_TPCR0, val);
} }
@ -122,7 +121,7 @@ bool ra8875_touch_read(lv_indev_drv_t * drv, lv_indev_data_t * data)
y = (y << 2) | ((xy >> 2) & 0x03); y = (y << 2) | ((xy >> 2) & 0x03);
#if DEBUG #if DEBUG
ESP_LOGI(TAG, "Touch Poll Raw: %d,%d", x, y); LV_LOG_INFO(TAG, "Touch Poll Raw: %d,%d", x, y);
#endif #endif
// Convert to display coordinates // Convert to display coordinates
@ -136,7 +135,7 @@ bool ra8875_touch_read(lv_indev_drv_t * drv, lv_indev_data_t * data)
data->point.y = y; data->point.y = y;
#if DEBUG #if DEBUG
ESP_LOGI(TAG, "Touch Poll - Event: %d; %d,%d", data->state, data->point.x, data->point.y); LV_LOG_INFO(TAG, "Touch Poll - Event: %d; %d,%d", data->state, data->point.x, data->point.y);
#endif #endif
return false; return false;