aboutsummaryrefslogtreecommitdiff
path: root/robot/hypervisor.c
diff options
context:
space:
mode:
Diffstat (limited to 'robot/hypervisor.c')
-rw-r--r--robot/hypervisor.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/robot/hypervisor.c b/robot/hypervisor.c
new file mode 100644
index 0000000..381d9af
--- /dev/null
+++ b/robot/hypervisor.c
@@ -0,0 +1,19 @@
+#include <pololu/orangutan.h>
+
+#include "consts.h"
+#include "errcatch.h"
+#include "hypervisor.h"
+#include "io.h"
+#include "modes.h"
+#include "sercomm.h"
+
+void w2_hypervisor_main() {
+ w2_sercomm_main();
+ w2_errcatch_main();
+ w2_io_main();
+
+ time_reset();
+ w2_modes_main();
+ unsigned long elapsed_ms = get_ms();
+ if (elapsed_ms > W2_MAX_MODULE_CYCLE_MS) w2_errcatch_throw(W2_ERR_CYCLE_EXPIRED);
+}