Add bodged PCB version with adapted code
- No SDC latching - No TSOn needed to close SDC
This commit is contained in:
@ -208,6 +208,8 @@ int main(void)
|
||||
|
||||
// Ensure we start with SDC disabled
|
||||
HAL_GPIO_WritePin(Watchdog_GPIO_Port, Watchdog_Pin, GPIO_PIN_RESET);
|
||||
// Due to bodge, AScSDC is inverted, so it is set by default
|
||||
HAL_GPIO_WritePin(AS_close_SDC_GPIO_Port, AS_close_SDC_Pin, GPIO_PIN_SET);
|
||||
|
||||
if (HAL_CAN_Start(&hcan) != HAL_OK)
|
||||
Error_Handler();
|
||||
@ -253,14 +255,17 @@ int main(void)
|
||||
mission_t new_mission = mission; // By default, don't change mission
|
||||
|
||||
// Wait 1s to prevent bus error state while ABX is starting up
|
||||
// Wait 5s for the discharge of the DC link (so AMS can't restart)
|
||||
// During that time, show loading animation to show LEDs work
|
||||
setMissionLED(M_MANUAL, GPIO_PIN_SET);
|
||||
HAL_Delay(150);
|
||||
setMissionLED(M_MANUAL, GPIO_PIN_RESET);
|
||||
for (mission_t m = M_ACCEL; m != M_MANUAL; m = mission2next[m]) {
|
||||
setMissionLED(m, GPIO_PIN_SET);
|
||||
while (HAL_GetTick() < 5000) {
|
||||
setMissionLED(M_MANUAL, GPIO_PIN_SET);
|
||||
HAL_Delay(150);
|
||||
setMissionLED(m, GPIO_PIN_RESET);
|
||||
setMissionLED(M_MANUAL, GPIO_PIN_RESET);
|
||||
for (mission_t m = M_ACCEL; m != M_MANUAL; m = mission2next[m]) {
|
||||
setMissionLED(m, GPIO_PIN_SET);
|
||||
HAL_Delay(150);
|
||||
setMissionLED(m, GPIO_PIN_RESET);
|
||||
}
|
||||
}
|
||||
|
||||
MX_IWDG_Init();
|
||||
@ -499,7 +504,7 @@ void HAL_CAN_RxFifo0MsgPendingCallback(CAN_HandleTypeDef *hcan) {
|
||||
return;
|
||||
|
||||
HAL_GPIO_WritePin(ASB_Error_GPIO_Port, ASB_Error_Pin, rxData.signals.asb_error);
|
||||
HAL_GPIO_WritePin(AS_close_SDC_GPIO_Port, AS_close_SDC_Pin, rxData.signals.as_close_sdc);
|
||||
HAL_GPIO_WritePin(AS_close_SDC_GPIO_Port, AS_close_SDC_Pin, !rxData.signals.as_close_sdc);
|
||||
|
||||
#ifdef WATCHDOG_STM
|
||||
|
||||
|
||||
Reference in New Issue
Block a user