Skip to content

Commit

Permalink
fixed gpio toggle order
Browse files Browse the repository at this point in the history
  • Loading branch information
Dylan Donahue committed Mar 15, 2024
1 parent a9d0202 commit cfe400d
Showing 1 changed file with 16 additions and 7 deletions.
23 changes: 16 additions & 7 deletions Core/Src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,6 @@ const void print_bms_stats(acc_data_t *acc_data)
static const uint16_t PRINT_STAT_WAIT = 500; //ms

if(!is_timer_expired(&debug_stat_timer) && debug_stat_timer.active) return;
HAL_UART_Transmit(&huart4, (char*)"butts", 5, 1000);
//TODO get this from eeprom once implemented
// question - should we read from eeprom here, or do that on loop and store locally?
//printf("Prev Fault: %#x", previousFault);
Expand Down Expand Up @@ -216,9 +215,23 @@ int main(void)
MX_USB_OTG_FS_PCD_Init();
MX_I2C1_Init();
/* USER CODE BEGIN 2 */
watchdog_init();
for (int i = 0; i < 58; i++)
{
HAL_GPIO_WritePin(Debug_LEDB11_GPIO_Port, Debug_LEDB11_Pin, GPIO_PIN_SET);
HAL_Delay(58-i);
HAL_GPIO_WritePin(Debug_LEDB11_GPIO_Port, Debug_LEDB11_Pin, GPIO_PIN_RESET);
HAL_GPIO_WritePin(Debug_LED_GPIO_Port, Debug_LED_Pin, GPIO_PIN_SET);
HAL_Delay(58-i);
HAL_GPIO_WritePin(Debug_LED_GPIO_Port, Debug_LED_Pin, GPIO_PIN_RESET);

}


//watchdog_init();
segment_init();
compute_init();


/* USER CODE END 2 */

/* Infinite loop */
Expand Down Expand Up @@ -710,14 +723,10 @@ void watchdog_init(void)

void watchdog_pet(void)
{
/* datasheet unclear, so we pet (possibly redundantly) twice just in case */
HAL_GPIO_WritePin(Watchdog_Out_GPIO_Port, Watchdog_Out_Pin, GPIO_PIN_RESET);
//HAL_Delay(1);

HAL_GPIO_WritePin(Watchdog_Out_GPIO_Port, Watchdog_Out_Pin, GPIO_PIN_SET);
//HAL_Delay(1);
HAL_GPIO_WritePin(Watchdog_Out_GPIO_Port, Watchdog_Out_Pin, GPIO_PIN_RESET);
//HAL_Delay(1);
HAL_GPIO_WritePin(Watchdog_Out_GPIO_Port, Watchdog_Out_Pin, GPIO_PIN_SET);

}

Expand Down

0 comments on commit cfe400d

Please sign in to comment.