//
// STM32F103 Template Firmware
// Copyright 2016 SeaLandAire Technologies
// Author(s): Ethan Zonca
//
#include "stm32f3xx_hal.h"
#include "config.h"
#include "watchdog.h"
#include "system.h"
#include "gpio.h"
#include "error.h"
#include "flash.h"
int main(void)
{
sysclock_init();
hal_init();
gpio_init();
flash_init();
watchdog_init();
// Software timers
uint32_t last_blink_time = HAL_GetTick();
while (1)
{
// Grab and transmit data
if(HAL_GetTick() - last_blink_time > 100)
{
HAL_GPIO_TogglePin(LED_RED);
last_blink_time = HAL_GetTick();
}
// Process CAN messages and LED state
watchdog_feed();
}
}