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

boards: make use of ARRAY_SIZE macro

This commit is contained in:
Benjamin Valentin 2019-07-18 15:14:29 +02:00
parent fcf31724a6
commit 8af04cd939
134 changed files with 422 additions and 456 deletions

View File

@ -61,7 +61,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)
/** @} */
/**
@ -77,7 +77,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

@ -53,7 +53,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)
/** @} */
/**
@ -77,7 +77,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)
/** @} */
/**

View File

@ -120,7 +120,7 @@ static const tc32_conf_t timer_config[] = {
#define TIMER_0_ISR isr_tc3
#define TIMER_1_ISR isr_tc4
#define TIMER_NUMOF (sizeof(timer_config) / sizeof(timer_config[0]))
#define TIMER_NUMOF ARRAY_SIZE(timer_config)
/** @} */
/**
@ -154,7 +154,7 @@ static const uart_conf_t uart_config[] = {
#define UART_0_ISR isr_sercom5
#define UART_1_ISR isr_sercom0
#define UART_NUMOF (sizeof(uart_config) / sizeof(uart_config[0]))
#define UART_NUMOF ARRAY_SIZE(uart_config)
/** @} */
/**
@ -215,7 +215,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)
/** @} */
/**
@ -235,7 +235,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)
/** @} */
/**

View File

@ -47,7 +47,7 @@ static const dma_conf_t dma_config[] = {
#define DMA_SHARED_ISR_1 isr_dma1_channel4_5_6_7
#define DMA_SHARED_ISR_1_STREAMS { 2, 3, 4 } /* Indexes 2, 3 and 4 of dma_config share the same isr */
#define DMA_NUMOF (sizeof(dma_config) / sizeof(dma_config[0]))
#define DMA_NUMOF ARRAY_SIZE(dma_config)
#endif
/** @} */
@ -93,7 +93,7 @@ static const uart_conf_t uart_config[] = {
#define UART_0_ISR (isr_usart2)
#define UART_1_ISR (isr_usart1)
#define UART_NUMOF (sizeof(uart_config) / sizeof(uart_config[0]))
#define UART_NUMOF ARRAY_SIZE(uart_config)
/** @} */
/**
@ -155,7 +155,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

@ -87,7 +87,7 @@ static const dma_conf_t dma_config[] = {
#define DMA_2_ISR isr_dma1_channel4
#define DMA_3_ISR isr_dma2_channel3
#define DMA_NUMOF (sizeof(dma_config) / sizeof(dma_config[0]))
#define DMA_NUMOF ARRAY_SIZE(dma_config)
#endif
/** @} */
@ -107,7 +107,7 @@ static const timer_conf_t timer_config[] = {
#define TIMER_0_ISR isr_tim5
#define TIMER_NUMOF (sizeof(timer_config) / sizeof(timer_config[0]))
#define TIMER_NUMOF ARRAY_SIZE(timer_config)
/** @} */
/**
@ -152,7 +152,7 @@ static const uart_conf_t uart_config[] = {
#define UART_0_ISR (isr_usart1)
#define UART_1_ISR (isr_uart4)
#define UART_NUMOF (sizeof(uart_config) / sizeof(uart_config[0]))
#define UART_NUMOF ARRAY_SIZE(uart_config)
/** @} */
/**
@ -172,7 +172,7 @@ static const pwm_conf_t pwm_config[] = {
}
};
#define PWM_NUMOF (sizeof(pwm_config) / sizeof(pwm_config[0]))
#define PWM_NUMOF ARRAY_SIZE(pwm_config)
/** @} */
/**
@ -218,7 +218,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)
/** @} */
/**
@ -253,7 +253,7 @@ static const i2c_conf_t i2c_config[] = {
#define I2C_0_ISR isr_i2c1_er
#define I2C_1_ISR isr_i2c2_er
#define I2C_NUMOF (sizeof(i2c_config) / sizeof(i2c_config[0]))
#define I2C_NUMOF ARRAY_SIZE(i2c_config)
/** @} */
#ifdef __cplusplus

View File

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

View File

@ -53,7 +53,7 @@ static const timer_conf_t timer_config[] = {
},
};
#define TIMER_NUMOF (sizeof(timer_config) / sizeof(timer_config[0]))
#define TIMER_NUMOF ARRAY_SIZE(timer_config)
#define TIMER_IRQ_PRIO 1
/** @} */
@ -76,7 +76,7 @@ static const uart_conf_t uart_config[] = {
#define UART_0_ISR isr_uart0
/* macros common across all UARTs */
#define UART_NUMOF (sizeof(uart_config) / sizeof(uart_config[0]))
#define UART_NUMOF ARRAY_SIZE(uart_config)
/** @} */
@ -94,7 +94,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)
/** @} */
/**
@ -111,7 +111,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)
/** @} */
/**
@ -124,7 +124,7 @@ static const adc_conf_t adc_config[] = {
GPIO_PIN(0, 6), /**< GPIO_PA6 = ADC_ALS_PIN */
};
#define ADC_NUMOF (sizeof(adc_config) / sizeof(adc_config[0]))
#define ADC_NUMOF ARRAY_SIZE(adc_config)
/** @} */
/**

View File

@ -62,7 +62,7 @@ static const timer_conf_t timer_config[] = {
}
};
#define TIMER_NUMOF (sizeof(timer_config) / sizeof(timer_config[0]))
#define TIMER_NUMOF ARRAY_SIZE(timer_config)
/** @} */
/**

View File

@ -60,7 +60,7 @@ static const timer_conf_t timer_config[] = {
}
};
#define TIMER_NUMOF (sizeof(timer_config) / sizeof(timer_config[0]))
#define TIMER_NUMOF ARRAY_SIZE(timer_config)
/** @} */
/**

View File

@ -59,7 +59,7 @@ static const timer_conf_t timer_config[] = {
#define TIMER_0_ISR isr_tc0
#define TIMER_1_ISR isr_tc3
#define TIMER_NUMOF (sizeof(timer_config) / sizeof(timer_config[0]))
#define TIMER_NUMOF ARRAY_SIZE(timer_config)
/** @} */
/**
@ -107,7 +107,7 @@ static const uart_conf_t uart_config[] = {
#define UART_2_ISR isr_usart1
#define UART_3_ISR isr_usart3
#define UART_NUMOF (sizeof(uart_config) / sizeof(uart_config[0]))
#define UART_NUMOF ARRAY_SIZE(uart_config)
/** @} */
/**
@ -125,7 +125,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)
/** @} */
/**
@ -140,7 +140,7 @@ static const pwm_chan_conf_t pwm_chan[] = {
};
#define PWM_NUMOF (1U)
#define PWM_CHAN_NUMOF (sizeof(pwm_chan) / sizeof(pwm_chan[0]))
#define PWM_CHAN_NUMOF ARRAY_SIZE(pwm_chan)
/** @} */
#ifdef __cplusplus

View File

