summaryrefslogtreecommitdiff
path: root/robot/hypervisor.c
diff options
context:
space:
mode:
authorlonkaars <loek@pipeframe.xyz>2022-05-25 16:30:21 +0200
committerlonkaars <loek@pipeframe.xyz>2022-05-25 16:30:21 +0200
commit9cd83d662849fe72c83038a018107d9bbf5c2398 (patch)
treeaeae2f79b63f09eebbb72e56bee0facbad34fb1d /robot/hypervisor.c
parent4f0718caefa7f7a1baf02997fec0b448d0d6615a (diff)
WIP serial parsing
Diffstat (limited to 'robot/hypervisor.c')
-rw-r--r--robot/hypervisor.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/robot/hypervisor.c b/robot/hypervisor.c
index 4d46a12..0f754a3 100644
--- a/robot/hypervisor.c
+++ b/robot/hypervisor.c
@@ -5,6 +5,8 @@
#include "orangutan_shim.h"
#include "sercomm.h"
+uint64_t g_w2_hypervisor_cycles = 0;
+
void w2_hypervisor_main() {
#ifdef W2_SIM
w2_sim_cycle_begin();
@@ -26,6 +28,10 @@ void w2_hypervisor_main() {
#ifdef W2_SIM
if (DBG_ENABLE_CYCLEINFO) siminfo("cycle end\n");
- usleep(100e3);
+ if (!g_w2_sim_headless) usleep(100e3);
+
+ if (g_w2_sim_headless && DBG_MAX_CYCLES > -1 && g_w2_hypervisor_cycles > DBG_MAX_CYCLES) exit(0);
#endif
+
+ g_w2_hypervisor_cycles++;
}