1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

boards: Use ARRAY_SIZE for setting UART_NUMOF, SPI_NUMOF, I2C_NUMOF

Signed-off-by: Francois Berder <18538310+francois-berder@users.noreply.github.com>
This commit is contained in:
Francois Berder 2020-02-08 16:30:12 +00:00
parent b5bb846d3a
commit b4ab22673e
5 changed files with 9 additions and 9 deletions

View File

@ -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)
/** @} */
/**
@ -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

View File

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

View File

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

View File

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

View File

@ -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)
/** @} */
/**
@ -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)
/** @} */
/**
@ -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)
/** @} */
/**
@ -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