v1: Live ADS-B radar with detail panel, units, legend, proximity LED alert
This commit is contained in:
70
src/config.h
Normal file
70
src/config.h
Normal file
@@ -0,0 +1,70 @@
|
||||
#pragma once
|
||||
#include <Arduino.h>
|
||||
|
||||
namespace Config {
|
||||
constexpr const char* IP_GEO_HOST = "ip-api.com";
|
||||
constexpr const char* IP_GEO_PATH = "/json/?fields=status,lat,lon";
|
||||
|
||||
// Kein GPS-Modul am CYD angeschlossen - Platzhalter, falls spaeter eins
|
||||
// per Erweiterungspins nachgeruestet wird.
|
||||
struct GpsPinPair { uint8_t rx; uint8_t tx; const char* label; };
|
||||
constexpr GpsPinPair GPS_PIN_CANDIDATES[] = {
|
||||
{22, 27, "G22/G27"}
|
||||
};
|
||||
constexpr uint8_t GPS_PIN_CANDIDATE_COUNT = 1;
|
||||
constexpr uint32_t GPS_BAUD = 9600;
|
||||
|
||||
constexpr float RANGE_STEPS_KM[] = {10.0f, 25.0f, 50.0f, 100.0f};
|
||||
constexpr uint8_t RANGE_STEP_COUNT = 4;
|
||||
constexpr uint8_t DEFAULT_RANGE_INDEX = 1;
|
||||
|
||||
constexpr const char* ADSB_API_HOST = "opendata.adsb.fi";
|
||||
constexpr uint16_t ADSB_API_PORT = 443;
|
||||
constexpr uint32_t FETCH_INTERVAL_MS = 8000;
|
||||
constexpr uint32_t HTTP_TIMEOUT_MS = 6000;
|
||||
|
||||
constexpr float DEFAULT_PROXIMITY_ALERT_KM = 8.0f;
|
||||
|
||||
// Radius, innerhalb dessen die rueckseitige RGB-LED (gruen) blinkt, um auf
|
||||
// ein nahes Flugzeug hinzuweisen (Ersatz fuer den fehlenden Lautsprecher
|
||||
// beim CYD).
|
||||
constexpr float LED_ALERT_RADIUS_KM = 3.0f;
|
||||
constexpr uint32_t ALERT_RETRIGGER_COOLDOWN_MS = 30000;
|
||||
|
||||
constexpr uint8_t MAX_TRACKED_AIRCRAFT = 40;
|
||||
|
||||
// Eigener Ordner, getrennt vom Cardputer-Projekt (das nutzt /adsb_radar) -
|
||||
// so kann dieselbe SD-Karte in beiden Geraeten verwendet werden.
|
||||
constexpr const char* SD_ROOT_DIR = "/Flightradar_cyd";
|
||||
constexpr const char* SD_AIRLINES_CSV = "/Flightradar_cyd/airlines.csv";
|
||||
constexpr const char* SD_AIRCRAFT_TYPES_CSV = "/Flightradar_cyd/aircraft_types.csv";
|
||||
constexpr const char* SD_LOG_DIR = "/Flightradar_cyd/logs";
|
||||
constexpr const char* SD_SETTINGS_FILE = "/Flightradar_cyd/config.txt";
|
||||
constexpr const char* SD_WIFI_CREDENTIALS_FILE = "/Flightradar_cyd/wifi.txt";
|
||||
constexpr const char* SD_CALIBRATION_FILE = "/Flightradar_cyd/calibration.txt";
|
||||
|
||||
// microSD-Slot beim CYD (ESP32-2432S028): eigener SPI-Bus, Standard-VSPI-Pins.
|
||||
constexpr uint8_t SD_SPI_CS_PIN = 5;
|
||||
constexpr uint8_t SD_SPI_MOSI_PIN = 23;
|
||||
constexpr uint8_t SD_SPI_MISO_PIN = 19;
|
||||
constexpr uint8_t SD_SPI_CLK_PIN = 18;
|
||||
|
||||
// Touch-Controller (XPT2046), eigener SPI-Bus, getrennt von Display und SD.
|
||||
constexpr uint8_t TOUCH_CLK_PIN = 25;
|
||||
constexpr uint8_t TOUCH_CS_PIN = 33;
|
||||
constexpr uint8_t TOUCH_MOSI_PIN = 32;
|
||||
constexpr uint8_t TOUCH_MISO_PIN = 39;
|
||||
constexpr uint8_t TOUCH_IRQ_PIN = 36;
|
||||
|
||||
constexpr int16_t SCREEN_WIDTH = 240;
|
||||
constexpr int16_t SCREEN_HEIGHT = 320;
|
||||
|
||||
// Fuer spaetere Naeherungs-Alarme (Phase 4: Bildschirmrand blinkt statt LED)
|
||||
constexpr float ZONE_BLUE_KM = 25.0f;
|
||||
constexpr float ZONE_YELLOW_KM = 10.0f;
|
||||
constexpr float ZONE_AMBER_KM = 5.0f;
|
||||
constexpr float ZONE_VISUAL_KM = 2.0f;
|
||||
|
||||
constexpr uint16_t COLOR_LOW_ALT_THRESHOLD_FT = 10000;
|
||||
constexpr uint16_t COLOR_MID_ALT_THRESHOLD_FT = 30000;
|
||||
}
|
||||
Reference in New Issue
Block a user