Skip to content

Commit ce8b0f4

Browse files
facchinmsoburi
authored andcommitted
core: implement weak loop hook
Co-authored-by: Martino Facchin <m.facchin@arduino.cc> Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
1 parent dd24f6f commit ce8b0f4

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

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)