This is an automated email from the ASF dual-hosted git repository.
kasjer pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-core.git
The following commit(s) were added to refs/heads/master by this push:
new c779bc088 nvic: Fix build for c++
c779bc088 is described below
commit c779bc088da1d8b8fc14992372afab3021b74b18
Author: Jerzy Kasenberg <[email protected]>
AuthorDate: Thu Jul 9 22:54:14 2026 +0200
nvic: Fix build for c++
mynewt_nvic.h did not have usual extern "C"
block for C++ build.
iterator change from int to size_t to prevent
warning about sign/unsigned mismatch
Signed-off-by: Jerzy Kasenberg <[email protected]>
---
hw/cmsis-core/include/mynewt_nvic.h | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/hw/cmsis-core/include/mynewt_nvic.h
b/hw/cmsis-core/include/mynewt_nvic.h
index ba8373a04..89caccb7c 100644
--- a/hw/cmsis-core/include/mynewt_nvic.h
+++ b/hw/cmsis-core/include/mynewt_nvic.h
@@ -22,9 +22,14 @@
#include <stdbool.h>
#include <stdint.h>
+#include <stddef.h>
#include <mcu/cmsis_nvic.h>
#include <os/util.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
void NVIC_Relocate(void);
void NVIC_SetVector(IRQn_Type IRQn, uint32_t vector);
uint32_t NVIC_GetVector(IRQn_Type IRQn);
@@ -34,7 +39,7 @@ void NVIC_ConfigVector(IRQn_Type IRQn, void (*vector)(void),
uint8_t priority,
static inline void
NVIC_DisableAll(void)
{
- int i;
+ size_t i;
for (i = 0; i < ARRAY_SIZE(NVIC->ICER); ++i) {
NVIC->ICER[i] = 0xffffffff;
@@ -42,4 +47,8 @@ NVIC_DisableAll(void)
}
}
+#ifdef __cplusplus
+}
+#endif
+
#endif