While addressing some comments from @lebrush for #7588 I noticed an issue.
In fact, we use a common struct in order to init peripheral driver within periph_conf.h file
NUMOF are defined using sizeof(struct) / sizeof(element). This line is fine but only process by compiler. So we cannot use #if NUMOF.
The problem is : if the board does not define this peripheral (e.g NUMOF = 0) AND the driver uses mutexes (mutex_t locks[NUMOF]) this line will failed to compile which is not the desired behaviour. We want the driver to be disabled.
(see sam0 i2c driver or stm32_common spi driver).
Maybe someone has an idea to solve this ? :)
While addressing some comments from @lebrush for #7588 I noticed an issue.
In fact, we use a common struct in order to init peripheral driver within
periph_conf.hfileNUMOF are defined using
sizeof(struct) / sizeof(element). This line is fine but only process by compiler. So we cannot use#if NUMOF.The problem is : if the board does not define this peripheral (e.g NUMOF = 0) AND the driver uses mutexes (
mutex_t locks[NUMOF]) this line will failed to compile which is not the desired behaviour. We want the driver to be disabled.(see sam0 i2c driver or stm32_common spi driver).
Maybe someone has an idea to solve this ? :)