// // 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" #include "ssd1306.h" int main(void) { sysclock_init(); hal_init(); gpio_init(); ssd1306_init(); ssd1306_drawlogo(); ssd1306_clearscreen(); // ssd1306_drawstring(const char *dataPtr, unsigned char row, unsigned char xPos) ssd1306_drawstring("Freaking test", 0, 0); int32_t my_variable = -123; char buffer[256]; snprintf(buffer, 256, "My Variable: %d", my_variable); ssd1306_drawstring(buffer, 2, 0); 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(); } }