@ -118,7 +118,7 @@ static const tc32_conf_t timer_config[] = {
#define TIMER_0_ISR isr_tc3
#define TIMER_1_ISR isr_tc4
#define TIMER_NUMOF (sizeof(timer_config) / sizeof(timer_config[0]))
#define TIMER_NUMOF ARRAY_SIZE(timer_config)
/** @} */
/**
@ -141,7 +141,7 @@ static const uart_conf_t uart_config[] = {
/* interrupt function name mapping */
#define UART_0_ISR isr_sercom5
#define UART_NUMOF (sizeof(uart_config) / sizeof(uart_config[0]))
#define UART_NUMOF ARRAY_SIZE(uart_config)
/** @} */
/**
@ -165,7 +165,7 @@ static const pwm_conf_t pwm_config[] = {
};
/* number of devices that are actually defined */
#define PWM_NUMOF (sizeof(pwm_config) / sizeof(pwm_config[0]))
#define PWM_NUMOF ARRAY_SIZE(pwm_config)
/** @} */
/**
@ -230,7 +230,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)
/** @} */
/**
@ -248,7 +248,7 @@ static const i2c_conf_t i2c_config[] = {
.flags = I2C_FLAG_NONE
}
};
#define I2C_NUMOF (sizeof(i2c_config) / sizeof(i2c_config[0]))
#define I2C_NUMOF ARRAY_SIZE(i2c_config)
/** @} */
/**

View File

@ -349,7 +349,7 @@ extern "C" {
#endif
};
#define PWM_NUMOF (sizeof(pwm_conf) / sizeof(pwm_conf[0]))
#define PWM_NUMOF ARRAY_SIZE(pwm_conf)
#endif
#endif /* PWM_NUMOF */
/** @} */

View File

@ -25,6 +25,7 @@
/* include periph_cpu.h to make it visible in any case */
#include "periph_cpu.h"
#include "kernel_defines.h"
#ifdef __cplusplus
extern "C" {
@ -59,7 +60,7 @@ static const gpio_t adc_channels[] = ADC_GPIOS;
*
* @note ADC_NUMOF definition must not be changed.
*/
#define ADC_NUMOF (sizeof(adc_channels) / sizeof(adc_channels[0]))
#define ADC_NUMOF ARRAY_SIZE(adc_channels)
/** @} */
/**
@ -91,7 +92,7 @@ static const gpio_t dac_channels[] = DAC_GPIOS;
*
* @note DAC_NUMOF definition must not be changed.
*/
#define DAC_NUMOF (sizeof(dac_channels) / sizeof(dac_channels[0]))
#define DAC_NUMOF ARRAY_SIZE(dac_channels)
/** @} */
/**
@ -127,7 +128,7 @@ static const i2c_conf_t i2c_config[] = {
*
* @note I2C_NUMOF definition must not be changed.
*/
#define I2C_NUMOF (sizeof(i2c_config) / sizeof(i2c_config[0]))
#define I2C_NUMOF ARRAY_SIZE(i2c_config)
/** @} */
@ -203,7 +204,7 @@ static const spi_conf_t spi_config[] = {
*
* @note SPI_NUMOF definition must not be changed.
*/
#define SPI_NUMOF (sizeof(spi_config) / sizeof(spi_config[0]))
#define SPI_NUMOF ARRAY_SIZE(spi_config)
/** @} */

View File

@ -81,7 +81,7 @@ static const dma_conf_t dma_config[] = {
#define DMA_0_ISR isr_dma1_channel4
#define DMA_1_ISR isr_dma1_channel6
#define DMA_NUMOF (sizeof(dma_config) / sizeof(dma_config[0]))
#define DMA_NUMOF ARRAY_SIZE(dma_config)
#endif
/** @} */
@ -109,7 +109,7 @@ static const timer_conf_t timer_config[] = {
#define TIMER_0_ISR isr_tim2
#define TIMER_1_ISR isr_tim3
#define TIMER_NUMOF (sizeof(timer_config) / sizeof(timer_config[0]))
#define TIMER_NUMOF ARRAY_SIZE(timer_config)
/** @} */
/**
@ -146,7 +146,7 @@ static const uart_conf_t uart_config[] = {
#define UART_0_ISR (isr_usart1)
#define UART_1_ISR (isr_usart2)
#define UART_NUMOF (sizeof(uart_config) / sizeof(uart_config[0]))
#define UART_NUMOF ARRAY_SIZE(uart_config)
/** @} */
/**
@ -183,7 +183,7 @@ static const i2c_conf_t i2c_config[] = {
#define I2C_0_ISR isr_i2c1_ev
#define I2C_NUMOF (sizeof(i2c_config) / sizeof(i2c_config[0]))
#define I2C_NUMOF ARRAY_SIZE(i2c_config)
/** @} */
/**

View File

@ -43,7 +43,7 @@ static const i2c_conf_t i2c_config[] = {
.sda_pcr = (PORT_PCR_MUX(3)),
},
};
#define I2C_NUMOF (sizeof(i2c_config) / sizeof(i2c_config[0]))
#define I2C_NUMOF ARRAY_SIZE(i2c_config)
#define I2C_0_ISR (isr_i2c1)
/** @} */

View File

@ -116,7 +116,7 @@ static const uart_conf_t uart_config[] = {
.type = KINETIS_LPUART,
},
};
#define UART_NUMOF (sizeof(uart_config) / sizeof(uart_config[0]))
#define UART_NUMOF ARRAY_SIZE(uart_config)
#define LPUART_0_ISR isr_lpuart0
/* Use MCGIRCLK (internal reference 4 MHz clock) */
#define LPUART_0_SRC 3

View File

@ -49,7 +49,7 @@ static const timer_conf_t timer_config[] = {
#define TIMER_0_ISR isr_timer0
#define TIMER_1_ISR isr_timer1
#define TIMER_NUMOF (sizeof(timer_config) / sizeof(timer_config[0]))
#define TIMER_NUMOF ARRAY_SIZE(timer_config)
/** @} */
#ifdef __cplusplus

View File

@ -56,7 +56,7 @@ static const timer_conf_t timer_config[] = {
#define TIMER_1_ISR isr_timer1
#define TIMER_2_ISR isr_timer2
#define TIMER_NUMOF (sizeof(timer_config) / sizeof(timer_config[0]))
#define TIMER_NUMOF ARRAY_SIZE(timer_config)
/** @} */
#ifdef __cplusplus

View File

@ -39,7 +39,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

@ -48,7 +48,7 @@ static const timer_conf_t timer_config[] = {
#define TIMER_0_ISR isr_timer1
#define TIMER_1_ISR isr_timer2
#define TIMER_NUMOF (sizeof(timer_config) / sizeof(timer_config[0]))
#define TIMER_NUMOF ARRAY_SIZE(timer_config)
/** @} */
#ifdef __cplusplus

View File

@ -38,7 +38,7 @@ extern "C" {
static const pwm_conf_t pwm_config[] = {
{ NRF_PWM0, { 28, 29, 30, 31 } }
};
#define PWM_NUMOF (sizeof(pwm_config) / sizeof(pwm_config[0]))
#define PWM_NUMOF ARRAY_SIZE(pwm_config)
/** @} */
#ifdef __cplusplus

View File

@ -89,7 +89,7 @@ static const motor_driver_config_t motor_driver_config[] = {
},
};
#define MOTOR_DRIVER_NUMOF (sizeof(motor_driver_config) / sizeof(motor_driver_config[0]))
#define MOTOR_DRIVER_NUMOF ARRAY_SIZE(motor_driver_config)
/** @} */
#ifdef __cplusplus

View File

@ -43,7 +43,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

@ -61,7 +61,7 @@ static const timer_conf_t timer_config[] = {
},
};
#define TIMER_NUMOF (sizeof(timer_config) / sizeof(timer_config[0]))
#define TIMER_NUMOF ARRAY_SIZE(timer_config)
#define TIMER_IRQ_PRIO 1
/** @} */
@ -100,7 +100,7 @@ static const uart_conf_t uart_config[] = {
#define UART_1_ISR isr_uart1
/* macros common across all UARTs */
#define UART_NUMOF (sizeof(uart_config) / sizeof(uart_config[0]))
#define UART_NUMOF ARRAY_SIZE(uart_config)
/** @} */

View File

@ -51,7 +51,7 @@ static const tc32_conf_t timer_config[] = {
/* Timer 0 configuration */
#define TIMER_0_CHANNELS 2
#define TIMER_0_ISR isr_tc0
#define TIMER_NUMOF (sizeof(timer_config)/sizeof(timer_config[0]))
#define TIMER_NUMOF ARRAY_SIZE(timer_config)
/** @} */
/**
@ -74,7 +74,7 @@ static const uart_conf_t uart_config[] = {
/* interrupt function name mapping */
#define UART_0_ISR isr_sercom2_2
#define UART_NUMOF (sizeof(uart_config) / sizeof(uart_config[0]))
#define UART_NUMOF ARRAY_SIZE(uart_config)
/** @} */
/**
@ -96,7 +96,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)
/** @} */
/**
@ -115,7 +115,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)
/** @} */
/**

View File

@ -71,7 +71,7 @@ static const i2c_conf_t i2c_config[] = {
#define I2C_0_ISR isr_i2c1
#endif
#define I2C_NUMOF (sizeof(i2c_config) / sizeof(i2c_config[0]))
#define I2C_NUMOF ARRAY_SIZE(i2c_config)
/** @} */
#ifdef __cplusplus

View File

@ -49,7 +49,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)
/** @} */
#ifdef __cplusplus

View File

@ -41,7 +41,7 @@ static const timer_conf_t timer_config[] = {
#define TIMER_0_ISR isr_tim5
#define TIMER_NUMOF (sizeof(timer_config) / sizeof(timer_config[0]))
#define TIMER_NUMOF ARRAY_SIZE(timer_config)
/** @} */
#ifdef __cplusplus

View File

@ -113,7 +113,7 @@ static const timer_conf_t timer_config[] = {
#define TIMER_1_ISR isr_tim3
#define TIMER_2_ISR isr_tim4
#define TIMER_NUMOF (sizeof(timer_config) / sizeof(timer_config[0]))
#define TIMER_NUMOF ARRAY_SIZE(timer_config)
/** @} */
/**
@ -151,7 +151,7 @@ static const uart_conf_t uart_config[] = {
#define UART_1_ISR (isr_usart2)
#define UART_2_ISR (isr_usart3)
#define UART_NUMOF (sizeof(uart_config) / sizeof(uart_config[0]))
#define UART_NUMOF ARRAY_SIZE(uart_config)
/** @} */
/**
@ -185,7 +185,7 @@ static const i2c_conf_t i2c_config[] = {
#define I2C_0_ISR isr_i2c1_ev
#define I2C_1_ISR isr_i2c2_ev
#define I2C_NUMOF (sizeof(i2c_config) / sizeof(i2c_config[0]))
#define I2C_NUMOF ARRAY_SIZE(i2c_config)
/** @} */
/**
@ -205,7 +205,7 @@ static const pwm_conf_t pwm_config[] = {
}
};
#define PWM_NUMOF (sizeof(pwm_config) / sizeof(pwm_config[0]))
#define PWM_NUMOF ARRAY_SIZE(pwm_config)
/** @} */
/**
@ -253,7 +253,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

@ -160,7 +160,7 @@ static const spi_conf_t spi_confs[] = {
},
};
#define SPI_NUMOF (sizeof(spi_confs) / sizeof(spi_confs[0]))
#define SPI_NUMOF ARRAY_SIZE(spi_confs)
/** @} */
#ifdef __cplusplus

View File

@ -52,7 +52,7 @@ static const timer_conf_t timer_config[] = {
#define TIMER_0_ISR isr_tim2
#define TIMER_1_ISR isr_tim5
#define TIMER_NUMOF (sizeof(timer_config) / sizeof(timer_config[0]))
#define TIMER_NUMOF ARRAY_SIZE(timer_config)
/** @} */
/**
@ -79,7 +79,7 @@ static const uart_conf_t uart_config[] = {
#define UART_0_ISR (isr_usart6)
#define UART_0_DMA_ISR (isr_dma2_stream6)
#define UART_NUMOF (sizeof(uart_config) / sizeof(uart_config[0]))
#define UART_NUMOF ARRAY_SIZE(uart_config)
/** @} */
#ifdef __cplusplus

View File

@ -115,7 +115,7 @@ static const tc32_conf_t timer_config[] = {
#define TIMER_0_ISR isr_tc3
#define TIMER_1_ISR isr_tc4
#define TIMER_NUMOF (sizeof(timer_config) / sizeof(timer_config[0]))
#define TIMER_NUMOF ARRAY_SIZE(timer_config)
/** @} */
/**
@ -138,7 +138,7 @@ static const uart_conf_t uart_config[] = {
/* interrupt function name mapping */
#define UART_0_ISR isr_sercom0
#define UART_NUMOF (sizeof(uart_config) / sizeof(uart_config[0]))
#define UART_NUMOF ARRAY_SIZE(uart_config)
/** @} */
/**
@ -225,7 +225,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)
/** @} */
/**
@ -243,7 +243,7 @@ static const i2c_conf_t i2c_config[] = {
.flags = I2C_FLAG_NONE
}
};
#define I2C_NUMOF (sizeof(i2c_config) / sizeof(i2c_config[0]))
#define I2C_NUMOF ARRAY_SIZE(i2c_config)
/** @} */
/**

View File

@ -70,7 +70,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)
/** @} */
/**
@ -86,7 +86,7 @@ static const adc_conf_t adc_config[] = {
GPIO_PIN(PORT_A, 2), /**< GPIO_PA2 = ADC3_PIN */
};
#define ADC_NUMOF (sizeof(adc_config) / sizeof(adc_config[0]))
#define ADC_NUMOF ARRAY_SIZE(adc_config)
/** @} */

View File

@ -83,7 +83,7 @@ static const timer_conf_t timer_config[] = {
#define TIMER_0_ISR isr_tim2
#define TIMER_1_ISR isr_tim3
#define TIMER_NUMOF (sizeof(timer_config) / sizeof(timer_config[0]))
#define TIMER_NUMOF ARRAY_SIZE(timer_config)
/** @} */
/**
@ -112,7 +112,7 @@ static const uart_conf_t uart_config[] = {
#define UART_0_ISR (isr_usart2)
#define UART_1_ISR (isr_usart1)
#define UART_NUMOF (sizeof(uart_config) / sizeof(uart_config[0]))
#define UART_NUMOF ARRAY_SIZE(uart_config)
/** @} */
/**
@ -151,7 +151,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)
/** @} */
/**
@ -188,7 +188,7 @@ static const i2c_conf_t i2c_config[] = {
#define I2C_0_ISR isr_i2c1_ev
#define I2C_NUMOF (sizeof(i2c_config) / sizeof(i2c_config[0]))
#define I2C_NUMOF ARRAY_SIZE(i2c_config)
/** @} */
#ifdef __cplusplus

View File

@ -132,7 +132,7 @@ static const uart_conf_t uart_config[] = {
#define UART_0_ISR (isr_uart1_rx_tx)
#define UART_1_ISR (isr_uart0_rx_tx)
#define UART_NUMOF (sizeof(uart_config) / sizeof(uart_config[0]))
#define UART_NUMOF ARRAY_SIZE(uart_config)
/** @} */
/**
@ -159,7 +159,7 @@ static const adc_conf_t adc_config[] = {
[ 9] = { .dev = ADC0, .pin = GPIO_UNDEF, .chan = 27, .avg = ADC_AVG_MAX },
};
#define ADC_NUMOF (sizeof(adc_config) / sizeof(adc_config[0]))
#define ADC_NUMOF ARRAY_SIZE(adc_config)
/*
* K22F ADC reference settings:
* 0: VREFH/VREFL external pin pair
@ -186,7 +186,7 @@ static const pwm_conf_t pwm_config[] = {
}
};
#define PWM_NUMOF (sizeof(pwm_config) / sizeof(pwm_config[0]))
#define PWM_NUMOF ARRAY_SIZE(pwm_config)
/** @} */
@ -251,7 +251,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)
/** @} */
@ -271,7 +271,7 @@ static const i2c_conf_t i2c_config[] = {
.sda_pcr = (PORT_PCR_MUX(2) | PORT_PCR_ODE_MASK),
},
};
#define I2C_NUMOF (sizeof(i2c_config) / sizeof(i2c_config[0]))
#define I2C_NUMOF ARRAY_SIZE(i2c_config)
#define I2C_0_ISR (isr_i2c0)
#define I2C_1_ISR (isr_i2c1)
/** @} */

View File

@ -119,7 +119,7 @@ static const uart_conf_t uart_config[] = {
#define UART_0_ISR (isr_uart0_rx_tx)
#define UART_NUMOF (sizeof(uart_config) / sizeof(uart_config[0]))
#define UART_NUMOF ARRAY_SIZE(uart_config)
/** @} */
/**
@ -155,7 +155,7 @@ static const adc_conf_t adc_config[] = {
[19] = { .dev = ADC0, .pin = GPIO_UNDEF, .chan = 27, .avg = ADC_AVG_MAX },
};
#define ADC_NUMOF (sizeof(adc_config) / sizeof(adc_config[0]))
#define ADC_NUMOF ARRAY_SIZE(adc_config)
/*
* K64F ADC reference settings:
* 0: VREFH/VREFL external pin pair
@ -183,7 +183,7 @@ static const pwm_conf_t pwm_config[] = {
}
};
#define PWM_NUMOF (sizeof(pwm_config) / sizeof(pwm_config[0]))
#define PWM_NUMOF ARRAY_SIZE(pwm_config)
/** @} */
@ -248,7 +248,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)
/** @} */
@ -268,7 +268,7 @@ static const i2c_conf_t i2c_config[] = {
.sda_pcr = (PORT_PCR_MUX(5) | PORT_PCR_ODE_MASK),
},
};
#define I2C_NUMOF (sizeof(i2c_config) / sizeof(i2c_config[0]))
#define I2C_NUMOF ARRAY_SIZE(i2c_config)
#define I2C_0_ISR (isr_i2c0)
#define I2C_1_ISR (isr_i2c1)
/** @} */

View File

@ -64,7 +64,7 @@ static const spi_conf_t spi_config[] = {
.simmask = SIM_SCGC6_SPI1_MASK
}
};
#define SPI_NUMOF (sizeof(spi_config) / sizeof(spi_config[0]))
#define SPI_NUMOF ARRAY_SIZE(spi_config)
/** @} */
/**
@ -92,7 +92,7 @@ static const adc_conf_t adc_config[] = {
/* internal: DCDC divided battery level */
[ 6] = { .dev = ADC0, .pin = GPIO_UNDEF, .chan = 23, .avg = ADC_AVG_MAX },
};
#define ADC_NUMOF (sizeof(adc_config) / sizeof(adc_config[0]))
#define ADC_NUMOF ARRAY_SIZE(adc_config)
/*
* KW41Z ADC reference settings:
* 0: VREFH external pin or VREF_OUT 1.2 V signal (if VREF module is enabled)

View File

@ -150,7 +150,7 @@ static const tc32_conf_t timer_config[] = {
#define TIMER_0_ISR isr_tc3
#define TIMER_1_ISR isr_tc4
#define TIMER_NUMOF (sizeof(timer_config) / sizeof(timer_config[0]))
#define TIMER_NUMOF ARRAY_SIZE(timer_config)
/** @} */
/**
@ -230,7 +230,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)
/** @} */
/**
@ -248,7 +248,7 @@ static const i2c_conf_t i2c_config[] = {
.flags = I2C_FLAG_NONE
}
};
#define I2C_NUMOF (sizeof(i2c_config) / sizeof(i2c_config[0]))
#define I2C_NUMOF ARRAY_SIZE(i2c_config)
/**
* @name Random Number Generator configuration

View File

@ -49,7 +49,7 @@ static const uart_conf_t uart_config[] = {
#define UART_0_ISR (isr_rng_lpuart1)
#define UART_NUMOF (sizeof(uart_config) / sizeof(uart_config[0]))
#define UART_NUMOF ARRAY_SIZE(uart_config)
/** @} */
/**
@ -89,7 +89,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)
/** @} */
/**
@ -112,7 +112,7 @@ static const i2c_conf_t i2c_config[] = {
#define I2C_0_ISR isr_i2c1
#define I2C_NUMOF (sizeof(i2c_config) / sizeof(i2c_config[0]))
#define I2C_NUMOF ARRAY_SIZE(i2c_config)
/** @} */
#ifdef __cplusplus

View File

@ -27,11 +27,6 @@
extern "C" {
#endif
/**
* @brief Internal macro to calculate *_NUMOF based on config.
*/
#define PERIPH_NUMOF(config) (sizeof(config) / sizeof(config[0]))
/**
* @name Clock configuration
* @{
@ -88,7 +83,7 @@ static const spi_dev_t spi_config[] = {
}
};
#define SPI_NUMOF PERIPH_NUMOF(spi_config)
#define SPI_NUMOF ARRAY_SIZE(spi_config)
/** @} */
/**
@ -111,7 +106,7 @@ static const timer_conf_t timer_config[] = {
}
};
#define TIMER_NUMOF PERIPH_NUMOF(timer_config)
#define TIMER_NUMOF ARRAY_SIZE(timer_config)
#define TIMER_0_ISR isr_timer1
/** @} */
@ -134,7 +129,7 @@ static const uart_conf_t uart_config[] = {
}
};
#define UART_NUMOF PERIPH_NUMOF(uart_config)
#define UART_NUMOF ARRAY_SIZE(uart_config)
#define UART_0_ISR_RX isr_usart0_rx
/** @} */

View File

@ -43,7 +43,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

@ -49,7 +49,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

@ -65,7 +65,7 @@ static const timer_conf_t timer_config[] = {
#define TIMER_0_ISR (isr_tim5)
#define TIMER_NUMOF (sizeof(timer_config) / sizeof(timer_config[0]))
#define TIMER_NUMOF ARRAY_SIZE(timer_config)
/** @} */
/**
@ -98,7 +98,7 @@ static const uart_conf_t uart_config[] = {
#define UART_0_ISR (isr_usart3)
#define UART_1_ISR (isr_usart1)
#define UART_NUMOF (sizeof(uart_config) / sizeof(uart_config[0]))
#define UART_NUMOF ARRAY_SIZE(uart_config)
/** @} */
/**
@ -148,7 +148,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)
/** @} */
/**
@ -185,7 +185,7 @@ static const i2c_conf_t i2c_config[] = {
#define I2C_0_ISR isr_i2c1_ev
#define I2C_1_ISR isr_i2c2_ev
#define I2C_NUMOF (sizeof(i2c_config) / sizeof(i2c_config[0]))
#define I2C_NUMOF ARRAY_SIZE(i2c_config)
/** @} */
#ifdef __cplusplus

View File

@ -101,7 +101,7 @@ static const uart_conf_t uart_config[] = {
#define UART_0_ISR (isr_usart1)
#define UART_1_ISR (isr_usart2)
#define UART_NUMOF (sizeof(uart_config) / sizeof(uart_config[0]))
#define UART_NUMOF ARRAY_SIZE(uart_config)
/** @} */
/**
@ -158,7 +158,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)
/** @} */
/**
@ -182,7 +182,7 @@ static const i2c_conf_t i2c_config[] = {
#define I2C_0_ISR isr_i2c1_ev
#define I2C_NUMOF (sizeof(i2c_config) / sizeof(i2c_config[0]))
#define I2C_NUMOF ARRAY_SIZE(i2c_config)
/** @} */
#ifdef __cplusplus

View File

@ -46,7 +46,7 @@ static const dma_conf_t dma_config[] = {
#define DMA_SHARED_ISR_1 isr_dma1_channel4_5_6_7
#define DMA_SHARED_ISR_1_STREAMS { 2, 3, 4 } /* Indexes 2, 3 and 4 of dma_config share the same isr */
#define DMA_NUMOF (sizeof(dma_config) / sizeof(dma_config[0]))
#define DMA_NUMOF ARRAY_SIZE(dma_config)
#endif
/** @} */
@ -92,7 +92,7 @@ static const uart_conf_t uart_config[] = {
#define UART_0_ISR (isr_usart1)
#define UART_1_ISR (isr_usart2)
#define UART_NUMOF (sizeof(uart_config) / sizeof(uart_config[0]))
#define UART_NUMOF ARRAY_SIZE(uart_config)
/** @} */
/**
@ -138,7 +138,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)
/** @} */
/**
@ -161,7 +161,7 @@ static const i2c_conf_t i2c_config[] = {
#define I2C_0_ISR isr_i2c1
#define I2C_NUMOF (sizeof(i2c_config) / sizeof(i2c_config[0]))
#define I2C_NUMOF ARRAY_SIZE(i2c_config)
/** @} */
#ifdef __cplusplus

View File

@ -83,7 +83,7 @@ static const timer_conf_t timer_config[] = {
#define TIMER_0_ISR isr_tim2
#define TIMER_1_ISR isr_tim3
#define TIMER_NUMOF (sizeof(timer_config) / sizeof(timer_config[0]))
#define TIMER_NUMOF ARRAY_SIZE(timer_config)
/** @} */
/**
@ -121,7 +121,7 @@ static const uart_conf_t uart_config[] = {
#define UART_1_ISR isr_usart1
#define UART_2_ISR isr_usart3
#define UART_NUMOF (sizeof(uart_config) / sizeof(uart_config[0]))
#define UART_NUMOF ARRAY_SIZE(uart_config)
/** @} */
/**
@ -154,7 +154,7 @@ static const i2c_conf_t i2c_config[] = {
#define I2C_0_ISR isr_i2c1_ev
#define I2C_1_ISR isr_i2c2_ev
#define I2C_NUMOF (sizeof(i2c_config) / sizeof(i2c_config[0]))
#define I2C_NUMOF ARRAY_SIZE(i2c_config)
/** @} */
/**
@ -205,7 +205,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

@ -53,7 +53,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

@ -51,7 +51,7 @@ static const timer_conf_t timer_config[] = {
#define TIMER_0_ISR isr_tim2
#define TIMER_1_ISR isr_tim5
#define TIMER_NUMOF (sizeof(timer_config) / sizeof(timer_config[0]))
#define TIMER_NUMOF ARRAY_SIZE(timer_config)
/** @} */
/**
@ -71,7 +71,7 @@ static const pwm_conf_t pwm_config[] = {
}
};
#define PWM_NUMOF (sizeof(pwm_config) / sizeof(pwm_config[0]))
#define PWM_NUMOF ARRAY_SIZE(pwm_config)
/** @} */
/**
@ -98,7 +98,7 @@ static const dac_conf_t dac_config[] = {
{ .pin = GPIO_PIN(PORT_A, 5), .chan = 1 }
};
#define DAC_NUMOF (sizeof(dac_config) / sizeof(dac_config[0]))
#define DAC_NUMOF ARRAY_SIZE(dac_config)
/** @} */
/**
@ -159,7 +159,7 @@ static const uart_conf_t uart_config[] = {
#define UART_2_DMA_ISR (isr_dma1_stream3)
/* deduct number of defined UART interfaces */
#define UART_NUMOF (sizeof(uart_config) / sizeof(uart_config[0]))
#define UART_NUMOF ARRAY_SIZE(uart_config)
/** @} */
/**
@ -179,7 +179,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)
/** @} */
/**
@ -203,7 +203,7 @@ static const i2c_conf_t i2c_config[] = {
#define I2C_0_ISR isr_i2c1_ev
#define I2C_NUMOF (sizeof(i2c_config) / sizeof(i2c_config[0]))
#define I2C_NUMOF ARRAY_SIZE(i2c_config)
/** @} */
#ifdef __cplusplus

View File

@ -156,7 +156,7 @@ static const uart_conf_t uart_config[] = {
#define UART_0_ISR (isr_uart0_rx_tx)
#define UART_1_ISR (isr_uart1_rx_tx)
#define UART_NUMOF (sizeof(uart_config) / sizeof(uart_config[0]))
#define UART_NUMOF ARRAY_SIZE(uart_config)
/** @} */
/**
@ -202,7 +202,7 @@ static const adc_conf_t adc_config[] = {
[16] = { .dev = ADC1, .pin = GPIO_PIN(PORT_C, 11), .chan = 7, .avg = ADC_AVG_MAX },
};
#define ADC_NUMOF (sizeof(adc_config) / sizeof(adc_config[0]))
#define ADC_NUMOF ARRAY_SIZE(adc_config)
/*
* K60D ADC reference settings:
* 0: VREFH/VREFL external pin pair
@ -224,7 +224,7 @@ static const dac_conf_t dac_config[] = {
}
};
#define DAC_NUMOF (sizeof(dac_config) / sizeof(dac_config[0]))
#define DAC_NUMOF ARRAY_SIZE(dac_config)
/** @} */
/**
@ -256,7 +256,7 @@ static const pwm_conf_t pwm_config[] = {
}
};
#define PWM_NUMOF (sizeof(pwm_config) / sizeof(pwm_config[0]))
#define PWM_NUMOF ARRAY_SIZE(pwm_config)
/** @} */
/**
@ -335,7 +335,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)
/** @} */
/**
@ -354,7 +354,7 @@ static const i2c_conf_t i2c_config[] = {
.sda_pcr = (PORT_PCR_MUX(2) | PORT_PCR_ODE_MASK),
},
};
#define I2C_NUMOF (sizeof(i2c_config) / sizeof(i2c_config[0]))
#define I2C_NUMOF ARRAY_SIZE(i2c_config)
#define I2C_0_ISR (isr_i2c0)
#define I2C_1_ISR (isr_i2c1)
/** @} */

View File

@ -180,7 +180,7 @@ static const motor_driver_config_t motor_driver_config[] = {
},
};
#define MOTOR_DRIVER_NUMOF (sizeof(motor_driver_config) / sizeof(motor_driver_config[0]))
#define MOTOR_DRIVER_NUMOF ARRAY_SIZE(motor_driver_config)
/** @} */
#endif /* __cplusplus */

View File

@ -54,7 +54,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)
/** @} */
/**
@ -71,7 +71,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

@ -48,7 +48,7 @@ static const uart_conf_t uart_config[] = {
#define UART_0_ISR (isr_uart0)
#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 spi_conf_t spi_config[] = {
.miso = GPIO_PIN(1, 14),
}
};
#define SPI_NUMOF (sizeof(spi_config) / sizeof(spi_config[0]))
#define SPI_NUMOF ARRAY_SIZE(spi_config)
/** @} */
/**
@ -67,7 +67,7 @@ static const uart_conf_t uart_config[] = {
#define UART_0_ISR (isr_uart0)
#define UART_1_ISR (isr_uarte1)
#define UART_NUMOF (sizeof(uart_config) / sizeof(uart_config[0]))
#define UART_NUMOF ARRAY_SIZE(uart_config)
/** @} */
#ifdef __cplusplus

View File

@ -40,7 +40,7 @@ static const spi_conf_t spi_config[] = {
.miso = GPIO_PIN(0, 24),
}
};
#define SPI_NUMOF (sizeof(spi_config) / sizeof(spi_config[0]))
#define SPI_NUMOF ARRAY_SIZE(spi_config)
/** @} */
/**

View File

@ -66,7 +66,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

@ -71,7 +71,7 @@ static const timer_conf_t timer_config[] = {
#define TIMER_0_ISR (isr_tim1_cc)
#define TIMER_NUMOF (sizeof(timer_config) / sizeof(timer_config[0]))
#define TIMER_NUMOF ARRAY_SIZE(timer_config)
/** @} */
/**
@ -104,7 +104,7 @@ static const uart_conf_t uart_config[] = {
#define UART_0_ISR (isr_usart2)
#define UART_1_ISR (isr_usart1)
#define UART_NUMOF (sizeof(uart_config) / sizeof(uart_config[0]))
#define UART_NUMOF ARRAY_SIZE(uart_config)
/** @} */
/**
@ -134,7 +134,7 @@ static const pwm_conf_t pwm_config[] = {
}
};
#define PWM_NUMOF (sizeof(pwm_config) / sizeof(pwm_config[0]))
#define PWM_NUMOF ARRAY_SIZE(pwm_config)
/** @} */
/**
@ -184,7 +184,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)
/** @} */
/**

View File

@ -74,7 +74,7 @@ static const uart_conf_t uart_config[] = {
#define UART_0_ISR (isr_usart1)
#define UART_NUMOF (sizeof(uart_config) / sizeof(uart_config[0]))
#define UART_NUMOF ARRAY_SIZE(uart_config)
/** @} */
/**
@ -114,7 +114,7 @@ static const pwm_conf_t pwm_config[] = {
},
};
#define PWM_NUMOF (sizeof(pwm_config) / sizeof(pwm_config[0]))
#define PWM_NUMOF ARRAY_SIZE(pwm_config)
/** @} */
/**
@ -154,7 +154,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)
/** @} */
/**

View File

@ -84,7 +84,7 @@ static const uart_conf_t uart_config[] = {
#define UART_0_ISR (isr_usart2)
#define UART_1_ISR (isr_usart1)
#define UART_NUMOF (sizeof(uart_config) / sizeof(uart_config[0]))
#define UART_NUMOF ARRAY_SIZE(uart_config)
/** @} */
/**
@ -124,7 +124,7 @@ static const pwm_conf_t pwm_config[] = {
}
};
#define PWM_NUMOF (sizeof(pwm_config) / sizeof(pwm_config[0]))
#define PWM_NUMOF ARRAY_SIZE(pwm_config)
/** @} */
/**
@ -164,7 +164,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)
/** @} */
/**

View File

@ -73,7 +73,7 @@ static const timer_conf_t timer_config[] = {
#define TIMER_0_ISR isr_tim1_cc
#define TIMER_NUMOF (sizeof(timer_config) / sizeof(timer_config[0]))
#define TIMER_NUMOF ARRAY_SIZE(timer_config)
/** @} */
/**
@ -117,7 +117,7 @@ static const uart_conf_t uart_config[] = {
#define UART_1_ISR (isr_usart1)
#define UART_2_ISR (isr_usart3_8)
#define UART_NUMOF (sizeof(uart_config) / sizeof(uart_config[0]))
#define UART_NUMOF ARRAY_SIZE(uart_config)
/** @} */
/**
@ -147,7 +147,7 @@ static const pwm_conf_t pwm_config[] = {
}
};
#define PWM_NUMOF (sizeof(pwm_config) / sizeof(pwm_config[0]))
#define PWM_NUMOF ARRAY_SIZE(pwm_config)
/** @} */
/**

View File

@ -71,7 +71,7 @@ static const timer_conf_t timer_config[] = {
#define TIMER_0_ISR isr_tim1_cc
#define TIMER_NUMOF (sizeof(timer_config) / sizeof(timer_config[0]))
#define TIMER_NUMOF ARRAY_SIZE(timer_config)
/** @} */
/**
@ -115,7 +115,7 @@ static const uart_conf_t uart_config[] = {
#define UART_1_ISR (isr_usart1)
#define UART_2_ISR (isr_usart3_8)
#define UART_NUMOF (sizeof(uart_config) / sizeof(uart_config[0]))
#define UART_NUMOF ARRAY_SIZE(uart_config)
/** @} */
/**
@ -155,7 +155,7 @@ static const pwm_conf_t pwm_config[] = {
}
};
#define PWM_NUMOF (sizeof(pwm_config) / sizeof(pwm_config[0]))
#define PWM_NUMOF ARRAY_SIZE(pwm_config)
/** @} */
/**
@ -205,7 +205,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)
/** @} */
/**

View File

@ -67,7 +67,7 @@ static const dma_conf_t dma_config[] = {
#define DMA_SHARED_ISR_0 isr_dma1_ch2_3_dma2_ch1_2
#define DMA_SHARED_ISR_0_STREAMS { 0, 1 } /* Indexes 0 and 1 of dma_config share the same isr */
#define DMA_NUMOF (sizeof(dma_config) / sizeof(dma_config[0]))
#define DMA_NUMOF ARRAY_SIZE(dma_config)
#endif
/**
@ -86,7 +86,7 @@ static const timer_conf_t timer_config[] = {
#define TIMER_0_ISR isr_tim1_cc
#define TIMER_NUMOF (sizeof(timer_config) / sizeof(timer_config[0]))
#define TIMER_NUMOF ARRAY_SIZE(timer_config)
/** @} */
/**
@ -142,7 +142,7 @@ static const uart_conf_t uart_config[] = {
#define UART_1_ISR (isr_usart1)
#define UART_2_ISR (isr_usart3_8)
#define UART_NUMOF (sizeof(uart_config) / sizeof(uart_config[0]))
#define UART_NUMOF ARRAY_SIZE(uart_config)
/** @} */
@ -189,7 +189,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)
/** @} */
/**
@ -219,7 +219,7 @@ static const pwm_conf_t pwm_config[] = {
}
};
#define PWM_NUMOF (sizeof(pwm_config) / sizeof(pwm_config[0]))
#define PWM_NUMOF ARRAY_SIZE(pwm_config)
/** @} */
/**

View File

@ -78,7 +78,7 @@ static const timer_conf_t timer_config[] = {
#define TIMER_0_ISR isr_tim2
#define TIMER_1_ISR isr_tim3
#define TIMER_NUMOF (sizeof(timer_config) / sizeof(timer_config[0]))
#define TIMER_NUMOF ARRAY_SIZE(timer_config)
/** @} */
/**
@ -116,7 +116,7 @@ static const uart_conf_t uart_config[] = {
#define UART_1_ISR (isr_usart1)
#define UART_2_ISR (isr_usart3)
#define UART_NUMOF (sizeof(uart_config) / sizeof(uart_config[0]))
#define UART_NUMOF ARRAY_SIZE(uart_config)
/** @} */
/**
@ -165,7 +165,7 @@ static const i2c_conf_t i2c_config[] = {
#define I2C_0_ISR isr_i2c1_ev
#define I2C_1_ISR isr_i2c2_ev
#define I2C_NUMOF (sizeof(i2c_config) / sizeof(i2c_config[0]))
#define I2C_NUMOF ARRAY_SIZE(i2c_config)
/** @} */
/**
@ -213,7 +213,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

@ -50,7 +50,7 @@ static const dma_conf_t dma_config[] = {
#define DMA_4_ISR isr_dma2_stream6
#define DMA_5_ISR isr_dma1_stream6
#define DMA_NUMOF (sizeof(dma_config) / sizeof(dma_config[0]))
#define DMA_NUMOF ARRAY_SIZE(dma_config)
#endif
/** @} */
@ -81,7 +81,7 @@ static const pwm_conf_t pwm_config[] = {
},
};
#define PWM_NUMOF (sizeof(pwm_config) / sizeof(pwm_config[0]))
#define PWM_NUMOF ARRAY_SIZE(pwm_config)
/** @} */
/**
@ -108,7 +108,7 @@ static const timer_conf_t timer_config[] = {
#define TIMER_0_ISR isr_tim2
#define TIMER_1_ISR isr_tim5
#define TIMER_NUMOF (sizeof(timer_config) / sizeof(timer_config[0]))
#define TIMER_NUMOF ARRAY_SIZE(timer_config)
/** @} */
/**
@ -164,7 +164,7 @@ static const uart_conf_t uart_config[] = {
#define UART_1_ISR (isr_usart6)
#define UART_2_ISR (isr_usart2)
#define UART_NUMOF (sizeof(uart_config) / sizeof(uart_config[0]))
#define UART_NUMOF ARRAY_SIZE(uart_config)
/** @} */
/**
@ -226,7 +226,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)
/** @} */
/**

View File

@ -100,7 +100,7 @@ static const uart_conf_t uart_config[] = {
#define UART_1_ISR (isr_usart1)
#define UART_2_ISR (isr_usart3)
#define UART_NUMOF (sizeof(uart_config) / sizeof(uart_config[0]))
#define UART_NUMOF ARRAY_SIZE(uart_config)
/** @} */
/**
@ -120,7 +120,7 @@ static const pwm_conf_t pwm_config[] = {
}
};
#define PWM_NUMOF (sizeof(pwm_config) / sizeof(pwm_config[0]))
#define PWM_NUMOF ARRAY_SIZE(pwm_config)
/** @} */
/**
@ -160,7 +160,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)
/** @} */
/**
@ -197,7 +197,7 @@ static const i2c_conf_t i2c_config[] = {
#define I2C_0_ISR isr_i2c1_er
#define I2C_1_ISR isr_i2c3_er
#define I2C_NUMOF (sizeof(i2c_config) / sizeof(i2c_config[0]))
#define I2C_NUMOF ARRAY_SIZE(i2c_config)
/** @} */
#ifdef __cplusplus

View File

@ -85,7 +85,7 @@ static const uart_conf_t uart_config[] = {
#define UART_0_ISR (isr_usart2)
#define UART_1_ISR (isr_usart1)
#define UART_NUMOF (sizeof(uart_config) / sizeof(uart_config[0]))
#define UART_NUMOF ARRAY_SIZE(uart_config)
/** @} */
/**
@ -115,7 +115,7 @@ static const pwm_conf_t pwm_config[] = {
}
};
#define PWM_NUMOF (sizeof(pwm_config) / sizeof(pwm_config[0]))
#define PWM_NUMOF ARRAY_SIZE(pwm_config)
/** @} */
/**
@ -155,7 +155,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

@ -98,7 +98,7 @@ static const uart_conf_t uart_config[] = {
#define UART_1_ISR (isr_usart1)
#define UART_2_ISR (isr_usart3)
#define UART_NUMOF (sizeof(uart_config) / sizeof(uart_config[0]))
#define UART_NUMOF ARRAY_SIZE(uart_config)
/** @} */
/**
@ -118,7 +118,7 @@ static const pwm_conf_t pwm_config[] = {
}
};
#define PWM_NUMOF (sizeof(pwm_config) / sizeof(pwm_config[0]))
#define PWM_NUMOF ARRAY_SIZE(pwm_config)
/** @} */
/**
@ -178,7 +178,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)
/** @} */
/**
@ -215,7 +215,7 @@ static const i2c_conf_t i2c_config[] = {
#define I2C_0_ISR isr_i2c1_er
#define I2C_1_ISR isr_i2c3_er
#define I2C_NUMOF (sizeof(i2c_config) / sizeof(i2c_config[0]))
#define I2C_NUMOF ARRAY_SIZE(i2c_config)
/** @} */
#ifdef __cplusplus

View File

@ -111,7 +111,7 @@ static const uart_conf_t uart_config[] = {
#define UART_2_ISR (isr_usart2)
#define UART_2_DMA_ISR (isr_dma1_stream4)
#define UART_NUMOF (sizeof(uart_config) / sizeof(uart_config[0]))
#define UART_NUMOF ARRAY_SIZE(uart_config)
/** @} */
/**
@ -141,7 +141,7 @@ static const pwm_conf_t pwm_config[] = {
}
};
#define PWM_NUMOF (sizeof(pwm_config) / sizeof(pwm_config[0]))
#define PWM_NUMOF ARRAY_SIZE(pwm_config)
/** @} */
/**
@ -181,7 +181,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

@ -97,7 +97,7 @@ static const uart_conf_t uart_config[] = {
#define UART_1_ISR (isr_usart1)
#define UART_2_ISR (isr_usart3)
#define UART_NUMOF (sizeof(uart_config) / sizeof(uart_config[0]))
#define UART_NUMOF ARRAY_SIZE(uart_config)
/** @} */
/**
@ -117,7 +117,7 @@ static const pwm_conf_t pwm_config[] = {
}
};
#define PWM_NUMOF (sizeof(pwm_config) / sizeof(pwm_config[0]))
#define PWM_NUMOF ARRAY_SIZE(pwm_config)
/** @} */
/**
@ -157,7 +157,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

@ -84,7 +84,7 @@ static const uart_conf_t uart_config[] = {
#define UART_2_ISR (isr_usart6)
#define UART_2_DMA_ISR (isr_dma1_stream6)
#define UART_NUMOF (sizeof(uart_config) / sizeof(uart_config[0]))
#define UART_NUMOF ARRAY_SIZE(uart_config)
/** @} */
/**
@ -104,7 +104,7 @@ static const pwm_conf_t pwm_config[] = {
},
};
#define PWM_NUMOF (sizeof(pwm_config) / sizeof(pwm_config[0]))
#define PWM_NUMOF ARRAY_SIZE(pwm_config)
/** @} */
/**
@ -137,7 +137,7 @@ static const qdec_conf_t qdec_config[] = {
#define QDEC_0_ISR isr_tim3
#define QDEC_1_ISR isr_tim4
#define QDEC_NUMOF (sizeof(qdec_config) / sizeof(qdec_config[0]))
#define QDEC_NUMOF ARRAY_SIZE(qdec_config)
/** @} */
/**
@ -197,7 +197,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)
/** @} */
/**

View File

@ -86,7 +86,7 @@ static const uart_conf_t uart_config[] = {
#define UART_2_DMA_ISR (isr_dma2_stream7)
/* deduct number of defined UART interfaces */
#define UART_NUMOF (sizeof(uart_config) / sizeof(uart_config[0]))
#define UART_NUMOF ARRAY_SIZE(uart_config)
/** @} */
/**
@ -126,7 +126,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)
/** @} */
/**

View File

@ -86,7 +86,7 @@ static const uart_conf_t uart_config[] = {
#define UART_2_DMA_ISR isr_dma1_stream6
/* deduct number of defined UART interfaces */
#define UART_NUMOF (sizeof(uart_config) / sizeof(uart_config[0]))
#define UART_NUMOF ARRAY_SIZE(uart_config)
/** @} */
/** @name PWM configuration
@ -115,7 +115,7 @@ static const pwm_conf_t pwm_config[] = {
},
};
#define PWM_NUMOF (sizeof(pwm_config) / sizeof(pwm_config[0]))
#define PWM_NUMOF ARRAY_SIZE(pwm_config)
/** @} */
/**
@ -155,7 +155,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)
/** @} */
/**

View File

@ -86,7 +86,7 @@ static const uart_conf_t uart_config[] = {
#define UART_2_ISR (isr_usart2)
#define UART_2_DMA_ISR (isr_dma1_stream4)
#define UART_NUMOF (sizeof(uart_config) / sizeof(uart_config[0]))
#define UART_NUMOF ARRAY_SIZE(uart_config)
/** @} */
/**
@ -116,7 +116,7 @@ static const pwm_conf_t pwm_config[] = {
},
};
#define PWM_NUMOF (sizeof(pwm_config) / sizeof(pwm_config[0]))
#define PWM_NUMOF ARRAY_SIZE(pwm_config)
/** @} */
/**
@ -156,7 +156,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)
/** @} */
/**

View File

@ -49,7 +49,7 @@ static const dma_conf_t dma_config[] = {
#define DMA_3_ISR isr_dma2_stream2
#define DMA_4_ISR isr_dma2_stream0
#define DMA_NUMOF (sizeof(dma_config) / sizeof(dma_config[0]))
#define DMA_NUMOF ARRAY_SIZE(dma_config)
#endif
/** @} */
@ -109,7 +109,7 @@ static const uart_conf_t uart_config[] = {
#define UART_2_ISR (isr_usart2)
#define UART_2_DMA_ISR (isr_dma1_stream4)
#define UART_NUMOF (sizeof(uart_config) / sizeof(uart_config[0]))
#define UART_NUMOF ARRAY_SIZE(uart_config)
/** @} */
/**
@ -139,7 +139,7 @@ static const pwm_conf_t pwm_config[] = {
},
};
#define PWM_NUMOF (sizeof(pwm_config) / sizeof(pwm_config[0]))
#define PWM_NUMOF ARRAY_SIZE(pwm_config)
/** @} */
/**
@ -185,7 +185,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)
/** @} */
/**

View File

@ -85,7 +85,7 @@ static const uart_conf_t uart_config[] = {
#define UART_2_ISR (isr_usart2)
#define UART_2_DMA_ISR (isr_dma1_stream4)
#define UART_NUMOF (sizeof(uart_config) / sizeof(uart_config[0]))
#define UART_NUMOF ARRAY_SIZE(uart_config)
/** @} */
/**
@ -115,7 +115,7 @@ static const pwm_conf_t pwm_config[] = {
},
};
#define PWM_NUMOF (sizeof(pwm_config) / sizeof(pwm_config[0]))
#define PWM_NUMOF ARRAY_SIZE(pwm_config)
/** @} */
/**
@ -135,7 +135,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)
/** @} */
/**

View File

@ -85,7 +85,7 @@ static const uart_conf_t uart_config[] = {
#define UART_2_ISR (isr_usart3)
#define UART_2_DMA_ISR (isr_dma1_stream5)
#define UART_NUMOF (sizeof(uart_config) / sizeof(uart_config[0]))
#define UART_NUMOF ARRAY_SIZE(uart_config)
/** @} */
/**
@ -115,7 +115,7 @@ static const pwm_conf_t pwm_config[] = {
},
};
#define PWM_NUMOF (sizeof(pwm_config) / sizeof(pwm_config[0]))
#define PWM_NUMOF ARRAY_SIZE(pwm_config)
/** @} */
/**
@ -148,7 +148,7 @@ static const qdec_conf_t qdec_config[] = {
#define QDEC_0_ISR isr_tim3
#define QDEC_1_ISR isr_tim4
#define QDEC_NUMOF (sizeof(qdec_config) / sizeof(qdec_config[0]))
#define QDEC_NUMOF ARRAY_SIZE(qdec_config)
/** @} */
/**
@ -191,7 +191,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)
/** @} */
/**

View File

@ -85,7 +85,7 @@ static const uart_conf_t uart_config[] = {
#define UART_2_ISR (isr_usart2)
#define UART_2_DMA_ISR (isr_dma1_stream4)
#define UART_NUMOF (sizeof(uart_config) / sizeof(uart_config[0]))
#define UART_NUMOF ARRAY_SIZE(uart_config)
/** @} */
/**
@ -115,7 +115,7 @@ static const pwm_conf_t pwm_config[] = {
},
};
#define PWM_NUMOF (sizeof(pwm_config) / sizeof(pwm_config[0]))
#define PWM_NUMOF ARRAY_SIZE(pwm_config)
/** @} */
/**
@ -135,7 +135,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

@ -85,7 +85,7 @@ static const uart_conf_t uart_config[] = {
#define UART_2_ISR (isr_usart2)
#define UART_2_DMA_ISR (isr_dma1_stream4)
#define UART_NUMOF (sizeof(uart_config) / sizeof(uart_config[0]))
#define UART_NUMOF ARRAY_SIZE(uart_config)
/** @} */
#ifdef __cplusplus

View File

@ -85,7 +85,7 @@ static const uart_conf_t uart_config[] = {
#define UART_2_ISR (isr_usart2)
#define UART_2_DMA_ISR (isr_dma1_stream4)
#define UART_NUMOF (sizeof(uart_config) / sizeof(uart_config[0]))
#define UART_NUMOF ARRAY_SIZE(uart_config)
/** @} */
#ifdef __cplusplus

View File

@ -47,7 +47,7 @@ static const dma_conf_t dma_config[] = {
#define DMA_2_ISR isr_dma1_stream6
#define DMA_3_ISR isr_dma2_stream0
#define DMA_NUMOF (sizeof(dma_config) / sizeof(dma_config[0]))
#define DMA_NUMOF ARRAY_SIZE(dma_config)
#endif
/** @} */
@ -104,7 +104,7 @@ static const uart_conf_t uart_config[] = {
#define UART_1_ISR (isr_usart6)
#define UART_2_ISR (isr_usart2)
#define UART_NUMOF (sizeof(uart_config) / sizeof(uart_config[0]))
#define UART_NUMOF ARRAY_SIZE(uart_config)
/** @} */
/**
@ -137,7 +137,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)
/** @} */
/**

View File

@ -51,7 +51,7 @@ static const uart_conf_t uart_config[] = {
#define UART_0_ISR (isr_usart2)
#define UART_NUMOF (sizeof(uart_config) / sizeof(uart_config[0]))
#define UART_NUMOF ARRAY_SIZE(uart_config)
/** @} */
/**
@ -71,7 +71,7 @@ static const pwm_conf_t pwm_config[] = {
}
};
#define PWM_NUMOF (sizeof(pwm_config) / sizeof(pwm_config[0]))
#define PWM_NUMOF ARRAY_SIZE(pwm_config)
/** @} */
/**
@ -108,7 +108,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)
/** @} */
/**

View File

@ -64,7 +64,7 @@ static const uart_conf_t uart_config[] = {
#define UART_0_ISR (isr_usart2)
#define UART_1_ISR (isr_usart1)
#define UART_NUMOF (sizeof(uart_config) / sizeof(uart_config[0]))
#define UART_NUMOF ARRAY_SIZE(uart_config)
/** @} */
/**
@ -84,7 +84,7 @@ static const pwm_conf_t pwm_config[] = {
}
};
#define PWM_NUMOF (sizeof(pwm_config) / sizeof(pwm_config[0]))
#define PWM_NUMOF ARRAY_SIZE(pwm_config)
/** @} */
/**
@ -124,7 +124,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

@ -82,7 +82,7 @@ static const uart_conf_t uart_config[] = {
#define UART_2_ISR (isr_rng_lpuart1)
#endif
#define UART_NUMOF (sizeof(uart_config) / sizeof(uart_config[0]))
#define UART_NUMOF ARRAY_SIZE(uart_config)
/** @} */
/**
@ -102,7 +102,7 @@ static const pwm_conf_t pwm_config[] = {
}
};
#define PWM_NUMOF (sizeof(pwm_config) / sizeof(pwm_config[0]))
#define PWM_NUMOF ARRAY_SIZE(pwm_config)
/** @} */
/**
@ -142,7 +142,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)
/** @} */
/**
@ -193,7 +193,7 @@ static const i2c_conf_t i2c_config[] = {
#define I2C_0_ISR isr_i2c1
#define I2C_1_ISR isr_i2c2
#define I2C_NUMOF (sizeof(i2c_config) / sizeof(i2c_config[0]))
#define I2C_NUMOF ARRAY_SIZE(i2c_config)
/** @} */
#ifdef __cplusplus

View File

@ -78,7 +78,7 @@ static const dma_conf_t dma_config[] = {
#define DMA_2_ISR isr_dma1_ch7
#define DMA_3_ISR isr_dma1_ch4
#define DMA_NUMOF (sizeof(dma_config) / sizeof(dma_config[0]))
#define DMA_NUMOF ARRAY_SIZE(dma_config)
#endif
/** @} */
@ -135,7 +135,7 @@ static const uart_conf_t uart_config[] = {
#define UART_1_ISR (isr_usart1)
#define UART_2_ISR (isr_usart3)
#define UART_NUMOF (sizeof(uart_config) / sizeof(uart_config[0]))
#define UART_NUMOF ARRAY_SIZE(uart_config)
/** @} */
/**
@ -165,7 +165,7 @@ static const pwm_conf_t pwm_config[] = {
}
};
#define PWM_NUMOF (sizeof(pwm_config) / sizeof(pwm_config[0]))
#define PWM_NUMOF ARRAY_SIZE(pwm_config)
/** @} */
/**
@ -211,7 +211,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)
/** @} */
/**
@ -248,7 +248,7 @@ static const i2c_conf_t i2c_config[] = {
#define I2C_0_ISR isr_i2c1_ev
#define I2C_1_ISR isr_i2c2_ev
#define I2C_NUMOF (sizeof(i2c_config) / sizeof(i2c_config[0]))
#define I2C_NUMOF ARRAY_SIZE(i2c_config)
/** @} */
/**
@ -276,7 +276,7 @@ static const dac_conf_t dac_config[] = {
{ .pin = GPIO_PIN(PORT_A, 5), .chan = 1 }
};
#define DAC_NUMOF (sizeof(dac_config) / sizeof(dac_config[0]))
#define DAC_NUMOF ARRAY_SIZE(dac_config)
/** @} */

View File

@ -107,7 +107,7 @@ static const uart_conf_t uart_config[] = {
#define UART_0_ISR (isr_usart2)
#define UART_1_ISR (isr_usart1)
#define UART_NUMOF (sizeof(uart_config) / sizeof(uart_config[0]))
#define UART_NUMOF ARRAY_SIZE(uart_config)
/** @} */
/**
@ -127,7 +127,7 @@ static const pwm_conf_t pwm_config[] = {
}
};
#define PWM_NUMOF (sizeof(pwm_config) / sizeof(pwm_config[0]))
#define PWM_NUMOF ARRAY_SIZE(pwm_config)
/** @} */
/**
@ -167,7 +167,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

@ -120,7 +120,7 @@ static const uart_conf_t uart_config[] = {
#define UART_0_ISR (isr_lpuart1)
#define UART_1_ISR (isr_usart1)
#define UART_NUMOF (sizeof(uart_config) / sizeof(uart_config[0]))
#define UART_NUMOF ARRAY_SIZE(uart_config)
/** @} */
/**
@ -140,7 +140,7 @@ static const pwm_conf_t pwm_config[] = {
}
};
#define PWM_NUMOF (sizeof(pwm_config) / sizeof(pwm_config[0]))
#define PWM_NUMOF ARRAY_SIZE(pwm_config)
/** @} */
/**
@ -180,7 +180,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)
/** @} */
/**
@ -203,7 +203,7 @@ static const i2c_conf_t i2c_config[] = {
#define I2C_0_ISR isr_i2c1_er
#define I2C_NUMOF (sizeof(i2c_config) / sizeof(i2c_config[0]))
#define I2C_NUMOF ARRAY_SIZE(i2c_config)
/** @} */
#ifdef __cplusplus

View File

@ -121,7 +121,7 @@ static const uart_conf_t uart_config[] = {
#define UART_0_ISR (isr_usart2)
#define UART_1_ISR (isr_usart3)
#define UART_NUMOF (sizeof(uart_config) / sizeof(uart_config[0]))
#define UART_NUMOF ARRAY_SIZE(uart_config)
/** @} */
/**
@ -141,7 +141,7 @@ static const pwm_conf_t pwm_config[] = {
},
};
#define PWM_NUMOF (sizeof(pwm_config) / sizeof(pwm_config[0]))
#define PWM_NUMOF ARRAY_SIZE(pwm_config)
/** @} */
/**
@ -181,7 +181,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

@ -105,7 +105,7 @@ static const dma_conf_t dma_config[] = {
#define DMA_2_ISR isr_dma1_channel4
#define DMA_3_ISR isr_dma1_channel7
#define DMA_NUMOF (sizeof(dma_config) / sizeof(dma_config[0]))
#define DMA_NUMOF ARRAY_SIZE(dma_config)
#endif /* MODULE_PERIPH_DMA */
/** @} */
@ -126,7 +126,7 @@ static const timer_conf_t timer_config[] = {
#define TIMER_0_ISR isr_tim5
#define TIMER_NUMOF (sizeof(timer_config) / sizeof(timer_config[0]))
#define TIMER_NUMOF ARRAY_SIZE(timer_config)
/** @} */
/**
@ -188,7 +188,7 @@ static const uart_conf_t uart_config[] = {
#define UART_1_ISR (isr_usart3)
#define UART_2_ISR (isr_usart1)
#define UART_NUMOF (sizeof(uart_config) / sizeof(uart_config[0]))
#define UART_NUMOF ARRAY_SIZE(uart_config)
/** @} */
/**
@ -228,7 +228,7 @@ static const pwm_conf_t pwm_config[] = {
}
};
#define PWM_NUMOF (sizeof(pwm_config) / sizeof(pwm_config[0]))
#define PWM_NUMOF ARRAY_SIZE(pwm_config)
/** @} */
/**
@ -274,7 +274,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)
/** @} */
/**

View File

@ -106,7 +106,7 @@ static const timer_conf_t timer_config[] = {
#define TIMER_0_ISR isr_tim2
#define TIMER_1_ISR isr_tim5
#define TIMER_NUMOF (sizeof(timer_config) / sizeof(timer_config[0]))
#define TIMER_NUMOF ARRAY_SIZE(timer_config)
/** @} */
/**
@ -148,7 +148,7 @@ static const uart_conf_t uart_config[] = {
#define UART_1_ISR (isr_usart3)
#define UART_1_DMA_ISR (isr_dma1_stream5)
#define UART_NUMOF (sizeof(uart_config) / sizeof(uart_config[0]))
#define UART_NUMOF ARRAY_SIZE(uart_config)
/** @} */
/**
@ -178,7 +178,7 @@ static const pwm_conf_t pwm_config[] = {
},
};
#define PWM_NUMOF (sizeof(pwm_config) / sizeof(pwm_config[0]))
#define PWM_NUMOF ARRAY_SIZE(pwm_config)
/** @} */
/**
@ -218,7 +218,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

@ -84,7 +84,7 @@ static const timer_conf_t timer_config[] = {
#define TIMER_0_ISR isr_tim5
#define TIMER_NUMOF (sizeof(timer_config) / sizeof(timer_config[0]))
#define TIMER_NUMOF ARRAY_SIZE(timer_config)
/** @} */
/**
@ -125,7 +125,7 @@ static const uart_conf_t uart_config[] = {
#define UART_0_ISR (isr_lpuart1)
#define UART_1_ISR (isr_usart3)
#define UART_NUMOF (sizeof(uart_config) / sizeof(uart_config[0]))
#define UART_NUMOF ARRAY_SIZE(uart_config)
/** @} */
/**
@ -165,7 +165,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

@ -91,7 +91,7 @@ static const uart_conf_t uart_config[] = {
#define UART_1_ISR (isr_usart2)
#define UART_2_ISR (isr_usart1)
#define UART_NUMOF (sizeof(uart_config) / sizeof(uart_config[0]))
#define UART_NUMOF ARRAY_SIZE(uart_config)
/** @} */
/**
@ -111,7 +111,7 @@ static const pwm_conf_t pwm_config[] = {
}
};
#define PWM_NUMOF (sizeof(pwm_config) / sizeof(pwm_config[0]))
#define PWM_NUMOF ARRAY_SIZE(pwm_config)
/** @} */
/**
@ -171,7 +171,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)
/** @} */
/**
@ -195,7 +195,7 @@ static const i2c_conf_t i2c_config[] = {
#define I2C_0_ISR isr_i2c1_ev
#define I2C_NUMOF (sizeof(i2c_config) / sizeof(i2c_config[0]))
#define I2C_NUMOF ARRAY_SIZE(i2c_config)
/** @} */
/**
@ -224,7 +224,7 @@ static const dac_conf_t dac_config[] = {
{ .pin = GPIO_PIN(PORT_A, 5), .chan = 1 }
};
#define DAC_NUMOF (sizeof(dac_config) / sizeof(dac_config[0]))
#define DAC_NUMOF ARRAY_SIZE(dac_config)
/** @} */

View File

@ -83,7 +83,7 @@ static const timer_conf_t timer_config[] = {
#define TIMER_0_ISR isr_tim2
#define TIMER_1_ISR isr_tim3
#define TIMER_NUMOF (sizeof(timer_config) / sizeof(timer_config[0]))
#define TIMER_NUMOF ARRAY_SIZE(timer_config)
/** @} */
/**
@ -121,7 +121,7 @@ static const uart_conf_t uart_config[] = {
#define UART_1_ISR isr_usart1
#define UART_2_ISR isr_usart3
#define UART_NUMOF (sizeof(uart_config) / sizeof(uart_config[0]))
#define UART_NUMOF ARRAY_SIZE(uart_config)
/** @} */
#ifdef __cplusplus

View File

@ -63,7 +63,7 @@ static const timer_conf_t timer_config[] = {
},
};
#define TIMER_NUMOF (sizeof(timer_config) / sizeof(timer_config[0]))
#define TIMER_NUMOF ARRAY_SIZE(timer_config)
#define TIMER_IRQ_PRIO 1
/** @} */
@ -83,7 +83,7 @@ static const adc_conf_t adc_config[] = {
};
#define ADC_NUMOF (sizeof(adc_config) / sizeof(adc_config[0]))
#define ADC_NUMOF ARRAY_SIZE(adc_config)
/** @} */
/**
@ -104,7 +104,7 @@ static const uart_conf_t uart_config[] = {
#define UART_0_ISR isr_uart0
/* macros common across all UARTs */
#define UART_NUMOF (sizeof(uart_config) / sizeof(uart_config[0]))
#define UART_NUMOF ARRAY_SIZE(uart_config)
/** @} */
/**
@ -121,7 +121,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)
/** @} */
/**
@ -138,7 +138,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)
/** @} */
/**

View File

@ -61,7 +61,7 @@ static const timer_conf_t timer_config[] = {
},
};
#define TIMER_NUMOF (sizeof(timer_config) / sizeof(timer_config[0]))
#define TIMER_NUMOF ARRAY_SIZE(timer_config)
#define TIMER_IRQ_PRIO 1
/** @} */
@ -79,7 +79,7 @@ static const adc_conf_t adc_config[] = {
GPIO_PIN(0, 6), /**< GPIO_PA6 = ON_SLEEP_PIN */
};
#define ADC_NUMOF (sizeof(adc_config) / sizeof(adc_config[0]))
#define ADC_NUMOF ARRAY_SIZE(adc_config)
/** @} */
/**
@ -100,7 +100,7 @@ static const uart_conf_t uart_config[] = {
#define UART_0_ISR isr_uart0
/* macros common across all UARTs */
#define UART_NUMOF (sizeof(uart_config) / sizeof(uart_config[0]))
#define UART_NUMOF ARRAY_SIZE(uart_config)
/** @} */
/**
@ -117,7 +117,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)
/** @} */
/**
@ -134,7 +134,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)
/** @} */
/**

View File

@ -53,7 +53,7 @@ static const uart_conf_t uart_config[] = {
#define UART_0_ISR (isr_uart0)
#define UART_1_ISR (isr_uarte1)
#define UART_NUMOF (sizeof(uart_config) / sizeof(uart_config[0]))
#define UART_NUMOF ARRAY_SIZE(uart_config)
/** @} */
#ifdef __cplusplus

View File

@ -53,7 +53,7 @@ static const uart_conf_t uart_config[] = {
#define UART_0_ISR (isr_uart0)
#define UART_1_ISR (isr_uarte1)
#define UART_NUMOF (sizeof(uart_config) / sizeof(uart_config[0]))
#define UART_NUMOF ARRAY_SIZE(uart_config)
/** @} */
#ifdef __cplusplus
}

View File

@ -44,7 +44,7 @@ static const uart_conf_t uart_config[] = {
#define UART_0_ISR (isr_uart0)
#define UART_NUMOF (sizeof(uart_config) / sizeof(uart_config[0]))
#define UART_NUMOF ARRAY_SIZE(uart_config)
/** @} */
#ifdef __cplusplus

View File

@ -127,7 +127,7 @@ static const uart_conf_t uart_config[] = {
#define UART_0_ISR (isr_uart2_rx_tx)
#define UART_1_ISR (isr_uart0_rx_tx)
#define UART_NUMOF (sizeof(uart_config) / sizeof(uart_config[0]))
#define UART_NUMOF ARRAY_SIZE(uart_config)
/** @} */
/**
@ -143,7 +143,7 @@ static const adc_conf_t adc_config[] = {
[ 5] = { .dev = ADC0, .pin = GPIO_PIN(PORT_E, 1), .chan = 11, .avg = ADC_AVG_MAX }
};
#define ADC_NUMOF (sizeof(adc_config) / sizeof(adc_config[0]))
#define ADC_NUMOF ARRAY_SIZE(adc_config)
/*
* KW2xD ADC reference settings:
* 0: VREFH/VREFL external pin pair
@ -170,7 +170,7 @@ static const pwm_conf_t pwm_config[] = {
}
};
#define PWM_NUMOF (sizeof(pwm_config) / sizeof(pwm_config[0]))
#define PWM_NUMOF ARRAY_SIZE(pwm_config)
/** @} */
@ -250,7 +250,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)
/** @} */
@ -270,7 +270,7 @@ static const i2c_conf_t i2c_config[] = {
.sda_pcr = (PORT_PCR_MUX(6) | PORT_PCR_ODE_MASK),
},
};
#define I2C_NUMOF (sizeof(i2c_config) / sizeof(i2c_config[0]))
#define I2C_NUMOF ARRAY_SIZE(i2c_config)
#define I2C_0_ISR (isr_i2c1)
/** @} */

View File

@ -51,7 +51,7 @@ static const spi_conf_t spi_config[] = {
.simmask = SIM_SCGC6_SPI1_MASK
}
};
#define SPI_NUMOF (sizeof(spi_config) / sizeof(spi_config[0]))
#define SPI_NUMOF ARRAY_SIZE(spi_config)
/** @} */
/**
@ -71,7 +71,7 @@ static const adc_conf_t adc_config[] = {
/* internal: DCDC divided battery level */
[ 2] = { .dev = ADC0, .pin = GPIO_UNDEF, .chan = 23, .avg = ADC_AVG_MAX },
};
#define ADC_NUMOF (sizeof(adc_config) / sizeof(adc_config[0]))
#define ADC_NUMOF ARRAY_SIZE(adc_config)
/*
* KW41Z ADC reference settings:
* 0: VREFH external pin or VREF_OUT 1.2 V signal (if VREF module is enabled)

View File

@ -74,7 +74,7 @@ static const timer_conf_t timer_config[] = {
#define TIMER_0_ISR isr_tim5
#define TIMER_NUMOF (sizeof(timer_config) / sizeof(timer_config[0]))
#define TIMER_NUMOF ARRAY_SIZE(timer_config)
/** @} */
/**
@ -100,7 +100,7 @@ static const uart_conf_t uart_config[] = {
#define UART_0_ISR (isr_usart1)
#define UART_NUMOF (sizeof(uart_config) / sizeof(uart_config[0]))
#define UART_NUMOF ARRAY_SIZE(uart_config)
/** @} */
/**
@ -146,7 +146,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)
/** @} */
/**
@ -170,7 +170,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)
/** @} */
#ifdef __cplusplus

View File

@ -47,7 +47,7 @@ static const uart_conf_t uart_config[] = {
#define UART_0_ISR (isr_uart0)
#define UART_NUMOF (sizeof(uart_config) / sizeof(uart_config[0]))
#define UART_NUMOF ARRAY_SIZE(uart_config)
/** @} */
/**
@ -63,7 +63,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

Some files were not shown because too many files have changed in this diff Show More