Skip to content

Commit 7e45997

Browse files
committed
drivers: add kernel_defines.h for ARRAY_SIZE
Fix compilation errors on native boards caused by missing ARRAY_SIZE macro definition. The macro is defined in container.h which is included by kernel_defines.h. On ARM/Cortex-M platforms, kernel_defines.h is indirectly included via cpu/cortexm_common/include/irq_arch.h, making ARRAY_SIZE available. On native platform, no CPU header includes kernel_defines.h, requiring explicit inclusion. Error: "implicit declaration of function 'ARRAY_SIZE'" Signed-off-by: Gilles DOFFE <[email protected]>
1 parent 9e928e4 commit 7e45997

File tree

4 files changed

+4
-0
lines changed

4 files changed

+4
-0
lines changed

drivers/bmx280/include/bmx280_params.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424

2525
#include "board.h"
2626
#include "bmx280.h"
27+
#include "kernel_defines.h"
2728
#include "saul_reg.h"
2829

2930
#ifdef __cplusplus

drivers/saul/init_devs/auto_init_bmx055.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
* @}
1919
*/
2020

21+
#include "kernel_defines.h"
2122
#include "log.h"
2223
#include "saul_reg.h"
2324
#include "bmx055.h"

drivers/sht2x/include/sht2x_params.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
* @author Steffen Robertz <[email protected]>
2323
*/
2424

25+
#include "kernel_defines.h"
2526
#include "sht2x.h"
2627
#include "saul_reg.h"
2728

tests/drivers/si1133/main.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
#include <stdio.h>
2222
#include <inttypes.h>
2323

24+
#include "kernel_defines.h"
2425
#include "si1133.h"
2526
#include "si1133_params.h"
2627
#include "board.h"

0 commit comments

Comments
 (0)