From 8838372781348158dda463363a72be21d3aaa2bc Mon Sep 17 00:00:00 2001 From: "Ben V. Brown" Date: Fri, 30 Dec 2022 22:42:58 +1100 Subject: [PATCH] Long hold => ANC --- README.md | 6 +++--- apps/main/apps.cpp | 33 +++------------------------------ 2 files changed, 6 insertions(+), 33 deletions(-) diff --git a/README.md b/README.md index 7dfd0d8..19874da 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ In order to program the buds from inside of the docker container; privileged mod # Now that the firmware has finished building; if there are no errors you can load it to your buds # You may need to take the buds out of the case, wait three seconds, place them back. This wakes them up and the programmer needs to catch this reboot. -# You can try the helper script by running +# You can try the helper script by running ./download.sh # Or do it manually by : @@ -48,14 +48,14 @@ bestool write-image out/open_source/open_source.bin --port /dev/ttyACM1 - Single tap : Play/Pause - Double tap : Next track -- Hold : Fast-Forward (Currently non functional, WIP) +- Hold : Toggle ANC(Currently non functional, WIP) - Triple tap : Volume Up #### Left Ear: - Single tap : Play/Pause - Double tap : Previous track -- Hold : Rewind (Currently non functional, WIP) +- Hold : Toggle ANC(Currently non functional, WIP) - Triple tap : Volume Down ### Single pod active diff --git a/apps/main/apps.cpp b/apps/main/apps.cpp index 42ff193..27f6dd9 100644 --- a/apps/main/apps.cpp +++ b/apps/main/apps.cpp @@ -1378,13 +1378,13 @@ void app_latency_switch_key_handler(void) * Right Ear: * Single tap : Play/Pause * Double tap : Next track - * Hold : Fast-Forward + * Hold : ANC on/off * Triple tap : Volume Up * * Left Ear: * Single tap : Play/Pause * Double tap : Previous track - * Hold : Rewind + * Hold : ANC on/off * Triple tap : Volume Down * Single pod active: @@ -1522,37 +1522,11 @@ void app_key_long_press_down(APP_KEY_STATUS *status, void *param) send_prev_track(); }else { //Bud's are working as a pair - if (app_tws_is_left_side()){ - TRACE(0,"Handling %s as left bud",__func__); - //Lefty - - }else { - TRACE(0,"Handling %s as right bud",__func__); - //Righty - - } + app_anc_key(status,param); } } -void app_key_long_press_up(APP_KEY_STATUS *status, void *param) -{ - TRACE(2,"%s event %d", __func__, status->event); - - if (!app_tws_ibrt_tws_link_connected()){ - //No other bud paired - TRACE(0,"Handling %s in single bud mode",__func__); - }else { - //Bud's are working as a pair - if (app_tws_is_left_side()){ - TRACE(0,"Handling %s as left bud",__func__); - //Lefty - }else { - TRACE(0,"Handling %s as right bud",__func__); - //Righty - } - } -} void app_key_reboot(APP_KEY_STATUS *status, void *param) { @@ -1573,7 +1547,6 @@ void app_key_init(void) {{APP_KEY_CODE_PWR,APP_KEY_EVENT_TRIPLECLICK},"",app_key_triple_tap, NULL}, {{APP_KEY_CODE_PWR,APP_KEY_EVENT_ULTRACLICK},"",app_key_quad_tap, NULL}, {{APP_KEY_CODE_PWR,APP_KEY_EVENT_LONGPRESS},"",app_key_long_press_down, NULL}, - {{APP_KEY_CODE_PWR,APP_KEY_EVENT_UP_AFTER_LONGPRESS},"",app_key_long_press_up, NULL}, }; app_key_handle_clear();