128 lines
5.8 KiB
C++
128 lines
5.8 KiB
C++
#pragma once
|
|
#include <Arduino.h>
|
|
|
|
namespace Config {
|
|
// Updated by Karl on every version release (see
|
|
// CLAUDE.md workflow "Standard Workflow: Push & Release") - shown
|
|
// in the info screen (Menu > System > Info) and must match the
|
|
// corresponding Git tag.
|
|
constexpr const char* APP_VERSION = "3.6.3";
|
|
|
|
// Display brightness (Menu > System > Brightness), in percent.
|
|
// MIN intentionally not 0 - a completely dark display could otherwise
|
|
// look like a defect rather than a setting.
|
|
constexpr uint8_t BRIGHTNESS_MIN_PERCENT = 10;
|
|
constexpr uint8_t BRIGHTNESS_MAX_PERCENT = 100;
|
|
constexpr uint8_t BRIGHTNESS_STEP_PERCENT = 10;
|
|
|
|
// Screen timeout (Menu > System > Screen Timeout), in minutes,
|
|
// adjustable via slider (see timeout_screen.cpp) - followed by
|
|
// "Never" (no timeout) as a separate end position. Previously only
|
|
// clickable 0-10 by repeated tapping (0 = Never), which needed e.g. ten
|
|
// individual taps for 10 minutes.
|
|
constexpr uint8_t SCREEN_TIMEOUT_MIN_MINUTES = 1;
|
|
constexpr uint8_t SCREEN_TIMEOUT_MAX_MINUTES = 15;
|
|
|
|
// Night mode (10pm-6am) dims relative to the currently set normal
|
|
// brightness, not to a fixed absolute value - otherwise the
|
|
// dimming effect would be useless at low normal brightness
|
|
// or would even make the display brighter at night than during the day.
|
|
constexpr uint8_t NIGHT_DIM_REDUCTION_PERCENT = 40;
|
|
|
|
constexpr const char* IP_GEO_HOST = "ip-api.com";
|
|
constexpr const char* IP_GEO_PATH = "/json/?fields=status,lat,lon,offset,countryCode";
|
|
|
|
// Address search (AddressSearchScreen) - free, no-registration
|
|
// geocoding service (OpenStreetMap Nominatim). Their usage policies
|
|
// require a meaningful User-Agent instead of the HTTPClient
|
|
// default, see https://operations.osmfoundation.org/policies/nominatim/.
|
|
constexpr const char* NOMINATIM_HOST = "nominatim.openstreetmap.org";
|
|
constexpr const char* NOMINATIM_USER_AGENT = "EiswolfsFlightradarCYD (git.rasmusbendtsen.dk/rasmus/flyradar)";
|
|
|
|
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;
|
|
|
|
// Eco mode: reduces the ADS-B fetch frequency to this interval
|
|
// (instead of FETCH_INTERVAL_MS), when the screen is turned off by
|
|
// inactivity timeout (see main.cpp).
|
|
constexpr uint32_t ECO_FETCH_INTERVAL_MS = 60000;
|
|
|
|
constexpr uint8_t ALT_FILTER_COUNT = 3;
|
|
constexpr uint8_t DEFAULT_ALT_FILTER_INDEX = 0;
|
|
|
|
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;
|
|
|
|
// Weather icon in the header (see weather.cpp) - queried much less
|
|
// frequently than ADS-B data, weather does not change
|
|
// every minute and the free Open-Meteo API should not be needlessly
|
|
// stressed.
|
|
constexpr uint32_t WEATHER_FETCH_INTERVAL_MS = 600000; // 10 minutes
|
|
|
|
constexpr float DEFAULT_PROXIMITY_ALERT_KM = 8.0f;
|
|
|
|
constexpr float LED_ALERT_RADIUS_KM = 3.0f;
|
|
constexpr uint32_t ALERT_RETRIGGER_COOLDOWN_MS = 30000;
|
|
|
|
constexpr uint8_t MAX_TRACKED_AIRCRAFT = 40;
|
|
|
|
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_AIRPORTS_CSV = "/Flightradar_cyd/airports.csv";
|
|
constexpr const char* SD_LOG_DIR = "/Flightradar_cyd/logs";
|
|
constexpr const char* SD_SCREENSHOT_DIR = "/Flightradar_cyd/screenshots";
|
|
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";
|
|
constexpr const char* SD_DETAIL_CACHE_DIR = "/Flightradar_cyd/cache";
|
|
|
|
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;
|
|
|
|
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;
|
|
|
|
// Display rotation: 0 = normal (USB connector at bottom), 2 = 180 degrees
|
|
// rotated (USB at top) - for mounting with charging port on top.
|
|
constexpr uint8_t DISPLAY_ROTATION = 2;
|
|
|
|
constexpr int16_t SCREEN_WIDTH = 240;
|
|
constexpr int16_t SCREEN_HEIGHT = 320;
|
|
|
|
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;
|
|
|
|
constexpr const char* EMERGENCY_SQUAWKS[] = {"7500", "7600", "7700"};
|
|
constexpr uint8_t EMERGENCY_SQUAWK_COUNT = 3;
|
|
|
|
constexpr uint8_t MAX_WIFI_NETWORKS = 3;
|
|
|
|
// Gitea OTA update (Menu > System > "Check for update") - checks
|
|
// the latest release in a private Gitea repository and downloads
|
|
// firmware.bin from there. Uses the external proxy URL since the
|
|
// ESP32 reaches Gitea via https://git.rasmusbendtsen.dk (Pangolin).
|
|
constexpr const char* GITEA_API_HOST = "git.rasmusbendtsen.dk";
|
|
constexpr const char* GITEA_API_PATH = "/api/v1/repos/rasmus/flyradar/releases/latest";
|
|
constexpr const char* GITEA_API_TOKEN = ""; // set this!
|
|
} |