You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The code generated by XOD assumes setup and loop will be used as program entry points. This is the case with most Arduino-compatible boards but does not cover all cases. For example, a user might have a board running FreeRTOS and define main himself. See https://github.com/adafruit/Adafruit_nRF52_Arduino/blob/master/cores/nRF5/main.cpp as an example.
For such cases, it would be handy to have a single-function entry point generated. So that I can trivially call it from my own main or make it a FreeRTOS task.
User story
I run:
xodc transpile my-proj-qux.xodball main --entry-point my_qux_main
And the resulting code, along with the traditional setup and loop contains quite trivial:
// ... the usual code ...externvoidyield();
voidmy_qux_main(void*) {
setup();
while (true) {
loop();
yield();
}
}
Acceptance criteria
The --entry-point argument is taken into account as shown
The value is validated to be a valid C++ identifier. If not, a clear error is shown and xodc exits with non-zero code
Multiple entry points can be be used together without conflicts
Out of scope
Providing own yield. It’s up to a user to guarantee its presence. E.g., use the mentioned Adafruit core
Providing own main. It’s up to a user to guarantee its presence.
The text was updated successfully, but these errors were encountered:
Rationale
The code generated by XOD assumes
setup
andloop
will be used as program entry points. This is the case with most Arduino-compatible boards but does not cover all cases. For example, a user might have a board running FreeRTOS and definemain
himself. See https://github.com/adafruit/Adafruit_nRF52_Arduino/blob/master/cores/nRF5/main.cpp as an example.For such cases, it would be handy to have a single-function entry point generated. So that I can trivially call it from my own
main
or make it a FreeRTOS task.User story
I run:
And the resulting code, along with the traditional
setup
andloop
contains quite trivial:Acceptance criteria
--entry-point
argument is taken into account as shownxodc
exits with non-zero codeOut of scope
yield
. It’s up to a user to guarantee its presence. E.g., use the mentioned Adafruit coremain
. It’s up to a user to guarantee its presence.The text was updated successfully, but these errors were encountered: