From 54a37c230cb9e1a8f6f166994c902e58d7706a28 Mon Sep 17 00:00:00 2001 From: "Ben V. Brown" Date: Wed, 28 Dec 2022 20:42:06 +1100 Subject: [PATCH] Long press in charge case to reboot --- apps/main/apps.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/apps/main/apps.cpp b/apps/main/apps.cpp index 9ebc56d..267c69f 100644 --- a/apps/main/apps.cpp +++ b/apps/main/apps.cpp @@ -1396,12 +1396,17 @@ void app_key_init(void) } #endif } +void app_key_reboot(APP_KEY_STATUS *status, void *param) +{ + TRACE(1,"%s ",__func__); + hal_cmu_sys_reboot(); +} void app_key_init_on_charging(void) { uint8_t i = 0; const APP_KEY_HANDLE key_cfg[] = { - // {{APP_KEY_CODE_PWR,APP_KEY_EVENT_REPEAT},"ota function key",app_ota_key_handler, NULL}, + {{APP_KEY_CODE_PWR,APP_KEY_EVENT_LONGLONGPRESS},"long press reboot",app_key_reboot, NULL}, // {{APP_KEY_CODE_PWR,APP_KEY_EVENT_CLICK},"bt function key",app_dfu_key_handler, NULL}, #ifdef __USB_COMM__ {{APP_KEY_CODE_PWR,APP_KEY_EVENT_LONGPRESS},"usb cdc key",app_usb_cdc_comm_key_handler, NULL},