aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--robot/errcatch.c4
-rw-r--r--robot/hypervisor.c6
-rw-r--r--robot/io.c2
-rw-r--r--robot/modes.c3
4 files changed, 7 insertions, 8 deletions
diff --git a/robot/errcatch.c b/robot/errcatch.c
index fc6a1e8..6a3452c 100644
--- a/robot/errcatch.c
+++ b/robot/errcatch.c
@@ -1,5 +1,5 @@
-#include <string.h>
#include <stdio.h>
+#include <string.h>
#include "../shared/errcatch.h"
#include "modes.h"
@@ -44,6 +44,8 @@ void w2_errcatch_handle_error(w2_s_error *error) {
break;
case W2_E_WARN_MODE_HISTORY_BUFFER_IOB:
break;
+ case W2_E_WARN_PING_TIMEOUT:
+ break;
default: {
g_w2_error_uncaught = true;
#ifdef W2_SIM
diff --git a/robot/hypervisor.c b/robot/hypervisor.c
index 580ff55..471b2ac 100644
--- a/robot/hypervisor.c
+++ b/robot/hypervisor.c
@@ -14,7 +14,7 @@ unsigned long g_w2_hypervisor_ema_io_qs = 0;
unsigned long g_w2_hypervisor_ema_mode_qs = 0;
uint64_t g_w2_hypervisor_timers[W2_HYPERVISOR_TIMER_COUNT] = {0};
-uint64_t g_w2_hypervisor_qs_timer_offset = 0;
+uint64_t g_w2_hypervisor_qs_timer_offset = 0;
unsigned int g_w2_ping_ms = 0;
uint8_t g_w2_ping_id = 0;
@@ -66,9 +66,7 @@ uint64_t w2_get_qs() {
return ticks_to_microseconds(get_ticks()) - g_w2_hypervisor_qs_timer_offset;
}
-uint64_t w2_get_ms() {
- return w2_get_qs() / 1e3;
-}
+uint64_t w2_get_ms() { return w2_get_qs() / 1e3; }
void w2_time_reset() { g_w2_hypervisor_qs_timer_offset = ticks_to_microseconds(get_ticks()); }
diff --git a/robot/io.c b/robot/io.c
index 91a62b2..560b66f 100644
--- a/robot/io.c
+++ b/robot/io.c
@@ -7,8 +7,6 @@
bool g_w2_io_object_detected = false;
-#include <stdio.h>
-
void w2_io_object_detection() {
unsigned int front_distance = analog_read(W2_SIDE_SENSOR_PIN);
diff --git a/robot/modes.c b/robot/modes.c
index d706c2f..ea65e2d 100644
--- a/robot/modes.c
+++ b/robot/modes.c
@@ -30,7 +30,8 @@ void w2_modes_init() {
void w2_modes_main() { (*g_w2_modes[g_w2_mode_history[g_w2_mode_history_index]])(); }
void w2_modes_switch(w2_e_mode new_mode, bool replace) {
- int16_t next_history_index = g_w2_mode_history_index + (new_mode == W2_M_PREV ? -1 : 1) * !replace;
+ int16_t next_history_index =
+ g_w2_mode_history_index + (new_mode == W2_M_PREV ? -1 : 1) * !replace;
if (next_history_index == -1 || next_history_index == W2_MODE_HISTORY_BUFFER_SIZE - 1) {
next_history_index = W2_RANGE(0, next_history_index, W2_MODE_HISTORY_BUFFER_SIZE);
w2_errcatch_throw(W2_E_WARN_MODE_HISTORY_BUFFER_IOB);