user_button.c 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include "user_button.h"
  4. #include "iot_button.h"
  5. #include "esp_log.h"
  6. #include "freertos/FreeRTOS.h"
  7. #include "freertos/task.h"
  8. #include "freertos/queue.h"
  9. #include "freertos/semphr.h"
  10. #include "freertos/timers.h"
  11. #include "../EPD//include/EPD.h"
  12. #include <stdlib.h>
  13. #include <time.h>
  14. #include <unistd.h>
  15. #include <sys/time.h>
  16. static const char *LOG_TAG = "user button";
  17. static struct timeval btn_last_time;//左屏超过30s,不发送按键lora信息
  18. extern QueueHandle_t button_Data_queue;
  19. extern SemaphoreHandle_t button_semaphore;
  20. static button_handle_t user_button_handle[KEY_NUM] = {0};
  21. static button_handle_t user_powerbutton_handle[3] = {0};
  22. TimerHandle_t btn_timer_handle;
  23. RTC_FAST_ATTR static bool is_setting = false;
  24. RTC_FAST_ATTR static bool is_reset_net = false;//配网
  25. RTC_FAST_ATTR static bool is_send_lora = false;
  26. uint16_t adc_value[][2]=
  27. {
  28. {BAOYANG_MIN_ADC,BAOYANG_MAX_ADC},
  29. {FENGCUN_MIN_ADC,FENGCUN_MAX_ADC},
  30. {GUZHUANG_MIN_ADC,GUZHANG_MAX_ADC},
  31. {DAILIAO_MIN_ADC,DAILIAO_MAX_ADC},
  32. {TINGJI_MIN_ADC,TINGJI_MAX_ADC},
  33. {YUNXING_MIN_ADC,YUNXING_MAX_ADC},
  34. };
  35. static void press_up_cb(void *arg,void *usr_data);
  36. static void long_press_up_cb(void *arg,void *usr_data);
  37. uint16_t power_adc_value[][2]=
  38. {
  39. {0,100},
  40. {1000,1900},
  41. {2000,3063},
  42. };
  43. int find_key_value(int value)
  44. {
  45. int key = 0xff;
  46. for(int i =0 ;i<6;i++)
  47. {
  48. if(
  49. (adc_value[i][1]>=value)&&
  50. (adc_value[i][0]<=value)
  51. )
  52. {
  53. key = i;
  54. printf("key vaule %d\r\n",i);
  55. break;
  56. }
  57. }
  58. return key;
  59. }
  60. static void user_button_single_click_cb(void *arg,void *usr_data);
  61. static void power_long_press_start_cb(void *arg,void *usr_data);
  62. static void power_long_press_hold_cb(void *arg,void *usr_data);
  63. static void power_long_press_up_cb(void *arg,void *usr_data);
  64. static void power_single_press_cb(void *arg,void *usr_data);
  65. static void user_button_single_UP_cb(void *arg,void *usr_data);
  66. static void power_button_multi_press_cb(void *arg,void *usr_data);
  67. static void power_left_single_press_cb(void *arg,void *usr_data)
  68. {
  69. printf("%s\r\n",__FUNCTION__);
  70. }
  71. static void power_right_single_press_cb(void *arg,void *usr_data)
  72. {
  73. printf("%s\r\n",__FUNCTION__);
  74. }
  75. int button_idx = 0;
  76. int power_button_idx = 0;
  77. int power_button_mult_time = 0;
  78. void btn_timer_Callback(TimerHandle_t xTimer)
  79. {
  80. ESP_LOGW(LOG_TAG, "btn_timer_Callback");
  81. if(is_setting)
  82. {
  83. is_setting = false;
  84. }
  85. else if (is_reset_net)
  86. {
  87. is_reset_net = false;
  88. }
  89. is_setting = 0;
  90. //xTimerStop(btn_timer_handle,0);
  91. }
  92. static void get_rtc_time(struct tm* tmp)
  93. {
  94. struct timeval tv;
  95. gettimeofday(&tv, NULL);
  96. // 打印 RTC 时间戳
  97. printf("RTC Timestamp: %lld\n", tv.tv_sec);
  98. // 使用 localtime 函数将时间戳转换为本地时间
  99. tmp = localtime(&tv.tv_sec);
  100. // 打印本地时间
  101. printf(" get_rtc_time: %04d-%02d-%02d %02d:%02d:%02d\n",
  102. tmp->tm_year + 1900, tmp->tm_mon + 1, tmp->tm_mday,
  103. tmp->tm_hour, tmp->tm_min, tmp->tm_sec);
  104. }
  105. bool is_btn_timeout(void)
  106. {
  107. struct timeval now_time;
  108. gettimeofday(&now_time, NULL);
  109. ESP_LOGD(LOG_TAG,"is_send_lora= %s now_time = %lld,last = %lld,\n",is_send_lora?"ture":"false",now_time.tv_sec, btn_last_time.tv_sec);
  110. struct tm* tmp = localtime(&now_time.tv_sec);
  111. // ESP_LOGI(LOG_TAG,"时间: %04d-%02d-%02d %02d:%02d:%02d\n",
  112. // tmp->tm_year + 1900, tmp->tm_mon + 1, tmp->tm_mday,
  113. // tmp->tm_hour, tmp->tm_min, tmp->tm_sec);
  114. if(((now_time.tv_sec - btn_last_time.tv_sec) > 30)&&(is_send_lora))
  115. {
  116. ESP_LOGW(LOG_TAG,"发送-----现在按键时间: %04d-%02d-%02d %02d:%02d:%02d\n",
  117. tmp->tm_year + 1900, tmp->tm_mon + 1, tmp->tm_mday,
  118. tmp->tm_hour, tmp->tm_min, tmp->tm_sec);
  119. is_send_lora = false;
  120. return true;
  121. }
  122. return false;
  123. }
  124. void reset_btn_last_time(void)
  125. {
  126. if(!is_send_lora)
  127. {
  128. is_send_lora = true;
  129. }
  130. gettimeofday(&btn_last_time, NULL);
  131. struct tm* tmp = localtime(&btn_last_time.tv_sec);
  132. // printf("btn_last_time: %lld\n", btn_last_time.tv_sec);
  133. ESP_LOGW(LOG_TAG,"最后按键时间: %04d-%02d-%02d %02d:%02d:%02d\n",
  134. tmp->tm_year + 1900, tmp->tm_mon + 1, tmp->tm_mday,
  135. tmp->tm_hour, tmp->tm_min, tmp->tm_sec);
  136. }
  137. void button_init(adc_oneshot_unit_handle_t adc_handle)
  138. {
  139. int i;
  140. printf("button_init\n");
  141. #if 1
  142. button_config_t adc_btn_cfg = {
  143. .type = BUTTON_TYPE_ADC,
  144. .long_press_time = CONFIG_BUTTON_LONG_PRESS_TIME_MS,
  145. .short_press_time = CONFIG_BUTTON_SHORT_PRESS_TIME_MS,
  146. .adc_button_config = {
  147. .adc_channel = 7,
  148. .adc_handle = &adc_handle,
  149. },
  150. };
  151. //左边6个按键初始化
  152. for(i = 0;i < KEY_NUM ;i++)
  153. {
  154. adc_btn_cfg.adc_button_config.button_index = i;
  155. adc_btn_cfg.adc_button_config.min = adc_value[i][0] ;
  156. adc_btn_cfg.adc_button_config.max = adc_value[i][1] ;
  157. user_button_handle[i] = iot_button_create(&adc_btn_cfg);
  158. if(NULL == user_button_handle[i]) {
  159. printf( "Button create failed");
  160. }
  161. button_idx = i;
  162. // iot_button_register_cb( user_button_handle[i], BUTTON_PRESS_DOWN, user_button_single_click_cb,button_idx);
  163. iot_button_register_cb( user_button_handle[i], BUTTON_PRESS_UP, user_button_single_click_cb,button_idx);//松手才发按键消息
  164. // iot_button_register_cb( user_button_handle[i], BUTTON_LONG_PRESS_UP, long_press_up_cb,button_idx);
  165. //iot_button_register_cb( user_button_handle[i], BUTTON_PRESS_UP, user_button_single_click_cb,button_idx);
  166. }
  167. #endif
  168. //电源按键
  169. btn_timer_handle = xTimerCreate(
  170. "btn_timer_handle",
  171. pdMS_TO_TICKS(10*1000),
  172. pdFALSE,
  173. 0,
  174. btn_timer_Callback
  175. );
  176. #if 0
  177. //右边3个按键 目前只是用一个按键 POWER
  178. button_config_t power_btn_cfg = {
  179. .type = BUTTON_TYPE_GPIO,
  180. .long_press_time = CONFIG_BUTTON_LONG_PRESS_TIME_MS,
  181. .short_press_time = CONFIG_BUTTON_SHORT_PRESS_TIME_MS,
  182. .adc_button_config = {
  183. .adc_channel = 3,
  184. .adc_handle = &adc_handle,
  185. },
  186. };
  187. for(int i = 0;i < 1 ;i++)
  188. {
  189. power_btn_cfg.adc_button_config.button_index = i;
  190. power_btn_cfg.adc_button_config.min = power_adc_value[i][0] ;
  191. power_btn_cfg.adc_button_config.max = power_adc_value[i][1] ;
  192. user_powerbutton_handle[i] = iot_button_create(&power_btn_cfg);
  193. if(NULL == user_powerbutton_handle[i]) {
  194. printf( "Button create failed");
  195. }
  196. button_idx = i;
  197. iot_button_register_cb( user_powerbutton_handle[i], BUTTON_PRESS_DOWN, power_single_press_cb,button_idx);
  198. #if 0
  199. iot_button_register_cb( user_powerbutton_handle[i], BUTTON_LONG_PRESS_START, power_long_press_cb,button_idx);
  200. #else
  201. iot_button_register_cb( user_powerbutton_handle[i], BUTTON_LONG_PRESS_START, power_long_press_start_cb,button_idx);
  202. iot_button_register_cb( user_powerbutton_handle[i], BUTTON_LONG_PRESS_HOLD, power_long_press_hold_cb,button_idx);
  203. iot_button_register_cb( user_powerbutton_handle[i], BUTTON_LONG_PRESS_UP, power_long_press_up_cb,button_idx);
  204. #endif
  205. //注册按键多次按键回调
  206. button_event_config_t btn_cfg;
  207. btn_cfg.event = BUTTON_MULTIPLE_CLICK;
  208. // btn_cfg.event_data.multiple_clicks.clicks = POWER_KEY_PRSSS_COUNT_OTA;
  209. // power_button_mult_time = btn_cfg.event_data.multiple_clicks.clicks ;
  210. // iot_button_register_event_cb(user_powerbutton_handle[i], btn_cfg, power_button_multi_press_cb, power_button_mult_time);
  211. btn_cfg.event_data.multiple_clicks.clicks = POWER_KEY_PRSSS_COUNT_RESET;
  212. power_button_mult_time = btn_cfg.event_data.multiple_clicks.clicks ;
  213. iot_button_register_event_cb(user_powerbutton_handle[i], btn_cfg, power_button_multi_press_cb, power_button_mult_time);
  214. btn_cfg.event_data.multiple_clicks.clicks = POWER_KEY_PRSSS_BLE_OTA_MODE;
  215. power_button_mult_time = btn_cfg.event_data.multiple_clicks.clicks ;
  216. iot_button_register_event_cb(user_powerbutton_handle[i], btn_cfg, power_button_multi_press_cb, power_button_mult_time);
  217. // //注册按键长按按键回调
  218. // button_event_config_t btn_long_press_cfg;
  219. // btn_cfg.event = BUTTON_LONG_PRESS_START;
  220. }
  221. #else
  222. button_config_t power_btn_cfg = {
  223. .type = BUTTON_TYPE_GPIO,
  224. .long_press_time = CONFIG_BUTTON_LONG_PRESS_TIME_MS,
  225. .short_press_time = CONFIG_BUTTON_SHORT_PRESS_TIME_MS,
  226. .gpio_button_config = {
  227. .gpio_num = 4,
  228. .active_level = 0,
  229. },
  230. };
  231. for( i = 0;i < 1 ;i++)
  232. {
  233. //power_btn_cfg.adc_button_config.button_index = i;
  234. //power_btn_cfg.adc_button_config.min = power_adc_value[i][0] ;
  235. //power_btn_cfg.adc_button_config.max = power_adc_value[i][1] ;
  236. user_powerbutton_handle[i] = iot_button_create(&power_btn_cfg);
  237. if(NULL == user_powerbutton_handle[i]) {
  238. printf( "Button create failed");
  239. }
  240. button_idx = i;
  241. iot_button_register_cb( user_powerbutton_handle[i], BUTTON_PRESS_DOWN, power_single_press_cb,button_idx);
  242. #if 0
  243. iot_button_register_cb( user_powerbutton_handle[i], BUTTON_LONG_PRESS_START, power_long_press_cb,button_idx);
  244. #else
  245. iot_button_register_cb( user_powerbutton_handle[i], BUTTON_LONG_PRESS_START, power_long_press_start_cb,button_idx);
  246. iot_button_register_cb( user_powerbutton_handle[i], BUTTON_LONG_PRESS_HOLD, power_long_press_hold_cb,button_idx);
  247. iot_button_register_cb( user_powerbutton_handle[i], BUTTON_LONG_PRESS_UP, power_long_press_up_cb,button_idx);
  248. #endif
  249. //注册按键多次按键回调
  250. button_event_config_t btn_cfg;
  251. btn_cfg.event = BUTTON_MULTIPLE_CLICK;
  252. // btn_cfg.event_data.multiple_clicks.clicks = POWER_KEY_PRSSS_COUNT_OTA;
  253. // power_button_mult_time = btn_cfg.event_data.multiple_clicks.clicks ;
  254. // iot_button_register_event_cb(user_powerbutton_handle[i], btn_cfg, power_button_multi_press_cb, power_button_mult_time);
  255. btn_cfg.event_data.multiple_clicks.clicks = POWER_KEY_PRSSS_COUNT_RESET;
  256. power_button_mult_time = btn_cfg.event_data.multiple_clicks.clicks ;
  257. iot_button_register_event_cb(user_powerbutton_handle[i], btn_cfg, power_button_multi_press_cb, power_button_mult_time);
  258. btn_cfg.event_data.multiple_clicks.clicks = POWER_KEY_PRSSS_DIS_RIGHT;
  259. power_button_mult_time = btn_cfg.event_data.multiple_clicks.clicks ;
  260. iot_button_register_event_cb(user_powerbutton_handle[i], btn_cfg, power_button_multi_press_cb, power_button_mult_time);
  261. btn_cfg.event_data.multiple_clicks.clicks = POWER_KEY_PRSSS_BLE_OTA_MODE;
  262. power_button_mult_time = btn_cfg.event_data.multiple_clicks.clicks ;
  263. iot_button_register_event_cb(user_powerbutton_handle[i], btn_cfg, power_button_multi_press_cb, power_button_mult_time);
  264. // //注册按键长按按键回调
  265. // button_event_config_t btn_long_press_cfg;
  266. // btn_cfg.event = BUTTON_LONG_PRESS_START;
  267. }
  268. #endif
  269. }
  270. void button_deinit(void)
  271. {
  272. printf("button_deinit\n");
  273. for(int i=0;i<KEY_NUM;i++)
  274. {
  275. iot_button_delete(user_button_handle[i]);
  276. }
  277. //iot_button_delete(user_powerbutton_handle[0]);
  278. }
  279. void power_button_init(adc_oneshot_unit_handle_t adc_handle)
  280. {
  281. }
  282. void power_button_deinit(void)
  283. {
  284. for(int i = 0;i < 3;i++)
  285. iot_button_delete(user_powerbutton_handle[i]);
  286. }
  287. uint8_t button_info = 0;
  288. #include "SPIFFS.h"
  289. #if 0
  290. static void power_long_press_cb(void *arg,void *usr_data)
  291. {
  292. switch ((int)usr_data)
  293. {
  294. case 0:
  295. printf("power key long press start\r\n");
  296. button_info = POWER_ON_INTO_STATUS_CHANGE_VALUE;
  297. if(xQueueSend(button_Data_queue,&button_info,0) != true)
  298. {
  299. ESP_LOGE(LOG_TAG,"queue send is fail");
  300. return;
  301. }
  302. break;
  303. case 1:
  304. printf("power left key long press\r\n");
  305. break;
  306. }
  307. }
  308. iot_button_get_long_press_hold_cnt((button_handle_t)arg)
  309. #else
  310. static void press_up_cb(void *arg,void *usr_data)
  311. {
  312. ESP_LOGE(LOG_TAG,"BUTTON_PRESS_UP %d",(int)usr_data);
  313. }
  314. static void long_press_up_cb(void *arg,void *usr_data)
  315. {
  316. ESP_LOGE(LOG_TAG,"BUTTON_LONG_PRESS_UP %d",(int)usr_data);
  317. }
  318. static void power_long_press_start_cb(void *arg,void *usr_data)
  319. {
  320. // printf("power_long_press_start_cb\n");
  321. }
  322. static void power_long_press_hold_cb(void *arg,void *usr_data)
  323. {
  324. //设置的长按开始时间后开始计算hold_cnt 长按开始时间设置为1s,cnt计算时间间隔(SERIAL_TICKS)也设置为1s
  325. uint16_t hold_cnt = iot_button_get_long_press_hold_cnt((button_handle_t)arg);
  326. ESP_LOGE(LOG_TAG," BUTTON_LONG_PRESS_HOLD[%d],count is [%d]\n", iot_button_get_ticks_time((button_handle_t)arg), hold_cnt);
  327. switch ((int)hold_cnt)
  328. {
  329. case 2://设置模式,长按3s进入
  330. if(is_setting && is_reset_net)
  331. {
  332. ESP_LOGE(LOG_TAG,"err:OTA 和 重新配网 同时");
  333. return;
  334. }
  335. if(is_setting)
  336. {
  337. button_info = POWER_ON_INTO_OTA_VALUE;
  338. if(xQueueSend(button_Data_queue,&button_info,0) != true)
  339. {
  340. ESP_LOGE(LOG_TAG,"queue send is fail");
  341. return;
  342. }
  343. }
  344. if(is_reset_net)
  345. {
  346. button_info = POWER_ON_INTO_RESET_VALUE;
  347. if(xQueueSend(button_Data_queue,&button_info,0) != true)
  348. {
  349. ESP_LOGE(LOG_TAG,"queue send is fail");
  350. return;
  351. }
  352. }
  353. break;
  354. case 4://5s开关机
  355. button_info = POWER_ON_INTO_STATUS_CHANGE_VALUE;
  356. if(xQueueSend(button_Data_queue,&button_info,0) != true)
  357. {
  358. ESP_LOGE(LOG_TAG,"queue send is fail");
  359. return;
  360. }
  361. break;
  362. default:
  363. //printf(" BUTTON_LONG_PRESS_HOLD[%d],count is [%d]\n", iot_button_get_ticks_time((button_handle_t)arg), hold_cnt);
  364. break;
  365. }
  366. }
  367. static void power_long_press_up_cb(void *arg,void *usr_data)
  368. {
  369. // printf("power_long_press_up_cb\n");
  370. }
  371. #endif
  372. #include "esp_sleep.h"
  373. static void power_single_press_cb(void *arg,void *usr_data)
  374. {
  375. switch ((int)usr_data)
  376. {
  377. case 0:
  378. printf("power sigle press\r\n");
  379. if(Machine_info.power_status == 1) //开机
  380. {
  381. button_info = POWER_ON_PRESS_VALUE;
  382. if(xQueueSend(button_Data_queue,&button_info,0) != true)
  383. {
  384. ESP_LOGE(LOG_TAG,"queue send is fail");
  385. return;
  386. }
  387. }else
  388. {
  389. button_info = POWER_OFF_PRESS_VALUE; //关机状态下单击按键
  390. if(xQueueSend(button_Data_queue,&button_info,0) != true)
  391. {
  392. ESP_LOGE(LOG_TAG,"queue send is fail");
  393. return;
  394. }
  395. }
  396. break;
  397. case 1:
  398. printf("power left single press\r\n");
  399. break;
  400. case 2:
  401. printf("power right single press\r\n");
  402. break;
  403. }
  404. }
  405. static void user_button_single_click_cb(void *arg,void *usr_data)
  406. {
  407. is_setting = false;
  408. is_reset_net = false;
  409. ESP_LOGW(LOG_TAG," single_click_cb[%d]", iot_button_get_ticks_time((button_handle_t)arg));
  410. switch ((int)usr_data)
  411. {
  412. case BAOYANG_KEY:
  413. button_info = 6;
  414. ESP_LOGD(LOG_TAG,"bao yang");
  415. break;
  416. case FENGCUN_KEY:
  417. button_info = 5;
  418. ESP_LOGD(LOG_TAG,"feng cun");
  419. break;
  420. case GUZHUANG_KEY:
  421. button_info = 4;
  422. ESP_LOGD(LOG_TAG,"gu zhang");
  423. break;
  424. case DAILIAO_KEY:
  425. button_info = 3;
  426. ESP_LOGD(LOG_TAG,"dai liao");
  427. break;
  428. case TINGJI_KEY:
  429. button_info = 2;
  430. ESP_LOGD(LOG_TAG,"ting ji");
  431. break;
  432. case YUNXING_KEY:
  433. button_info = 1;
  434. ESP_LOGD(LOG_TAG,"yun xing");
  435. break;
  436. default:
  437. break;
  438. }
  439. #if 0
  440. if(xSemaphoreTake(button_semaphore, 0) != true)
  441. {
  442. ESP_LOGE(LOG_TAG,"button mutex is fail,not send lora queue");
  443. return;
  444. }
  445. xSemaphoreGive(button_semaphore);
  446. #endif
  447. if(Machine_info.power_status == 0) //关机
  448. {
  449. printf("power off not refresh\r\n");
  450. return;
  451. }
  452. if(xQueueSend(button_Data_queue,&button_info,0) != true)
  453. {
  454. ESP_LOGE(LOG_TAG,"queue send is fail");
  455. return;
  456. }
  457. }
  458. static void power_button_multi_press_cb(void *arg,void *usr_data)
  459. {
  460. if(Machine_info.power_status == 0) //关机
  461. {
  462. printf("关机状态\r\n");
  463. return;
  464. }
  465. switch ((int)usr_data)
  466. {
  467. case POWER_KEY_PRSSS_BLE_OTA_MODE:
  468. if(!is_setting && !is_reset_net) //当前非配置模式
  469. {
  470. is_setting = true;
  471. xTimerStart(btn_timer_handle, 0);
  472. printf("短按2次\r\n");
  473. }
  474. break;
  475. case POWER_KEY_PRSSS_DIS_RIGHT:
  476. printf("短按3次\r\n");
  477. send_button_key_queue((uint8_t)POWER_ON_INTO_DIS_RIGHT);
  478. break;
  479. case POWER_KEY_PRSSS_COUNT_RESET:
  480. if(!is_setting && !is_reset_net)
  481. {
  482. is_reset_net = true;
  483. xTimerStart(btn_timer_handle, 0);
  484. printf("短按4次\r\n");
  485. }
  486. break;
  487. }
  488. }
  489. static void user_button_single_UP_cb(void *arg,void *usr_data)
  490. {
  491. }
  492. void send_button_key_queue(uint8_t value)
  493. {
  494. button_info = value;
  495. if(xQueueSend(button_Data_queue,&button_info,0) != true)
  496. {
  497. ESP_LOGE(LOG_TAG,"queue send is fail");
  498. return;
  499. }
  500. }