diff --git a/cores/arduino/main.cpp b/cores/arduino/main.cpp index a51524d7cb..13e90f608c 100644 --- a/cores/arduino/main.cpp +++ b/cores/arduino/main.cpp @@ -37,20 +37,22 @@ void initVariant() { } */ int main( void ) { - initVariant(); + initVariant(); #if defined(USBCON) - usbd_interface_init(); + usbd_interface_init(); #endif - setup(); + setup(); - for (;;) - { - CoreCallback(); - loop(); - if (serialEventRun) serialEventRun(); - } + for (;;) + { +#if defined(CORE_CALLBACK) + CoreCallback(); +#endif + loop(); + if (serialEventRun) serialEventRun(); + } - return 0; + return 0; } diff --git a/cores/arduino/stm32/core_callback.c b/cores/arduino/stm32/core_callback.c index a53e9bb195..3ef23bfe3a 100644 --- a/cores/arduino/stm32/core_callback.c +++ b/cores/arduino/stm32/core_callback.c @@ -43,7 +43,7 @@ * list. Otherwise, your function should be called inside the loop() function of * the sketch. */ - +#if defined(CORE_CALLBACK) #ifdef __cplusplus extern "C" { #endif @@ -107,5 +107,5 @@ void CoreCallback(void) #ifdef __cplusplus } #endif - +#endif // CORE_CALLBACK /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/cores/arduino/stm32/core_callback.h b/cores/arduino/stm32/core_callback.h index 02f2acfa98..d5e978e389 100644 --- a/cores/arduino/stm32/core_callback.h +++ b/cores/arduino/stm32/core_callback.h @@ -38,7 +38,7 @@ /* Define to prevent recursive inclusion -------------------------------------*/ #ifndef __CALLBACK_H #define __CALLBACK_H - +#if defined(CORE_CALLBACK) #include "variant.h" #ifdef __cplusplus @@ -61,7 +61,7 @@ void CoreCallback(void); #ifdef __cplusplus } #endif - +#endif // CORE_CALLBACK #endif /* __CALLBACK_H */ /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/