aboutsummaryrefslogtreecommitdiff
path: root/robot/errcatch.h
diff options
context:
space:
mode:
authorlonkaars <loek@pipeframe.xyz>2022-05-17 22:37:09 +0200
committerlonkaars <loek@pipeframe.xyz>2022-05-17 22:37:09 +0200
commit154df68cb2a74a3b22456e8ec5af3af54352a41f (patch)
treef9d2c83b30322d81691ae1a013813add6ec6b99e /robot/errcatch.h
parent2b75425070662b869c15673623df44e30ce43ebe (diff)
fix buffer overflow in error handling module
- fixed ring buffer overflow in errcatch module - fixed naming of commands in sercomm module - added comments to macro's in consts.h - properly handle `W2_E_WARN_UNCAUGHT_ERROR` and `W2_E_WARN_ERR_BUFFER_FULL` (these used to cause infinite loops) - added buffer full warning code - added options to hide some simulation messages - more boilerplate sercomm module code
Diffstat (limited to 'robot/errcatch.h')
-rw-r--r--robot/errcatch.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/robot/errcatch.h b/robot/errcatch.h
index ec4b90f..9f737d8 100644
--- a/robot/errcatch.h
+++ b/robot/errcatch.h
@@ -29,6 +29,7 @@ enum w2_e_errorcodes {
W2_E_WARN_OBSTACLE_DETECTED = 0x01 | W2_E_TYPE_WARN,
W2_E_WARN_CYCLE_EXPIRED = 0x02 | W2_E_TYPE_WARN,
W2_E_WARN_UNCAUGHT_ERROR = 0x03 | W2_E_TYPE_WARN,
+ W2_E_WARN_ERR_BUFFER_FULL = 0x04 | W2_E_TYPE_WARN,
};
/**
@@ -44,7 +45,7 @@ typedef struct {
} w2_s_error;
/** error ring buffer */
-extern w2_s_error *g_w2_error_buffer[W2_E_BUFFER_SIZE];
+extern w2_s_error *g_w2_error_buffer[W2_ERROR_BUFFER_SIZE];
/** stores head of ring buffer */
extern uint8_t g_w2_error_index;
/** stores start of ring buffer */