aboutsummaryrefslogtreecommitdiff
path: root/robot/errcatch.c
diff options
context:
space:
mode:
authorlonkaars <loek@pipeframe.xyz>2022-06-26 15:54:43 +0200
committerlonkaars <loek@pipeframe.xyz>2022-06-26 15:54:43 +0200
commit6c3d73d260a4254013e48b7f992c8c4fd87f5689 (patch)
treefa508a868e931d91eae06c140a8db64ca795953d /robot/errcatch.c
parentc47518a99d8c8a49a8a97100bdff5b06cfa125ae (diff)
fix object detection
Diffstat (limited to 'robot/errcatch.c')
-rw-r--r--robot/errcatch.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/robot/errcatch.c b/robot/errcatch.c
index 3830d54..ed4de51 100644
--- a/robot/errcatch.c
+++ b/robot/errcatch.c
@@ -5,17 +5,29 @@
#include "orangutan_shim.h"
#include "sercomm.h"
+// #include <stdio.h>
+// unsigned int g_w2_err_index = 0;
+// unsigned int g_w2_err_disp[4] = {0};
+
void w2_errcatch_handle_error(w2_s_error *error) {
uint8_t severity = error->code & W2_E_TYPE_MASK;
+// clear();
+// g_w2_err_disp[g_w2_err_index++] = error->code;
+// char disp[32];
+// sprintf(disp, "%02x %02x", g_w2_err_disp[0], g_w2_err_disp[1]);
+// print(disp);
+// lcd_goto_xy(0, 1);
+// sprintf(disp, "%02x %02x", g_w2_err_disp[2], g_w2_err_disp[3]);
+// print(disp);
+
// trigger emergency mode for critical errors
if ((severity ^ W2_E_TYPE_CRIT) == 0) w2_modes_call(W2_M_HALT);
// TODO: handle more error types
switch (error->code) {
- case W2_E_WARN_UNCAUGHT_ERROR: {
+ case W2_E_WARN_UNCAUGHT_ERROR:
break;
- }
case W2_E_WARN_OBSTACLE_DETECTED:
break;
case W2_E_CRIT_OBSTACLE_STUCK: