diff --git a/main.c b/main.c --- a/main.c +++ b/main.c @@ -23,29 +23,21 @@ therm_settings_t set; therm_status_t status; // Globalish setting vars -SPI_HandleTypeDef hspi1; static __IO uint32_t TimingDelay; -void deinit(void) -{ - HAL_DeInit(); -} - -volatile int i=0; int main(void) { - // Initialize HAL hal_init(); // Configure the system clock - systemclock_config(); + systemclock_init(); // Unset bootloader option bytes (if set) void bootloader_unset(void); // Init GPIO - init_gpio(); + gpio_init(); // Init USB (TODO: Handle plugged/unplugged with external power) MX_USB_DEVICE_Init(); @@ -60,7 +52,7 @@ int main(void) bootloader_enter(); // Init SPI busses - init_spi(); + spi_init(); // Init OLED over SPI ssd1306_Init(); @@ -189,7 +181,7 @@ void process() if((ticks - last_pid > PID_PERIOD)) { #ifdef MAX31855_TC_SENSOR - max31855_readtemp(&hspi1, &set, &status); // Read MAX31855 + max31855_readtemp(spi_get(), &set, &status); // Read MAX31855 #endif #ifdef MAX31865_RTD_SENSOR