Fix style issues in spi-eeprom.c/h

This commit is contained in:
Mario Hüttel 2022-07-16 15:09:41 +02:00
parent 3e82cf69b4
commit 8ac1d52240
2 changed files with 26 additions and 24 deletions

View File

@ -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

View File

@ -52,7 +52,7 @@ static void eeprom_cs_deactivate(void)
SPI_EEPROM_SPI_PORT->ODR |= (1<<SPI_EEPROM_CS_PIN);
}
int spi_eeprom_init()
int spi_eeprom_init(void)
{
static struct stm_spi_dev spi_dev;
struct stm_spi_settings settings;
@ -61,7 +61,8 @@ int spi_eeprom_init()
SPI_EEPROM_SPI_PORT->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);