From 32237bc52d1dd69d60dda75ddc29bb31ce165c83 Mon Sep 17 00:00:00 2001 From: lonkaars Date: Mon, 9 May 2022 17:17:53 +0200 Subject: implement setup and hypervisor --- robot/hypervisor.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'robot/hypervisor.c') 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 + +#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); } -- cgit v1.2.3