summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhathach <thach@tinyusb.org>2018-07-10 01:06:57 +0700
committerhathach <thach@tinyusb.org>2018-07-10 01:06:57 +0700
commitf199e87085789e6c641ab88cdab8a1c327f2a5bb (patch)
treebef21e512c6e6898210ab5b08e48620a9c682de8
parentc5089d7274fe3518cc2bd41874120d33c8fc7079 (diff)
add ARRAY_SIZE
which is missing when building with debug mode
-rw-r--r--ports/nrf/nrfx_glue.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/ports/nrf/nrfx_glue.h b/ports/nrf/nrfx_glue.h
index 267eada4f..345de3870 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