Compare commits
3 Commits
c6fedbd759
...
full-featu
| Author | SHA1 | Date | |
|---|---|---|---|
|
86f688c0f7
|
|||
|
e46a75f99f
|
|||
|
0195578317
|
@ -144,6 +144,7 @@ mission_t mission = M_NONE;
|
||||
#ifdef WATCHDOG_STM
|
||||
bool pHeartbeat = false;
|
||||
bool WD_OK = false;
|
||||
bool WD_initialized = false;
|
||||
#endif
|
||||
|
||||
/* USER CODE END PV */
|
||||
@ -190,13 +191,20 @@ int main(void)
|
||||
|
||||
/* USER CODE BEGIN SysInit */
|
||||
|
||||
/* USER CODE END SysInit */
|
||||
MX_GPIO_Init();
|
||||
MX_CAN_Init();
|
||||
|
||||
#if false
|
||||
/* USER CODE END SysInit */
|
||||
/* Initialize all configured peripherals */
|
||||
MX_GPIO_Init();
|
||||
MX_CAN_Init();
|
||||
MX_IWDG_Init();
|
||||
/* USER CODE BEGIN 2 */
|
||||
#endif
|
||||
|
||||
// Freeze WDG when debugging
|
||||
__HAL_DBGMCU_FREEZE_IWDG();
|
||||
|
||||
// Ensure we start with SDC disabled
|
||||
HAL_GPIO_WritePin(Watchdog_GPIO_Port, Watchdog_Pin, GPIO_PIN_RESET);
|
||||
@ -244,8 +252,19 @@ int main(void)
|
||||
bool pAMC = false;
|
||||
mission_t new_mission = mission; // By default, don't change mission
|
||||
|
||||
// Important to prevent bus error state while ABX is starting up
|
||||
HAL_Delay(1000);
|
||||
// Wait 1s to prevent bus error state while ABX is starting up
|
||||
// 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);
|
||||
HAL_Delay(150);
|
||||
setMissionLED(m, GPIO_PIN_RESET);
|
||||
}
|
||||
|
||||
MX_IWDG_Init();
|
||||
WD_initialized = true;
|
||||
|
||||
while (true) {
|
||||
|
||||
@ -485,7 +504,8 @@ void HAL_CAN_RxFifo0MsgPendingCallback(CAN_HandleTypeDef *hcan) {
|
||||
#ifdef WATCHDOG_STM
|
||||
|
||||
if (rxData.signals.heartbeat != pHeartbeat) {
|
||||
HAL_IWDG_Refresh(&hiwdg);
|
||||
if (WD_initialized)
|
||||
HAL_IWDG_Refresh(&hiwdg);
|
||||
WD_OK = true;
|
||||
HAL_GPIO_WritePin(Watchdog_GPIO_Port, Watchdog_Pin, GPIO_PIN_SET);
|
||||
}
|
||||
|
||||
@ -911,7 +911,7 @@
|
||||
)
|
||||
|
||||
(symbol (lib_id "Device:R") (at 142.24 88.9 180) (unit 1)
|
||||
(in_bom yes) (on_board yes) (dnp no)
|
||||
(in_bom yes) (on_board yes) (dnp yes)
|
||||
(uuid 86666e00-6522-42d9-8c50-ddbe3c590e94)
|
||||
(property "Reference" "R3" (at 140.462 90.0684 0)
|
||||
(effects (font (size 1.27 1.27)) (justify left))
|
||||
@ -989,7 +989,7 @@
|
||||
)
|
||||
|
||||
(symbol (lib_id "Device:C") (at 148.59 93.98 90) (unit 1)
|
||||
(in_bom yes) (on_board yes) (dnp no)
|
||||
(in_bom yes) (on_board yes) (dnp yes)
|
||||
(uuid e0f15250-bd20-4545-ac0d-527fe10e2cdb)
|
||||
(property "Reference" "C17" (at 147.4216 91.059 0)
|
||||
(effects (font (size 1.27 1.27)) (justify left))
|
||||
@ -1042,7 +1042,7 @@
|
||||
)
|
||||
|
||||
(symbol (lib_id "Device:R") (at 142.24 99.06 180) (unit 1)
|
||||
(in_bom yes) (on_board yes) (dnp no)
|
||||
(in_bom yes) (on_board yes) (dnp yes)
|
||||
(uuid fe93d30d-de39-4ca8-8ec8-dbd2cc54f863)
|
||||
(property "Reference" "R7" (at 140.462 100.2284 0)
|
||||
(effects (font (size 1.27 1.27)) (justify left))
|
||||
|
||||
Reference in New Issue
Block a user