nicht wirklich schönere Fixes für FSN

This commit is contained in:
2025-07-12 18:15:44 +02:00
parent fb3eba0a09
commit aee7f4f697
3 changed files with 21 additions and 14 deletions

View File

@ -149,6 +149,7 @@ int main(void)
/* USER CODE BEGIN 3 */
if (HAL_GetTick() - can_ams_last_tick > AMS_TIMEOUT) {
error_led_init();
change_ts_state(TS_INACTIVE);
led_blink(&htim3, COLOR_ERROR, 0);
} else {
led_blink(&htim3, COLOR_HEARTBEAT, 1000);
@ -157,11 +158,14 @@ int main(void)
// SHOW_STATE(check_sdc_state());
// SHOW_STATE(can_update_state());
TSON = HAL_GPIO_ReadPin(TS_ON_GPIO_Port, TS_ON_Pin);
if (TSON == 1){
uint8_t sdc_closed = HAL_GPIO_ReadPin(SDC_ON_GPIO_Port, SDC_ON_Pin);
if (TSON == 1 && sdc_closed) {
change_ts_state(TS_ACTIVE);
}
check_sdc_state();
can_update_state();
HAL_Delay(100);
}
/* USER CODE END 3 */
}