uvm32/apps/sketch/sketch.c
Toby Jaffey e07eeab043 Make yield a regular syscall taking an argument.
Allows "wait for interrupt"/"wait for event" type operation where VM code blocks until the host has something for it.
2025-12-10 10:35:18 +00:00

31 lines
385 B
C

#include "uvm32_target.h"
// provide main, with setup()/loop() flow
void setup(void);
bool loop(void);
uint32_t count;
bool loop(void) {
printdec(count);
println("");
if (count++ >= 10) {
return false;
} else {
return true;
}
}
void setup(void) {
count = 0;
}
void main(void) {
setup();
while(loop()) {
yield(0);
}
}