aboutsummaryrefslogtreecommitdiff
path: root/robot/hypervisor.c
blob: 381d9af3d942728fb87ca78c7af3c10c25045ef3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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);
}