How to keep track of time while sleeping on SPBTLE / BlueNRG-1 devices
In order to keep track of the Time of Day I would like to implement a time tick.
None of the timers run (other than the virtual timer) when the bluetooth module goes into low power mode. I would like the CPU to only wake up when there is an external event or one of the virtual timers expire. I do not want the virtual timer to wake the entire CPU just to keep incrementing a timer every second.
Is there a method to determine elapsed time from the slow running oscillator
The following does not seem to work consistently.
preSleep = HAL_VTimerGetCurrentTime_sysT32();
BlueNRG_Sleep(sleepMode, WAKEUP_IO10, wakeup_level);
postSleep = HAL_VTimerGetCurrentTime_sysT32();
diff = HAL_VTimerDiff_ms_sysT32(postSleep,preSleep);
incTimeStamp(diff);
