Skip to content
Snippets Groups Projects
Commit ceaec9bc authored by rahix's avatar rahix
Browse files

feat(l0dables): Return to menu when main() exits


After main() returns, don't enter a busy loop but call epic_exit() to
signal to epicardium that the l0dable has finished.  The exit code will
be the return value from main().

Signed-off-by: default avatarRahix <rahix@rahix.de>
parent 9a70773d
No related branches found
No related tags found
1 merge request!447A few improvements of the l0dable runtime
......@@ -24,6 +24,9 @@ void fade()
/*
* main() is called when l0dable is loaded and executed.
*
* When main() returns, card10 goes back to the menu. A non-zero return value
* can be used to signal some kind of failure during l0dable execution.
*/
int main(void)
{
......
......@@ -157,12 +157,9 @@ Reset_Handler:
ldr r0, =main
blx r0
/*
* C code done, spin forever.
* TODO(q3k): let epicardium know we're done.
*/
.spin:
bl .spin
/* C code done, return to menu. Return code is what main() returned. */
ldr r4, =epic_exit
blx r4
/*
* Used by __libc_init_array.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment