STAR
Cal STAR — firmware, DAQ server, and engine design
Loading...
Searching...
No Matches
hotfire_config.h
Go to the documentation of this file.
1#pragma once
2
3//-----------------------------------------------------------------------------
4// Shared hotfire config — used by actuator_config.h and sense_config.h
5// All hotfire boards (actuator, PT, TC, LC, RTD) share these.
6//-----------------------------------------------------------------------------
7
8// Heartbeat and loop
9#define BOARD_HEARTBEAT_INTERVAL_MS \
10 1000 // Send board heartbeat once per second
11#define LOOP_DELAY_MS 10 // Delay at end of each loop()
12
13// USB serial: brief pause so the host monitor can attach before boot logs
14// (ESP32 CDC)
15#define SERIAL_MONITOR_READY_DELAY_MS 500
16
17// Ethernet init delays (milliseconds)
18#define ETHERNET_SPI_DELAY_MS 1000 // Delay after SPI.begin() for Ethernet
19#define ETHERNET_INIT_DELAY_MS 1000 // Delay after Ethernet.init()
20#define ETHERNET_BEGIN_DELAY_MS 1000 // Delay after Ethernet.begin()
21
22// DHCP (opt-in per board via -DSENSOR_ETH_USE_DHCP). The ground station
23// assigns the address from its MAC -> IP reservation table; these timeouts are
24// kept short so a stand network with no DHCP server does not stall boot.
25#ifndef SENSOR_ETH_DHCP_TIMEOUT_MS
26#define SENSOR_ETH_DHCP_TIMEOUT_MS 5000 // max total wait for a DHCP lease
27#endif
28#ifndef SENSOR_ETH_DHCP_RESPONSE_TIMEOUT_MS
29#define SENSOR_ETH_DHCP_RESPONSE_TIMEOUT_MS 2000 // per-request response wait
30#endif
31// On the recovery address (no DHCP answer at boot) the board asks again this
32// often, for this long each time. See common/board_net.h.
33#ifndef SENSOR_ETH_DHCP_RETRY_INTERVAL_MS
34#define SENSOR_ETH_DHCP_RETRY_INTERVAL_MS 15000
35#endif
36#ifndef SENSOR_ETH_DHCP_RETRY_TIMEOUT_MS
37#define SENSOR_ETH_DHCP_RETRY_TIMEOUT_MS 3000
38#endif
39
40// Server discovery. While no server has been heard the board broadcasts
41// BOARD_HEARTBEAT, and it learns the server's address from the server's own
42// packets. The board never picks its own IP -- see common/board_net.h.
43// Server silence before discovery broadcasts resume (our address is
44// unaffected; it belongs to the server, not to us).
45#define SENSOR_ZEROCONF_SERVER_SILENCE_MS 10000
46
47// LED status blink (optional; actuator uses, sense boards may use)
48#define LED_CYCLE_MS 5000 // Cycle period for state-blink
49#define LED_BLINK_ON_MS 100
50#define LED_BLINK_OFF_MS 100
51
52// Board identity
53#ifndef BOARD_ID
54#define BOARD_ID 21
55#endif
56
57// Safety Configuration
58#ifndef ENABLE_ALL_STATE_TRANSITIONS
59#define ENABLE_ALL_STATE_TRANSITIONS false
60#endif
61
62// Server (all hotfire boards send heartbeats/data here; hardcoded, not updated
63// from packets)
64#define HOTFIRE_SERVER_IP_OCTET_4 20 // 192.168.2.20
65#define HOTFIRE_SERVER_PORT 5006
66
67// Sensor data: chunks per packet (all sense boards: PT, TC, LC, RTD)
68#define HOTFIRE_CHUNKS_PER_PACKET 9
69
70// OTA: TCP port all hotfire boards listen on for firmware updates
71#define HOTFIRE_OTA_PORT 3232