summaryrefslogtreecommitdiff
path: root/shared
diff options
context:
space:
mode:
authorlonkaars <loek@pipeframe.xyz>2022-06-02 17:22:48 +0200
committerlonkaars <loek@pipeframe.xyz>2022-06-02 17:22:48 +0200
commit14779cb187dac9ed4a0b6e7645e76e78587ad024 (patch)
treeae523d0216d0d9dce7155296bbe915a6f8f22c22 /shared
parent052be3db6fbb855be63e95291a270ba707796739 (diff)
ping working
Diffstat (limited to 'shared')
-rw-r--r--shared/consts.h5
-rw-r--r--shared/errcatch.h2
2 files changed, 7 insertions, 0 deletions
diff --git a/shared/consts.h b/shared/consts.h
index cdd96b3..3f792b4 100644
--- a/shared/consts.h
+++ b/shared/consts.h
@@ -30,6 +30,11 @@
/** exponential moving average new measurement weight (double 0-1) */
#define W2_EMA_WEIGHT (0.10)
+/** minimal time between pings */
+#define W2_PING_FREQUENCY (1e3)
+/** max time between ping and answer */
+#define W2_PING_TIMEOUT (5e3)
+
/** front-facing distance sensor pinout */
#define W2_FRONT_SENSOR_PIN 5
/** battery voltage sensor pinout */
diff --git a/shared/errcatch.h b/shared/errcatch.h
index 7f298c1..a56bc00 100644
--- a/shared/errcatch.h
+++ b/shared/errcatch.h
@@ -52,6 +52,8 @@ typedef enum {
W2_E_WARN_SERIAL_NOISY = 0x09 | W2_E_TYPE_WARN,
/** mode history index out of bounds */
W2_E_WARN_MODE_HISTORY_BUFFER_IOB = 0x0a | W2_E_TYPE_WARN,
+ /** ping timeout reached */
+ W2_E_WARN_PING_TIMEOUT = 0x0b | W2_E_TYPE_WARN,
} w2_e_errorcode;
/**