aboutsummaryrefslogtreecommitdiff
path: root/robot/hypervisor.c
diff options
context:
space:
mode:
Diffstat (limited to 'robot/hypervisor.c')
-rw-r--r--robot/hypervisor.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/robot/hypervisor.c b/robot/hypervisor.c
index db0700d..381d9af 100644
--- a/robot/hypervisor.c
+++ b/robot/hypervisor.c
@@ -1,5 +1,8 @@
-#include "hypervisor.h"
+#include <pololu/orangutan.h>
+
+#include "consts.h"
#include "errcatch.h"
+#include "hypervisor.h"
#include "io.h"
#include "modes.h"
#include "sercomm.h"
@@ -9,8 +12,8 @@ void w2_hypervisor_main() {
w2_errcatch_main();
w2_io_main();
- // start timer
+ time_reset();
w2_modes_main();
- // stop timer
- // throw error if cycle expired
+ unsigned long elapsed_ms = get_ms();
+ if (elapsed_ms > W2_MAX_MODULE_CYCLE_MS) w2_errcatch_throw(W2_ERR_CYCLE_EXPIRED);
}