mirror of
https://github.com/ringtailsoftware/uvm32.git
synced 2026-06-06 06:53:39 +00:00
Allows "wait for interrupt"/"wait for event" type operation where VM code blocks until the host has something for it.
31 lines
385 B
C
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);
|
|
}
|
|
}
|
|
|