emscripten fixes

This commit is contained in:
joeycastillo 2024-10-06 17:13:24 -04:00
parent 7b05aac4b6
commit 3f51d18c4a
2 changed files with 8 additions and 1 deletions

View File

@ -26,7 +26,6 @@
#include <stdint.h>
#include <stdbool.h>
#include "tusb.h"
/** @brief Initializes the USB preipheral, and assigns the USB pins to their
* relevant functions. In the process, this function also sets up the

8
main.c
View File

@ -8,6 +8,10 @@
#include "system.h"
#include "delay.h"
#if __EMSCRIPTEN__
void resume_main_loop(void);
#endif
int main(void) {
// set up system clocks
sys_init();
@ -24,6 +28,9 @@ int main(void) {
// allow application to do its initial setup
app_setup();
#if __EMSCRIPTEN__
resume_main_loop();
#else
while (1) {
bool can_sleep = app_loop();
@ -31,6 +38,7 @@ int main(void) {
_enter_standby_mode();
}
}
#endif
return 0;
}