feat: 更新 display.c,添加反转输出标志并移除不必要的日志和 GPIO 设置

This commit is contained in:
2026-07-08 22:46:44 +08:00
parent 5ef6c20862
commit 92bead72b9
+1 -4
View File
@@ -2,7 +2,6 @@
#include "board_config.h" #include "board_config.h"
#include "driver/gpio.h"
#include "driver/ledc.h" #include "driver/ledc.h"
#include "driver/spi_master.h" #include "driver/spi_master.h"
#include "esp_lcd_panel_ops.h" #include "esp_lcd_panel_ops.h"
@@ -49,6 +48,7 @@ esp_err_t display_init(esp_lcd_panel_io_handle_t *io_handle_out,
.gpio_num = BOARD_PIN_BK_LIGHT, .gpio_num = BOARD_PIN_BK_LIGHT,
.duty = 0, .duty = 0,
.hpoint = 0, .hpoint = 0,
.flags.output_invert = 1,
}; };
ESP_ERROR_CHECK(ledc_channel_config(&ledc_channel)); ESP_ERROR_CHECK(ledc_channel_config(&ledc_channel));
@@ -90,9 +90,6 @@ esp_err_t display_init(esp_lcd_panel_io_handle_t *io_handle_out,
ESP_ERROR_CHECK(esp_lcd_panel_set_gap(panel_handle, BOARD_LCD_GAP_X, BOARD_LCD_GAP_Y)); ESP_ERROR_CHECK(esp_lcd_panel_set_gap(panel_handle, BOARD_LCD_GAP_X, BOARD_LCD_GAP_Y));
ESP_ERROR_CHECK(esp_lcd_panel_disp_on_off(panel_handle, true)); ESP_ERROR_CHECK(esp_lcd_panel_disp_on_off(panel_handle, true));
ESP_LOGI(TAG, "Turn on LCD backlight");
gpio_set_level(BOARD_PIN_BK_LIGHT, BOARD_LCD_BK_LIGHT_ON_LEVEL);
*io_handle_out = io_handle; *io_handle_out = io_handle;
*panel_handle_out = panel_handle; *panel_handle_out = panel_handle;
return ESP_OK; return ESP_OK;