summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlonkaars <loek@pipeframe.xyz>2022-05-18 09:02:55 +0200
committerlonkaars <loek@pipeframe.xyz>2022-05-18 09:02:55 +0200
commit837acf351ae96e2392efde175a61fd33e0774961 (patch)
tree3a22e087ee41add6fe5d1e0901f4d60084067bd8
parent154df68cb2a74a3b22456e8ec5af3af54352a41f (diff)
added comments to error code enum
-rw-r--r--robot/errcatch.h29
1 files changed, 19 insertions, 10 deletions
diff --git a/robot/errcatch.h b/robot/errcatch.h
index 9f737d8..c6edcfb 100644
--- a/robot/errcatch.h
+++ b/robot/errcatch.h
@@ -18,18 +18,27 @@
* reserved for error type checking
*/
enum w2_e_errorcodes {
- // critical error codes
- W2_E_CRIT_CONN_LOST = 0x00 | W2_E_TYPE_CRIT,
- W2_E_CRIT_COM_UNAVAILABLE = 0x01 | W2_E_TYPE_CRIT, // client-only
- W2_E_CRIT_LINE_LOST = 0x02 | W2_E_TYPE_CRIT,
- W2_E_CRIT_OBSTACLE_STUCK = 0x03 | W2_E_TYPE_CRIT,
+ /** wireless connection lost from either robot or client-side */
+ W2_E_CRIT_CONN_LOST = 0x00 | W2_E_TYPE_CRIT,
+ /** serial COM-port unavalable. client-side only */
+ W2_E_CRIT_COM_UNAVAILABLE = 0x01 | W2_E_TYPE_CRIT,
+ /** line unable to be found automatically */
+ W2_E_CRIT_LINE_LOST = 0x02 | W2_E_TYPE_CRIT,
+ /** obstacle unavoidable, robot stuck */
+ W2_E_CRIT_OBSTACLE_STUCK = 0x03 | W2_E_TYPE_CRIT,
- // warnings
- W2_E_WARN_BATTERY_LOW = 0x00 | W2_E_TYPE_WARN,
+ /** battery low, returning to charging station */
+ W2_E_WARN_BATTERY_LOW = 0x00 | W2_E_TYPE_WARN,
+ /** obstacle detected, waiting then trying other route */
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,
+ /** logic cycle took longer than `W2_MAX_MODULE_CYCLE_MS` */
+ W2_E_WARN_CYCLE_EXPIRED = 0x02 | W2_E_TYPE_WARN,
+ /** error thrown without handler, gets thrown on next cycle */
+ W2_E_WARN_UNCAUGHT_ERROR = 0x03 | W2_E_TYPE_WARN,
+ /** error buffer full, gets thrown on next cycle */
+ W2_E_WARN_ERR_BUFFER_FULL = 0x04 | W2_E_TYPE_WARN,
+ /** line lost, trying to calibrate */
+ W2_E_WARN_LINE_LOST = 0x05 | W2_E_TYPE_WARN,
};
/**