aboutsummaryrefslogtreecommitdiff
path: root/robot/hypervisor.h
diff options
context:
space:
mode:
Diffstat (limited to 'robot/hypervisor.h')
-rw-r--r--robot/hypervisor.h15
1 files changed, 13 insertions, 2 deletions
diff --git a/robot/hypervisor.h b/robot/hypervisor.h
index 4b1ed9b..fe9dbea 100644
--- a/robot/hypervisor.h
+++ b/robot/hypervisor.h
@@ -7,9 +7,10 @@
#include "../shared/bool.h"
/** amount of parallel timers */
-#define W2_HYPERVISOR_TIMER_COUNT (1)
+#define W2_HYPERVISOR_TIMER_COUNT 2
-#define W2_TIMER_PING (0)
+#define W2_TIMER_PING 0
+#define W2_TIMER_OBJECT_DETECTION 1
extern uint64_t g_w2_hypervisor_cycles;
extern uint64_t g_w2_hypervisor_uptime_ms;
@@ -32,7 +33,17 @@ extern bool g_w2_connected;
*/
void w2_hypervisor_main();
+/**
+ * pololu's `get_ms()` estimates run time by only adding the CPU time taken up
+ * by pololu library functions. this function uses the `get_ticks()` function
+ * to calculate elapsed milliseconds, and should therefore be more accurate.
+ */
+uint64_t w2_get_ms();
+/** reset time returned by `w2_get_ms()` */
+void w2_time_reset();
+
/** start timer with label `label` */
void w2_hypervisor_time_start(uint8_t label);
/** stop timer with label `label` */
uint64_t w2_hypervisor_time_end(uint8_t label);
+