From f7f468428a0da6937af41d8c15c633afbcf69136 Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Fri, 3 Jul 2026 17:26:30 -0400 Subject: [PATCH] Engage nRF advertising boost on button press by ordering it before updatemsdata The button handler called updatemsdata() (which restarts nRF advertising via ble_nrf_apply_adv_interval()) and only then ble_nrf_boost_advertising(). Since the boost deadline was still unset during the restart, apply_adv_interval used the normal interval, and ble_nrf_advertising_tick() merely returns while boosting without restarting advertising. Net effect: a single button press never actually applied the 20-30 ms boost interval (it only engaged if a second event restarted advertising within the 3 s window). Set the boost deadline before updatemsdata() so its advertising restart picks up the fast interval. Co-Authored-By: Claude Opus 4.8 Claude-Session: https://claude.ai/code/session_01MgW3EZCfMkGFffseDPwV74 --- src/device_control.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/device_control.cpp b/src/device_control.cpp index 5cb2fd9..5182d09 100644 --- a/src/device_control.cpp +++ b/src/device_control.cpp @@ -443,10 +443,10 @@ void processButtonEvents() { dynamicreturndata[btn->byte_index] = buttonData; } } - updatemsdata(); #ifdef TARGET_NRF ble_nrf_boost_advertising(); #endif + updatemsdata(); } }