acconeer / acconeer-android-example-apps

Other
0 stars 4 forks source link

update rate setting is not working #3

Open AswinchristoJ opened 1 year ago

AswinchristoJ commented 1 year ago

During the distance measurement with distance.apk, even if I set a different update rate(eg: 1Hz) the update rate seems to be unchanged.

Please point me out if I'm missing something? Thanks in advance.

AswinchristoJ commented 1 year ago

I tried to write different update rate values using 3rd party BLE scanner apps to the sensor, but the problem remains. So I think maybe it is firmware's(_bluetooth_demo_appxm122.zip) bug.

vackraetraed commented 1 year ago

Hello, we do not really maintain or support this firmware.

But after a quick look, it looks like in acc_ble_app_common_xm122.c, at the function "static void idle_state_handle(bool use_timer)", the firmware only waits if !NRF_LOG_PROCESS(), this seems to skip the sleep. I removed the condition and it now seems to accurately set the update rate (at least in the mobile app). Here is the new function: static void idle_state_handle(bool use_timer) { NRF_LOG_PROCESS(); if (use_timer) { acc_app_integration_sleep_until_periodic_wakeup(); } else { nrf_pwr_mgmt_run(); } }