aboutsummaryrefslogtreecommitdiff
path: root/robot/hypervisor.c
diff options
context:
space:
mode:
Diffstat (limited to 'robot/hypervisor.c')
-rw-r--r--robot/hypervisor.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/robot/hypervisor.c b/robot/hypervisor.c
index 1fd3ac2..2a6120b 100644
--- a/robot/hypervisor.c
+++ b/robot/hypervisor.c
@@ -1,6 +1,6 @@
#include "hypervisor.h"
+#include "../shared/errcatch.h"
#include "../shared/util.h"
-#include "errcatch.h"
#include "io.h"
#include "modes.h"
#include "orangutan_shim.h"
@@ -14,6 +14,12 @@ unsigned long g_w2_hypervisor_ema_io_ms = 0;
unsigned long g_w2_hypervisor_ema_mode_ms = 0;
uint64_t g_w2_hypervisor_timers[W2_HYPERVISOR_TIMER_COUNT] = {0};
+unsigned int g_w2_ping_ms = 0;
+uint8_t g_w2_ping_id = 0;
+bool g_w2_ping_received = true;
+bool g_w2_ping_timeout = false;
+bool g_w2_connected = false;
+
void w2_hypervisor_main() {
#ifdef W2_SIM
w2_sim_cycle_begin();
@@ -27,7 +33,7 @@ void w2_hypervisor_main() {
unsigned long sercomm_time = get_ms();
w2_errcatch_main();
unsigned long errcatch_time = get_ms() - sercomm_time;
- w2_io_main();
+ // w2_io_main();
unsigned long io_time = get_ms() - errcatch_time;
w2_modes_main();
unsigned long mode_time = get_ms() - io_time;
@@ -44,10 +50,9 @@ void w2_hypervisor_main() {
#ifdef W2_SIM
if (DBG_ENABLE_CYCLEINFO) siminfo("cycle end\n");
- if (!g_w2_sim_headless) usleep(100e3);
+ if (DBG_CYCLE_DELAY > 0) usleep(DBG_CYCLE_DELAY);
- if (g_w2_sim_headless && DBG_MAX_CYCLES > -1 && g_w2_hypervisor_cycles > DBG_MAX_CYCLES)
- exit(0);
+ if (DBG_MAX_CYCLES > -1 && g_w2_hypervisor_cycles > DBG_MAX_CYCLES) exit(0);
#endif
g_w2_hypervisor_cycles++;