From d80ed37040af55e7d3364d089911c11fd9e3f2c4 Mon Sep 17 00:00:00 2001 From: rusefillc Date: Fri, 5 Feb 2021 23:56:22 -0500 Subject: [PATCH] reducing code duplication --- firmware/config/boards/hellen/cypress/chconf.h | 8 -------- firmware/config/boards/kinetis/chconf.h | 7 ------- firmware/config/chconf_common.h | 7 +++++++ firmware/config/stm32f4ems/chconf.h | 9 --------- firmware/config/stm32f7ems/chconf.h | 9 --------- 5 files changed, 7 insertions(+), 33 deletions(-) diff --git a/firmware/config/boards/hellen/cypress/chconf.h b/firmware/config/boards/hellen/cypress/chconf.h index 6962c70ea2..d4c83a8b44 100644 --- a/firmware/config/boards/hellen/cypress/chconf.h +++ b/firmware/config/boards/hellen/cypress/chconf.h @@ -740,14 +740,6 @@ /* Port-specific settings (override port settings defaulted in chcore.h). */ /*===========================================================================*/ -#ifndef __ASSEMBLER__ - -#ifdef __cplusplus -extern "C" -#endif -void chDbgPanic3(const char *msg, const char * file, int line); -#endif - #undef ENABLE_PERF_TRACE #define ENABLE_PERF_TRACE FALSE #define TRACE_BUFFER_LENGTH 1 diff --git a/firmware/config/boards/kinetis/chconf.h b/firmware/config/boards/kinetis/chconf.h index 4b13ce9496..beb7dd8fba 100644 --- a/firmware/config/boards/kinetis/chconf.h +++ b/firmware/config/boards/kinetis/chconf.h @@ -741,13 +741,6 @@ /* Port-specific settings (override port settings defaulted in chcore.h). */ /*===========================================================================*/ -#ifndef __ASSEMBLER__ - #ifdef __cplusplus - extern "C" - #endif // __cplusplus - void chDbgPanic3(const char *msg, const char * file, int line); -#endif // __ASSEMBLER__ - #undef ENABLE_PERF_TRACE #define ENABLE_PERF_TRACE FALSE #define TRACE_BUFFER_LENGTH 1 diff --git a/firmware/config/chconf_common.h b/firmware/config/chconf_common.h index dfae9198f0..45bc82f9fb 100644 --- a/firmware/config/chconf_common.h +++ b/firmware/config/chconf_common.h @@ -132,4 +132,11 @@ extern "C" { } \ } while (false) +#ifndef __ASSEMBLER__ + #ifdef __cplusplus + extern "C" + #endif // __cplusplus + void chDbgPanic3(const char *msg, const char * file, int line); +#endif // __ASSEMBLER__ + #endif /* CONFIG_CHCONF_COMMON_H_ */ diff --git a/firmware/config/stm32f4ems/chconf.h b/firmware/config/stm32f4ems/chconf.h index 80e8e2ef34..ecdf2293d3 100644 --- a/firmware/config/stm32f4ems/chconf.h +++ b/firmware/config/stm32f4ems/chconf.h @@ -750,15 +750,6 @@ /* Port-specific settings (override port settings defaulted in chcore.h). */ /*===========================================================================*/ -#ifndef __ASSEMBLER__ - -#ifdef __cplusplus -extern "C" -#endif -void chDbgPanic3(const char *msg, const char * file, int line); -#endif - - #endif /* CHCONF_H */ /** @} */ diff --git a/firmware/config/stm32f7ems/chconf.h b/firmware/config/stm32f7ems/chconf.h index 2d1ea1b603..dfe7360ac6 100644 --- a/firmware/config/stm32f7ems/chconf.h +++ b/firmware/config/stm32f7ems/chconf.h @@ -752,15 +752,6 @@ #define CORTEX_VTOR_INIT 0x00200000U -#ifndef __ASSEMBLER__ - -#ifdef __cplusplus -extern "C" -#endif -void chDbgPanic3(const char *msg, const char * file, int line); -#endif - - #endif /* CHCONF_H */ /** @} */