STAR
Cal STAR — firmware, DAQ server, and engine design
Loading...
Searching...
No Matches
main.cpp File Reference
#include <Arduino.h>
#include <Ethernet.h>
#include <EthernetUdp.h>
#include <SPI.h>
#include <STAR_EthernetOTA.h>
#include <daq-protocol.h>
#include <esp_mac.h>
#include <cstring>
#include "firmware_hash.h"
#include "hotfire_config.h"
#include "stacklight_pins.h"
Include dependency graph for main.cpp:

Go to the source code of this file.

Macros

#define MAX_PACKET_SIZE   512
#define SENSOR_UDP_LISTEN_PORT   5005

Functions

static void applyStacklightOutputs (uint8_t red, uint8_t yellow, uint8_t green, uint8_t buzzer)
static void initOutputs ()
static void sendBoardHeartbeat ()
void setup ()
void loop ()

Variables

static uint8_t board_id = BOARD_ID
static byte mac [6]
static IPAddress staticIP (192, 168, 2, BOARD_ID)
static IPAddress gateway (0, 0, 0, 0)
static IPAddress subnet (255, 255, 255, 0)
static IPAddress dns (192, 168, 2, 1)
static IPAddress serverIP (192, 168, 2, HOTFIRE_SERVER_IP_OCTET_4)
static EthernetUDP udp
static StarOTA::Server otaServer (HOTFIRE_OTA_PORT)
static unsigned long lastHeartbeatMillis = 0
static unsigned long last_server_heartbeat_ms = 0
static daq::EngineState last_engine_state = daq::EngineState::SAFE

Macro Definition Documentation

◆ MAX_PACKET_SIZE

#define MAX_PACKET_SIZE   512

Definition at line 24 of file main.cpp.

◆ SENSOR_UDP_LISTEN_PORT

#define SENSOR_UDP_LISTEN_PORT   5005

Definition at line 28 of file main.cpp.

Function Documentation

◆ applyStacklightOutputs()

void applyStacklightOutputs ( uint8_t red,
uint8_t yellow,
uint8_t green,
uint8_t buzzer )
static

◆ initOutputs()

◆ loop()

◆ sendBoardHeartbeat()

void sendBoardHeartbeat ( )
static

◆ setup()

Variable Documentation

◆ board_id

uint8_t board_id = BOARD_ID
static

Definition at line 31 of file main.cpp.

◆ dns

IPAddress dns(192, 168, 2, 1) ( 192 ,
168 ,
2 ,
1  )
static

◆ gateway

IPAddress gateway(0, 0, 0, 0) ( 0 ,
0 ,
0 ,
0  )
static

◆ last_engine_state

daq::EngineState last_engine_state = daq::EngineState::SAFE
static

Definition at line 42 of file main.cpp.

Referenced by loop(), and sendBoardHeartbeat().

◆ last_server_heartbeat_ms

unsigned long last_server_heartbeat_ms = 0
static

Definition at line 41 of file main.cpp.

◆ lastHeartbeatMillis

unsigned long lastHeartbeatMillis = 0
static

Definition at line 40 of file main.cpp.

◆ mac

byte mac[6]
static

Definition at line 32 of file main.cpp.

◆ otaServer

◆ serverIP

IPAddress serverIP(192, 168, 2, HOTFIRE_SERVER_IP_OCTET_4) ( 192 ,
168 ,
2 ,
HOTFIRE_SERVER_IP_OCTET_4  )
static

◆ staticIP

IPAddress staticIP(192, 168, 2, BOARD_ID) ( 192 ,
168 ,
2 ,
BOARD_ID  )
static

◆ subnet

IPAddress subnet(255, 255, 255, 0) ( 255 ,
255 ,
255 ,
0  )
static

◆ udp

EthernetUDP udp
static

Definition at line 38 of file main.cpp.