diff --git a/main.c b/main.c --- a/main.c +++ b/main.c @@ -1,10 +1,12 @@ #include "main.h" -#include "stm32f0xx_conf.h" +#include "stm32f0xx_hal.h" +#include "usb_device.h" #include "ssd1306.h" #include "config.h" #include "eeprom_min.h" #include "gpio.h" #include "spi.h" +#include "clock.h" // USB includes //#include "hw_config.h" @@ -44,6 +46,10 @@ volatile uint32_t ticks = 0; int16_t setpoint_brew = 0; int16_t setpoint_steam = 0; +// HAL Variables +SPI_HandleTypeDef hspi1; + + // State definition enum state { STATE_IDLE = 0, @@ -79,8 +85,9 @@ void save_setpoints(); int main(void) { // Init clocks - SystemInit(); - + HAL_Init(); + SystemClock_Config(); + // Init GPIO init_gpio(); @@ -97,6 +104,9 @@ int main(void) // Init SPI busses init_spi(); + // Init USB + init_usb(); + // Init OLED over SPI ssd1306_Init(); ssd1306_clearscreen();