Merge branch 'fix/backlight-off' into develop
This commit is contained in:
commit
40ec379b2d
|
@ -10,7 +10,6 @@
|
|||
#include "driver/ledc.h"
|
||||
#include "driver/gpio.h"
|
||||
#include "esp_log.h"
|
||||
#include "esp_rom_gpio.h" // for output signal inversion
|
||||
#include "soc/ledc_periph.h" // to invert LEDC output on IDF version < v4.3
|
||||
|
||||
typedef struct {
|
||||
|
@ -57,7 +56,7 @@ disp_backlight_h disp_backlight_new(const disp_backlight_config_t *config)
|
|||
|
||||
ESP_ERROR_CHECK(ledc_timer_config(&LCD_backlight_timer));
|
||||
ESP_ERROR_CHECK(ledc_channel_config(&LCD_backlight_channel));
|
||||
esp_rom_gpio_connect_out_signal(config->gpio_num, ledc_periph_signal[LEDC_LOW_SPEED_MODE].sig_out0_idx + config->channel_idx, config->output_invert, 0);
|
||||
gpio_matrix_out(config->gpio_num, ledc_periph_signal[LEDC_LOW_SPEED_MODE].sig_out0_idx + config->channel_idx, config->output_invert, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -65,7 +64,7 @@ disp_backlight_h disp_backlight_new(const disp_backlight_config_t *config)
|
|||
bckl_dev->index = config->gpio_num;
|
||||
gpio_pad_select_gpio(config->gpio_num);
|
||||
ESP_ERROR_CHECK(gpio_set_direction(config->gpio_num, GPIO_MODE_OUTPUT));
|
||||
esp_rom_gpio_connect_out_signal(config->gpio_num, SIG_GPIO_OUT_IDX, config->output_invert, false);
|
||||
gpio_matrix_out(config->gpio_num, SIG_GPIO_OUT_IDX, config->output_invert, false);
|
||||
}
|
||||
|
||||
return (disp_backlight_h)bckl_dev;
|
||||
|
|
Loading…
Reference in a new issue