diff --git a/components/FluxButton/FluxButton.h b/components/FluxButton/FluxButton.h index add3c97..1777513 100644 --- a/components/FluxButton/FluxButton.h +++ b/components/FluxButton/FluxButton.h @@ -27,6 +27,8 @@ enum button_cmd_t BUTTON_CMD_CENTER_KEY=2, BUTTON_CMD_LEFT_KEY=3, BUTTON_CMD_RIGHT_KEY=4, + BUTTON_CMD_LCD_CLOSE=5, + BUTTON_CMD_LCD_OPEN=6, }; #define CONFIG_GPIO_BUTTON_SUPPORT_POWER_SAVE 0 diff --git a/components/FluxPower/FluxPower.h b/components/FluxPower/FluxPower.h index 0608b9c..5faa1e2 100644 --- a/components/FluxPower/FluxPower.h +++ b/components/FluxPower/FluxPower.h @@ -12,6 +12,12 @@ #include "esp_adc/adc_cali_scheme.h" #include "ui.h" +#define CLOSE_LCD_BACKLIGHT ESP_ERROR_CHECK(ledc_set_duty(LEDC_LOW_SPEED_MODE, LEDC_CHANNEL_0, 9192));\ + ESP_ERROR_CHECK(ledc_update_duty(LEDC_LOW_SPEED_MODE, LEDC_CHANNEL_0)); + +#define OPEN_LCD_BACKLIGHT ESP_ERROR_CHECK(ledc_set_duty(LEDC_LOW_SPEED_MODE, LEDC_CHANNEL_0, 100));\ + ESP_ERROR_CHECK(ledc_update_duty(LEDC_LOW_SPEED_MODE, LEDC_CHANNEL_0)); + /*配置ADC采用通道*/ #define EXAMPLE_ADC1_CHAN8 ADC_CHANNEL_8 /*配置用于进行ADC采样的引脚*/