Added software timers

Accessory state machine framework functional
This commit is contained in:
2025-06-18 17:53:00 -05:00
parent aaa7f0dc29
commit 658cedfa3b
18 changed files with 614 additions and 580 deletions

View File

@@ -36,6 +36,7 @@
#include "battery.h"
#include "keys.h"
#include "System/system.h"
#include "soft_timer.h"
extern uint8_t OverVolts_Flag,catch_up_flag; // global OverVoltsFlag
extern MODE_REC_t mode_Array[MODE_MAX_NUM];
@@ -96,8 +97,12 @@ void Init_vars()
}
}
stimer_init();
sys.hSysCheckTimer = stimer_start(1000, TIMER_MODE_PERIODIC, NULL, NULL);
sys.hOneSecondTimer = stimer_start(1000, TIMER_MODE_PERIODIC, NULL, NULL);
Estop_timer = 0;
Sys_Chk_tmr = 0;
Vchktmr = 0;
Key_Lock_Out_tmr = 0;
step_count = 0;
@@ -274,7 +279,7 @@ void Normal_Init(void)
Power_ON_OFF(ON); // Enable_Psu(); Ensure Power supply stays switched on.
Select_Estop(ON); // Ensure output is ISOLATED from connections
Select_Estop(ISOLATED); // Ensure output is ISOLATED from connections
Init_vars();
@@ -343,7 +348,7 @@ void Normal_Init(void)
// Select_Bypass(OFF);
// HACK
Select_Estop(OFF); // Ensure output is ISOLATED from connections
Select_Estop(CONNECTED); // Ensure output is ISOLATED from connections
Init_Amplitude();
}