summaryrefslogtreecommitdiff
path: root/shared/consts.h
blob: 70ab5b272801a0065dd12b1287f915177fc57b04 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#pragma once

#ifndef W2_BUILD_STR
// is defined by CFLAGS += -DW2_BUILD_STR in makefile
#define W2_BUILD_STR ("????????")
#endif

#if !defined W2_HOST_WIN32 && !defined W2_HOST_LINUX
#define W2_HOST_UNKNOWN
#warning "host operating system unknown"
#endif

/** max logic module execution time in milliseconds */
#define W2_MAX_MODULE_CYCLE_MS (20)
/** serial baud rate (bit/s) */
#define W2_SERIAL_BAUD (9600)
/** size of the error handling buffer (in errors, not bytes) */
#define W2_ERROR_BUFFER_SIZE (16)
/** size of the serial communication buffer (in messages, not bytes) */
#define W2_SERCOMM_BUFFER_SIZE (16)
/** size of input (receive) buffer (in bytes) */
#define W2_SERIAL_READ_BUFFER_SIZE (255)
/** exponential moving average new measurement weight (double 0-1) */
#define W2_EMA_WEIGHT (0.10)
/** size of mode history buffer */
#define W2_MODE_HISTORY_BUFFER_SIZE (4)

/** front-facing distance sensor pinout */
#define W2_FRONT_SENSOR_PIN 5
/** battery voltage sensor pinout */
#define W2_BATTERY_PIN 6
/** side-facing distance sensor pinout */
#define W2_SIDE_SENSOR_PIN 7