Skip to content

Commit 7b01324

Browse files
facchinmpillo79
authored andcommitted
core: implement weak loop hook
1 parent 36cf198 commit 7b01324

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

cores/arduino/main.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ void start_static_threads();
1919
void __attribute__((weak)) initVariant(void) {
2020
}
2121

22+
// This function can be overwriten by one library.
23+
void __attribute__((weak)) __loopHook(void) {
24+
}
25+
2226
int main(void) {
2327
#if (DT_NODE_HAS_PROP(DT_PATH(zephyr_user), cdc_acm) && \
2428
(CONFIG_USB_CDC_ACM || CONFIG_USBD_CDC_ACM_CLASS))
@@ -39,6 +43,7 @@ int main(void) {
3943
// DT_NODE_HAS_PROP(DT_PATH(zephyr_user), serials)
4044
if (arduino::serialEventRun) arduino::serialEventRun();
4145
#endif
46+
__loopHook();
4247
}
4348

4449
return 0;

0 commit comments

Comments
 (0)