diff --git a/main/boards/common/button.cc b/main/boards/common/button.cc index 723cc730..84400a60 100644 --- a/main/boards/common/button.cc +++ b/main/boards/common/button.cc @@ -9,7 +9,7 @@ AdcButton::AdcButton(const button_adc_config_t& adc_config) : Button(nullptr) { button_config_t btn_config = { .long_press_time = 2000, - .short_press_time = 50, + .short_press_time = 0, }; ESP_ERROR_CHECK(iot_button_new_adc_device(&btn_config, &adc_config, &button_handle_)); } diff --git a/main/boards/common/button.h b/main/boards/common/button.h index 4c7ef616..8396d89c 100644 --- a/main/boards/common/button.h +++ b/main/boards/common/button.h @@ -11,7 +11,7 @@ class Button { public: Button(button_handle_t button_handle); - Button(gpio_num_t gpio_num, bool active_high = false, uint16_t long_press_time = 1000, uint16_t short_press_time = 50); + Button(gpio_num_t gpio_num, bool active_high = false, uint16_t long_press_time = 0, uint16_t short_press_time = 0); ~Button(); void OnPressDown(std::function callback); diff --git a/main/boards/df-k10/df_k10_board.cc b/main/boards/df-k10/df_k10_board.cc index ed80382b..81692675 100644 --- a/main/boards/df-k10/df_k10_board.cc +++ b/main/boards/df-k10/df_k10_board.cc @@ -111,7 +111,7 @@ private: // Button A button_config_t btn_a_config = { .long_press_time = 1000, - .short_press_time = 50 + .short_press_time = 0 }; button_driver_t btn_a_driver = { .enable_power_save = false, @@ -140,7 +140,7 @@ private: // Button B button_config_t btn_b_config = { .long_press_time = 1000, - .short_press_time = 50 + .short_press_time = 0 }; button_driver_t btn_b_driver = { .enable_power_save = false, diff --git a/main/boards/esp32-s3-touch-lcd-1.46/esp32-s3-touch-lcd-1.46.cc b/main/boards/esp32-s3-touch-lcd-1.46/esp32-s3-touch-lcd-1.46.cc index d6629bb0..6e993e0e 100644 --- a/main/boards/esp32-s3-touch-lcd-1.46/esp32-s3-touch-lcd-1.46.cc +++ b/main/boards/esp32-s3-touch-lcd-1.46/esp32-s3-touch-lcd-1.46.cc @@ -173,7 +173,7 @@ private: // Boot Button button_config_t boot_btn_config = { .long_press_time = 2000, - .short_press_time = 50 + .short_press_time = 0 }; button_driver_t boot_btn_driver = { .enable_power_save = false, @@ -195,7 +195,7 @@ private: // Power Button button_config_t pwr_btn_config = { .long_press_time = 5000, - .short_press_time = 50 + .short_press_time = 0 }; button_driver_t pwr_btn_driver = { .enable_power_save = false, diff --git a/main/boards/esp32-s3-touch-lcd-1.85/esp32-s3-touch-lcd-1.85.cc b/main/boards/esp32-s3-touch-lcd-1.85/esp32-s3-touch-lcd-1.85.cc index 8ce2d85e..c06eed1f 100644 --- a/main/boards/esp32-s3-touch-lcd-1.85/esp32-s3-touch-lcd-1.85.cc +++ b/main/boards/esp32-s3-touch-lcd-1.85/esp32-s3-touch-lcd-1.85.cc @@ -389,7 +389,7 @@ private: // Boot Button button_config_t boot_btn_config = { .long_press_time = 2000, - .short_press_time = 50 + .short_press_time = 0 }; button_driver_t boot_btn_driver = { .enable_power_save = false, @@ -408,7 +408,7 @@ private: // Power Button button_config_t pwr_btn_config = { .long_press_time = 5000, - .short_press_time = 50 + .short_press_time = 0 }; button_driver_t pwr_btn_driver = { .enable_power_save = false, diff --git a/main/boards/sensecap-watcher/sensecap_watcher.cc b/main/boards/sensecap-watcher/sensecap_watcher.cc index 6ddc868c..7d598660 100644 --- a/main/boards/sensecap-watcher/sensecap_watcher.cc +++ b/main/boards/sensecap-watcher/sensecap_watcher.cc @@ -242,12 +242,12 @@ private: // watcher 是通过长按滚轮进行开机的, 需要等待滚轮释放, 否则用户开机松手时可能会误触成单击 ESP_LOGI(TAG, "waiting for knob button release"); while(IoExpanderGetLevel(BSP_KNOB_BTN) == 0) { - vTaskDelay(50 / portTICK_PERIOD_MS); + vTaskDelay(pdMS_TO_TICKS(50)); } button_config_t btn_config = { .long_press_time = 2000, - .short_press_time = 50 + .short_press_time = 0 }; button_driver_t btn_driver = { .enable_power_save = false,