aboutsummaryrefslogtreecommitdiff
path: root/robot/hypervisor.c
diff options
context:
space:
mode:
authorlonkaars <loek@pipeframe.xyz>2022-05-09 17:17:53 +0200
committerlonkaars <loek@pipeframe.xyz>2022-05-09 17:17:53 +0200
commit32237bc52d1dd69d60dda75ddc29bb31ce165c83 (patch)
treeaff899e8b09f7a1b66e06eb4769548ca12169557 /robot/hypervisor.c
parentbe84308e01ecc9e8de2997ab030420b401e06596 (diff)
implement setup and hypervisor
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);
}