Skip to content

Commit

Permalink
boards: Use ARRAY_SIZE for setting UART_NUMOF, SPI_NUMOF, I2C_NUMOF
Browse files Browse the repository at this point in the history
Signed-off-by: Francois Berder <[email protected]>
  • Loading branch information
francois-berder committed Feb 9, 2020
1 parent b5bb846 commit b4ab226
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions boards/arduino-mkrwan1300/include/periph_conf.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ static const uart_conf_t uart_config[] = {
#define UART_0_ISR isr_sercom5
#define UART_1_ISR isr_sercom4

#define UART_NUMOF (sizeof(uart_config) / sizeof(uart_config[0]))
#define UART_NUMOF ARRAY_SIZE(uart_config)
/** @} */

/**
Expand All @@ -92,7 +92,7 @@ static const spi_conf_t spi_config[] = {
}
};

#define SPI_NUMOF (sizeof(spi_config) / sizeof(spi_config[0]))
#define SPI_NUMOF ARRAY_SIZE(spi_config)
/** @} */

#ifdef __cplusplus
Expand Down
2 changes: 1 addition & 1 deletion boards/common/esp8266/include/periph_conf_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ static const uart_conf_t uart_config[] = {
*
* @note UART_NUMOF definition must not be changed.
*/
#define UART_NUMOF (sizeof(uart_config)/sizeof(uart_config[0]))
#define UART_NUMOF ARRAY_SIZE(uart_config)
/** @} */

#ifdef __cplusplus
Expand Down
2 changes: 1 addition & 1 deletion boards/common/nrf52/include/cfg_i2c_default.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ static const i2c_conf_t i2c_config[] = {
.speed = I2C_SPEED_NORMAL
}
};
#define I2C_NUMOF (sizeof(i2c_config) / sizeof(i2c_config[0]))
#define I2C_NUMOF ARRAY_SIZE(i2c_config)
/** @} */

#ifdef __cplusplus
Expand Down
2 changes: 1 addition & 1 deletion boards/pinetime/include/periph_conf.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ static const i2c_conf_t i2c_config[] = {
}
};

#define I2C_NUMOF (sizeof(i2c_config) / sizeof(i2c_config[0]))
#define I2C_NUMOF ARRAY_SIZE(i2c_config)
/** @} */

#ifdef __cplusplus
Expand Down
8 changes: 4 additions & 4 deletions boards/stm32f723e-disco/include/periph_conf.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ static const timer_conf_t timer_config[] = {

#define TIMER_0_ISR isr_tim2

#define TIMER_NUMOF (sizeof(timer_config) / sizeof(timer_config[0]))
#define TIMER_NUMOF ARRAY_SIZE(timer_config)
/** @} */

/**
Expand Down Expand Up @@ -153,7 +153,7 @@ static const uart_conf_t uart_config[] = {
#define UART_3_ISR (isr_uart7)
#define UART_4_ISR (isr_uart5)

#define UART_NUMOF (sizeof(uart_config) / sizeof(uart_config[0]))
#define UART_NUMOF ARRAY_SIZE(uart_config)
/** @} */

/**
Expand All @@ -176,7 +176,7 @@ static const i2c_conf_t i2c_config[] = {

#define I2C_0_ISR isr_i2c2_er

#define I2C_NUMOF (sizeof(i2c_config) / sizeof(i2c_config[0]))
#define I2C_NUMOF ARRAY_SIZE(i2c_config)
/** @} */

/**
Expand Down Expand Up @@ -232,7 +232,7 @@ static const spi_conf_t spi_config[] = {
},
};

#define SPI_NUMOF (sizeof(spi_config) / sizeof(spi_config[0]))
#define SPI_NUMOF ARRAY_SIZE(spi_config)
/** @} */

#ifdef __cplusplus
Expand Down

0 comments on commit b4ab226

Please sign in to comment.