|
@@ -242,7 +242,7 @@ void power_button_init(adc_oneshot_unit_handle_t adc_handle)
|
|
|
power_button_mult_time = btn_cfg.event_data.multiple_clicks.clicks ;
|
|
|
iot_button_register_event_cb(user_powerbutton_handle[i], btn_cfg, power_button_multi_press_cb, power_button_mult_time);
|
|
|
|
|
|
- btn_cfg.event_data.multiple_clicks.clicks = POWER_KEY_PRSSS_SETTING_MODE;
|
|
|
+ btn_cfg.event_data.multiple_clicks.clicks = POWER_KEY_PRSSS_BLE_OTA_MODE;
|
|
|
power_button_mult_time = btn_cfg.event_data.multiple_clicks.clicks ;
|
|
|
iot_button_register_event_cb(user_powerbutton_handle[i], btn_cfg, power_button_multi_press_cb, power_button_mult_time);
|
|
|
|
|
@@ -307,7 +307,12 @@ void power_button_init(adc_oneshot_unit_handle_t adc_handle)
|
|
|
power_button_mult_time = btn_cfg.event_data.multiple_clicks.clicks ;
|
|
|
iot_button_register_event_cb(user_powerbutton_handle[i], btn_cfg, power_button_multi_press_cb, power_button_mult_time);
|
|
|
|
|
|
- btn_cfg.event_data.multiple_clicks.clicks = POWER_KEY_PRSSS_SETTING_MODE;
|
|
|
+
|
|
|
+ btn_cfg.event_data.multiple_clicks.clicks = POWER_KEY_PRSSS_DIS_RIGHT;
|
|
|
+ power_button_mult_time = btn_cfg.event_data.multiple_clicks.clicks ;
|
|
|
+ iot_button_register_event_cb(user_powerbutton_handle[i], btn_cfg, power_button_multi_press_cb, power_button_mult_time);
|
|
|
+
|
|
|
+ btn_cfg.event_data.multiple_clicks.clicks = POWER_KEY_PRSSS_BLE_OTA_MODE;
|
|
|
power_button_mult_time = btn_cfg.event_data.multiple_clicks.clicks ;
|
|
|
iot_button_register_event_cb(user_powerbutton_handle[i], btn_cfg, power_button_multi_press_cb, power_button_mult_time);
|
|
|
|
|
@@ -371,11 +376,13 @@ static void power_long_press_hold_cb(void *arg,void *usr_data)
|
|
|
{
|
|
|
//设置的长按开始时间后开始计算hold_cnt 长按开始时间设置为1s,cnt计算时间间隔(SERIAL_TICKS)也设置为1s
|
|
|
uint16_t hold_cnt = iot_button_get_long_press_hold_cnt((button_handle_t)arg);
|
|
|
+ ESP_LOGE(LOG_TAG," BUTTON_LONG_PRESS_HOLD[%d],count is [%d]\n", iot_button_get_ticks_time((button_handle_t)arg), hold_cnt);
|
|
|
+
|
|
|
switch ((int)hold_cnt)
|
|
|
{
|
|
|
- case 0:
|
|
|
+ case 1:
|
|
|
{
|
|
|
- ESP_LOGE(LOG_TAG,"case 0:");
|
|
|
+ ESP_LOGE(LOG_TAG,"case 1");
|
|
|
button_info = POWER_ON_INTO_DIS_RIGHT;
|
|
|
if(xQueueSend(button_Data_queue,&button_info,0) != true)
|
|
|
{
|
|
@@ -555,7 +562,7 @@ static void power_button_multi_press_cb(void *arg,void *usr_data)
|
|
|
}
|
|
|
switch ((int)usr_data)
|
|
|
{
|
|
|
- case POWER_KEY_PRSSS_SETTING_MODE:
|
|
|
+ case POWER_KEY_PRSSS_BLE_OTA_MODE:
|
|
|
if(!is_setting && !is_reset_net) //当前非配置模式
|
|
|
{
|
|
|
is_setting = true;
|
|
@@ -563,6 +570,10 @@ static void power_button_multi_press_cb(void *arg,void *usr_data)
|
|
|
printf("短按2次\r\n");
|
|
|
}
|
|
|
break;
|
|
|
+ case POWER_KEY_PRSSS_DIS_RIGHT:
|
|
|
+ printf("短按3次\r\n");
|
|
|
+ send_button_key_queue((uint8_t)POWER_ON_INTO_DIS_RIGHT);
|
|
|
+ break;
|
|
|
case POWER_KEY_PRSSS_COUNT_RESET:
|
|
|
if(!is_setting && !is_reset_net)
|
|
|
{
|