diff --git a/stm-firmware/include/reflow-controller/settings/spi-eeprom.h b/stm-firmware/include/reflow-controller/settings/spi-eeprom.h index c6a1f14..f601491 100644 --- a/stm-firmware/include/reflow-controller/settings/spi-eeprom.h +++ b/stm-firmware/include/reflow-controller/settings/spi-eeprom.h @@ -28,12 +28,12 @@ * @brief Initialize the SPI for the eeprom. * @return 0 if succesful */ -int spi_eeprom_init(); +int spi_eeprom_init(void); /** * @brief Uninitialize the SPI EEPROM */ -void spi_eeprom_deinit(); +void spi_eeprom_deinit(void); /** * @brief Read from SPI EEPROM diff --git a/stm-firmware/settings/spi-eeprom.c b/stm-firmware/settings/spi-eeprom.c index 6a5ad63..ef19260 100644 --- a/stm-firmware/settings/spi-eeprom.c +++ b/stm-firmware/settings/spi-eeprom.c @@ -1,22 +1,22 @@ /* Reflow Oven Controller -* -* Copyright (C) 2021 Mario Hüttel -* -* This file is part of the Reflow Oven Controller Project. -* -* The reflow oven controller is free software: you can redistribute it and/or modify -* it under the terms of the GNU General Public License version 2 as -* published by the Free Software Foundation. -* -* The Reflow Oven Control Firmware is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with the reflow oven controller project. -* If not, see . -*/ + * + * Copyright (C) 2021 Mario Hüttel + * + * This file is part of the Reflow Oven Controller Project. + * + * The reflow oven controller is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * The Reflow Oven Control Firmware is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with the reflow oven controller project. + * If not, see . + */ #include #include @@ -52,7 +52,7 @@ static void eeprom_cs_deactivate(void) SPI_EEPROM_SPI_PORT->ODR |= (1<MODER &= MODER_DELETE(SPI_EEPROM_CS_PIN) & MODER_DELETE(SPI_EEPROM_MISO_PIN) & MODER_DELETE(SPI_EEPROM_MOSI_PIN) & MODER_DELETE(SPI_EEPROM_SCK_PIN); - SPI_EEPROM_SPI_PORT->MODER |= ALTFUNC(SPI_EEPROM_MISO_PIN) | ALTFUNC(SPI_EEPROM_SCK_PIN) | ALTFUNC(SPI_EEPROM_MOSI_PIN); + SPI_EEPROM_SPI_PORT->MODER |= ALTFUNC(SPI_EEPROM_MISO_PIN) | ALTFUNC(SPI_EEPROM_SCK_PIN) | + ALTFUNC(SPI_EEPROM_MOSI_PIN); SPI_EEPROM_SPI_PORT->MODER |= OUTPUT(SPI_EEPROM_CS_PIN); SETAF(SPI_EEPROM_SPI_PORT, SPI_EEPROM_MISO_PIN, SPI_EEPROM_SPI_ALTFUNC_NO); @@ -85,7 +86,7 @@ int spi_eeprom_init() return -1; } -void spi_eeprom_deinit() +void spi_eeprom_deinit(void) { spi_deinit(eeprom_spi_handle); @@ -166,7 +167,8 @@ static void spi_eeprom_do_write_page(uint32_t addr, const uint8_t *data, uint8_t uint8_t cmd[2]; /* Wait for the previous write to finish */ - while (spi_eeprom_write_in_progress()); + while (spi_eeprom_write_in_progress()) + ; /* Set the write enable latch */ spi_eeprom_set_write_enable_latch(true);