Skip to content

Commit c90c84c

Browse files
committed
Disabled Core callback feature
STM32Ethernet do not use anymore this feature. Disabled it to avoid unuseful call in the main while{}. Define CORE_CALLBACK allow to enable it. Signed-off-by: Frederic.Pillon <[email protected]>
1 parent bd2c825 commit c90c84c

File tree

3 files changed

+16
-14
lines changed

3 files changed

+16
-14
lines changed

Diff for: cores/arduino/main.cpp

+12-10
Original file line numberDiff line numberDiff line change
@@ -37,20 +37,22 @@ void initVariant() { }
3737
*/
3838
int main( void )
3939
{
40-
initVariant();
40+
initVariant();
4141

4242
#if defined(USBCON)
43-
usbd_interface_init();
43+
usbd_interface_init();
4444
#endif
4545

46-
setup();
46+
setup();
4747

48-
for (;;)
49-
{
50-
CoreCallback();
51-
loop();
52-
if (serialEventRun) serialEventRun();
53-
}
48+
for (;;)
49+
{
50+
#if defined(CORE_CALLBACK)
51+
CoreCallback();
52+
#endif
53+
loop();
54+
if (serialEventRun) serialEventRun();
55+
}
5456

55-
return 0;
57+
return 0;
5658
}

Diff for: cores/arduino/stm32/core_callback.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
* list. Otherwise, your function should be called inside the loop() function of
4444
* the sketch.
4545
*/
46-
46+
#if defined(CORE_CALLBACK)
4747
#ifdef __cplusplus
4848
extern "C" {
4949
#endif
@@ -107,5 +107,5 @@ void CoreCallback(void)
107107
#ifdef __cplusplus
108108
}
109109
#endif
110-
110+
#endif // CORE_CALLBACK
111111
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/

Diff for: cores/arduino/stm32/core_callback.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
/* Define to prevent recursive inclusion -------------------------------------*/
3939
#ifndef __CALLBACK_H
4040
#define __CALLBACK_H
41-
41+
#if defined(CORE_CALLBACK)
4242
#include "variant.h"
4343

4444
#ifdef __cplusplus
@@ -61,7 +61,7 @@ void CoreCallback(void);
6161
#ifdef __cplusplus
6262
}
6363
#endif
64-
64+
#endif // CORE_CALLBACK
6565
#endif /* __CALLBACK_H */
6666

6767
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/

0 commit comments

Comments
 (0)