aboutsummaryrefslogtreecommitdiff
path: root/shared/consts.h
diff options
context:
space:
mode:
Diffstat (limited to 'shared/consts.h')
-rw-r--r--shared/consts.h31
1 files changed, 21 insertions, 10 deletions
diff --git a/shared/consts.h b/shared/consts.h
index cd6dff1..9c2358f 100644
--- a/shared/consts.h
+++ b/shared/consts.h
@@ -4,7 +4,7 @@
#ifndef W2_BUILD_STR
// is defined by CFLAGS += -DW2_BUILD_STR in makefile
-#define W2_BUILD_STR ("????????")
+#define W2_BUILD_STR "????????"
#endif
#if !defined W2_HOST_WIN32 && !defined W2_HOST_LINUX
@@ -13,27 +13,38 @@
#endif
/** serial baud rate (bit/s) */
-#define W2_SERIAL_BAUD (9600)
+#define W2_SERIAL_BAUD 9600
/** size of input (receive) buffer (in bytes) */
-#define W2_SERIAL_READ_BUFFER_SIZE (255)
+#define W2_SERIAL_READ_BUFFER_SIZE 255
/** size of the error handling buffer (in errors, not bytes) */
-#define W2_ERROR_BUFFER_SIZE (16)
+#define W2_ERROR_BUFFER_SIZE 16
/** size of the serial communication buffer (in messages, not bytes) */
-#define W2_SERCOMM_BUFFER_SIZE (16)
+#define W2_SERCOMM_BUFFER_SIZE 16
/** size of mode history buffer */
-#define W2_MODE_HISTORY_BUFFER_SIZE (8)
+#define W2_MODE_HISTORY_BUFFER_SIZE 8
/** max logic module execution time in milliseconds */
-#define W2_MAX_MODULE_CYCLE_MS (20)
+#define W2_MAX_MODULE_CYCLE_MS 20
/** exponential moving average new measurement weight (double 0-1) */
-#define W2_EMA_WEIGHT (0.10)
+#define W2_EMA_WEIGHT 0.10
/** minimal time between pings */
-#define W2_PING_FREQUENCY (1e3)
+#define W2_PING_FREQUENCY 1e3
/** max time between ping and answer */
-#define W2_PING_TIMEOUT (5e3)
+#define W2_PING_TIMEOUT 5e3
+
+/** default map width/height */
+#define W2_MAP_DEFAULT_HEIGHT 5
+#define W2_MAP_DEFAULT_WIDTH 5
+
+/** distance too close schmitt trigger low threshold */
+#define W2_IO_DISTANCE_CLOSE_THRESHOLD 400
+/** distance too close schmitt trigger high threshold */
+#define W2_IO_DISTANCE_FAR_THRESHOLD 100
+/** go into emergency mode if object still present after n ms */
+#define W2_IO_DISTANCE_TOO_CLOSE_TIMEOUT 5e3
/** front-facing distance sensor pinout */
#define W2_FRONT_SENSOR_PIN 5