+ rearranged files
+ improved ui log + added image browser - image loading fails at the moment - arrangement of ui in image browser not checked
This commit is contained in:
+7
-12
@@ -71,8 +71,7 @@ static esp_lcd_touch_handle_t touch_handle;
|
||||
static lv_display_t *lvgl_display;
|
||||
static lv_indev_t *lvgl_touch_indev;
|
||||
|
||||
static esp_err_t init_backlight(void)
|
||||
{
|
||||
static esp_err_t init_backlight(void){
|
||||
const gpio_config_t backlight_config = {
|
||||
.mode = GPIO_MODE_OUTPUT,
|
||||
.pin_bit_mask = 1ULL << LCD_GPIO_BACKLIGHT,
|
||||
@@ -83,17 +82,16 @@ static esp_err_t init_backlight(void)
|
||||
return ESP_OK;
|
||||
}
|
||||
|
||||
static esp_err_t probe_gt911_address(i2c_master_bus_handle_t i2c_handle, uint32_t *dev_addr)
|
||||
{
|
||||
static esp_err_t probe_gt911_address(i2c_master_bus_handle_t i2c_handle, uint32_t *dev_addr){
|
||||
const uint8_t addresses[] = {
|
||||
ESP_LCD_TOUCH_IO_I2C_GT911_ADDRESS,
|
||||
ESP_LCD_TOUCH_IO_I2C_GT911_ADDRESS_BACKUP,
|
||||
};
|
||||
|
||||
for (size_t address_index = 0; address_index < sizeof(addresses) / sizeof(addresses[0]); address_index++) {
|
||||
for(size_t address_index = 0; address_index < sizeof(addresses) / sizeof(addresses[0]); address_index++){
|
||||
const uint8_t address = addresses[address_index];
|
||||
const esp_err_t probe_ret = i2c_master_probe(i2c_handle, address, 100);
|
||||
if (probe_ret == ESP_OK) {
|
||||
if(probe_ret == ESP_OK){
|
||||
*dev_addr = address;
|
||||
ESP_LOGI(TAG, "GT911 found at I2C address 0x%02x", address);
|
||||
return ESP_OK;
|
||||
@@ -257,7 +255,7 @@ static esp_err_t init_lvgl(void){
|
||||
lv_display_set_rotation(lvgl_display, LCD_LVGL_ROTATION);
|
||||
ESP_LOGI(TAG, "LVGL display rotation set to %d", LCD_LVGL_ROTATION);
|
||||
|
||||
if (touch_handle) {
|
||||
if(touch_handle){
|
||||
const lvgl_port_touch_cfg_t touch_config = {
|
||||
.disp = lvgl_display,
|
||||
.handle = touch_handle,
|
||||
@@ -265,9 +263,8 @@ static esp_err_t init_lvgl(void){
|
||||
lvgl_touch_indev = lvgl_port_add_touch(&touch_config);
|
||||
ESP_RETURN_ON_FALSE(lvgl_touch_indev, ESP_FAIL, TAG, "LVGL touch add failed");
|
||||
ESP_LOGI(TAG, "LVGL touch input ready");
|
||||
} else {
|
||||
ESP_LOGW(TAG, "LVGL touch input disabled");
|
||||
}
|
||||
else ESP_LOGW(TAG, "LVGL touch input disabled");
|
||||
|
||||
ESP_LOGI(TAG, "LVGL ready");
|
||||
|
||||
@@ -277,9 +274,7 @@ static esp_err_t init_lvgl(void){
|
||||
esp_err_t lcd_init(void){
|
||||
ESP_RETURN_ON_ERROR(init_rgb_panel(), TAG, "LCD panel init failed");
|
||||
const esp_err_t touch_ret = init_touch();
|
||||
if (touch_ret != ESP_OK) {
|
||||
ESP_LOGW(TAG, "Continuing without touch: %s", esp_err_to_name(touch_ret));
|
||||
}
|
||||
if(touch_ret != ESP_OK) ESP_LOGW(TAG, "Continuing without touch: %s", esp_err_to_name(touch_ret));
|
||||
return init_lvgl();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user