From f199e87085789e6c641ab88cdab8a1c327f2a5bb Mon Sep 17 00:00:00 2001 From: hathach Date: Tue, 10 Jul 2018 01:06:57 +0700 Subject: [PATCH] add ARRAY_SIZE which is missing when building with debug mode --- ports/nrf/nrfx_glue.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ports/nrf/nrfx_glue.h b/ports/nrf/nrfx_glue.h index 267eada4f1..345de38704 100644 --- a/ports/nrf/nrfx_glue.h +++ b/ports/nrf/nrfx_glue.h @@ -80,6 +80,11 @@ void __assert_func(const char *file, int line, const char *func, const char *exp */ #define NRFX_STATIC_ASSERT(expression) + +#ifndef ARRAY_SIZE +#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0])) +#endif + //------------------------------------------------------------------------------ #ifdef SOFTDEVICE_PRESENT