aboutsummaryrefslogtreecommitdiff
path: root/robot/errcatch.c
diff options
context:
space:
mode:
authorlonkaars <loek@pipeframe.xyz>2022-05-26 14:05:53 +0200
committerlonkaars <loek@pipeframe.xyz>2022-05-26 14:05:53 +0200
commitd70f4f44f927281d6c9bfff64264bd754d682dc8 (patch)
treeff0ed034fba83a8f4d3c00cd0b7e1e6d78d75082 /robot/errcatch.c
parentf7387fd6af14a740f474620555de379bc9ba69db (diff)
implement mode command
Diffstat (limited to 'robot/errcatch.c')
-rw-r--r--robot/errcatch.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/robot/errcatch.c b/robot/errcatch.c
index 99f1063..cf06f5d 100644
--- a/robot/errcatch.c
+++ b/robot/errcatch.c
@@ -2,7 +2,6 @@
#include <string.h>
#include "errcatch.h"
-#include "halt.h"
#include "modes.h"
#include "orangutan_shim.h"
#include "sercomm.h"
@@ -52,7 +51,7 @@ void w2_errcatch_handle_error(w2_s_error *error) {
uint8_t severity = error->code & W2_E_TYPE_MASK;
// trigger emergency mode for critical errors
- if ((severity ^ W2_E_TYPE_CRIT) == 0) g_w2_current_mode = &w2_mode_halt;
+ if ((severity ^ W2_E_TYPE_CRIT) == 0) w2_modes_switch(W2_M_HALT);
// TODO: handle more error types
switch (error->code) {