Only use BQ and TMP144 once clock is synchronized
This commit is contained in:
parent
9c1d743bfd
commit
c6a5ffd2c0
@ -209,15 +209,16 @@ int main(void) {
|
||||
|
||||
/* USER CODE BEGIN 3 */
|
||||
update_status_leds();
|
||||
fan_ctrl_update();
|
||||
clock_sync_update();
|
||||
// Only use communication interfaces (BQ UART, TMP144 UARTs, CAN) once the
|
||||
// clock is synchronized
|
||||
if (clock_sync_state == CLOCK_SYNC_NORMAL_OPERATION) {
|
||||
afe_measure();
|
||||
tmp144_read_temps();
|
||||
if (HAL_GetTick() - main_loop_start > ERROR_CHECK_START) {
|
||||
check_error_conditions();
|
||||
}
|
||||
fan_ctrl_update();
|
||||
clock_sync_update();
|
||||
// Only start sending CAN frames once the clock is synchronized
|
||||
if (clock_sync_state == CLOCK_SYNC_NORMAL_OPERATION) {
|
||||
ams_can_send_heartbeat();
|
||||
}
|
||||
delay_period();
|
||||
|
Loading…
x
Reference in New Issue
Block a user