trying to improve stabiltiy
This commit is contained in:
@@ -16,6 +16,8 @@
|
||||
#define STAY_AWAKE_TIME 60 // seconds to stay awake without K15
|
||||
|
||||
|
||||
bool CanDataTask_CarCanActive();
|
||||
|
||||
|
||||
// Start the sleep counter check
|
||||
void BSP_POWER_Init() {
|
||||
@@ -52,7 +54,11 @@ void BSP_POWER_WakeUp() {
|
||||
*/
|
||||
void BSP_POWER_EnterStandby() {
|
||||
|
||||
BSP_SDLogger_Flush();
|
||||
// if there is still communication on the CAN bus, we should not go to standby
|
||||
// intstead we should reset the system, because the CAN bus would wake us up again
|
||||
if (CanDataTask_CarCanActive()) {
|
||||
NVIC_SystemReset();
|
||||
}
|
||||
|
||||
// stop the sytem interrupts
|
||||
__disable_irq();
|
||||
|
||||
Reference in New Issue
Block a user