InfiniTime/src
James A. Jerkins c32ba844e0 Linear decrease of advert rate to conserve battery
Start advertising aggressively when powered on then
slow down linearly over 75 seconds. This will conserve
battery by not advertising rapidly the whole time we
are seeking a connection. The slowest rate is
approximately once every 4.5 seconds to balance
responsiveness and battery life.

We use a fixed advertising duration of 5 seconds and start
with a 62.5 ms advertising interval. Every 5 seconds
(the advertising duration) we step up to a larger
advertising interval (slower advertising). We continue
to increase the advertising interval linearly for
75 seconds from the start of advertising. At 75 seconds
we have an advertising interval of 4.44 seconds which we
keep until connected. A reboot will restart the sequence.

When we receive a disconnect event we restart the sequence
with fast advertising and then slow down as described above.
Note that we are not using the BLE high duty cycle setting to
change the advertising rate. The rate is managed by repeatedly
setting the minimum and maximum intervals.

The linear rate of decrease and the slowest interval size
were determined experimentally by the author. The 5.3 Core
spec suggests that you not advertise slower than once
every 1.2 seconds to preserve responsiveness but we
ignored that suggestion.
2021-09-04 15:57:07 -05:00
..
components Linear decrease of advert rate to conserve battery 2021-09-04 15:57:07 -05:00
displayapp Fix music app buttons 2021-08-18 20:19:02 +02:00
drivers Removed an illogical comparison from SystemInfo and St7789 driver (#449) 2021-06-22 20:31:31 +02:00
FreeRTOS Remove debug defines (DEBUG & DEBUG_NRF_USER) from the build. These debug can be useful for debugging purposes but not in production (release). (#400) 2021-06-01 21:02:15 +02:00
heartratetask Move most of the code from the constructor of the objects statically initialized in main() into Start()/Init() functions to avoid Static Initialization Order Fiasco (https://en.cppreference.com/w/cpp/language/siof). See https://github.com/JF002/InfiniTime/pull/415#issuecomment-859004238. 2021-06-12 10:58:28 +02:00
libs Fix compile warnings 2021-07-25 18:01:13 +02:00
logging Merge pull request #349 from Avamander/patch-2 2021-05-15 09:57:22 +02:00
systemtask WIP Refactor ble advertising 2021-08-29 15:50:04 -05:00
BootloaderVersion.cpp SPI flash sleep if bootloader >= 1.0.0 (#322) 2021-06-26 20:53:32 +02:00
BootloaderVersion.h SPI flash sleep if bootloader >= 1.0.0 (#322) 2021-06-26 20:53:32 +02:00
CMakeLists.txt WIP Refactor ble advertising 2021-08-29 15:50:04 -05:00
FreeRTOSConfig.h LVGL use system tick 2021-07-07 15:47:47 +03:00
main.cpp Set pin before loop 2021-08-14 21:00:33 +02:00
main.h Include cleanup: components 2020-11-16 01:35:45 +01:00
recoveryLoader.cpp Reformatted all the files according to clang-format style 2021-04-24 11:39:53 +03:00
sdk_config.h Reformatted all the files according to clang-format style 2021-04-24 11:39:53 +03:00
Version.h.in git: store git short ref hash on build stage to Version.h 2021-05-14 01:08:37 +03:00