Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/ci-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ jobs:
set -o pipefail
FQBN="esp32:esp32:esp32s3:UploadSpeed=921600,CDCOnBoot=default,FlashSize=16M,PartitionScheme=noota_ffat,USBMode=default"

arduino-cli core list
arduino-cli compile \
--fqbn "$FQBN" \
--warnings all \
Expand Down
2 changes: 1 addition & 1 deletion Config.h
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@
#endif

// WiFi Debug Ring Buffer
#define WIFI_DEBUG_USE_RINGBUFFER 1 // Should be use a ring buffer for WiFi Debug messages? helps when using WiFi DCS Mode. If WiFi is not used, this value is ignored anyway. Also, if using CDC + WiFi Debug, this is REQUIRED to avoid CDC stalls
#define WIFI_DEBUG_USE_RINGBUFFER 0 // Should be use a ring buffer for WiFi Debug messages? helps when using WiFi DCS Mode. If WiFi is not used, this value is ignored anyway. Also, if using CDC + WiFi Debug, this is REQUIRED to avoid CDC stalls
#if WIFI_DEBUG_USE_RINGBUFFER
#define WIFI_DBG_SEND_RINGBUF_SIZE 32 // How many slots in our buffer
#define WIFI_DBG_MSG_MAXLEN 64 // Max size for each slot
Expand Down
2 changes: 1 addition & 1 deletion HID Manager/settings.ini
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
vid = 0xCAFE

[DCS]
udp_source_ip = 192.168.7.77
udp_source_ip = 192.168.7.166

[MAIN]
console = 1
Expand Down
2 changes: 1 addition & 1 deletion label_creator/creator_prefs.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"last_template": "LABEL_SET_MAIN",
"last_aircraft": "FA-18C_hornet",
"last_label_set": "LABEL_SET_IFEI"
"last_label_set": "LABEL_SET_WINGFOLD_TEST"
}
2 changes: 1 addition & 1 deletion src/LABELS/LABEL_SET_IFEI/.last_run
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2026-03-18T14:06:43.397880
2026-03-20T00:53:04.409085
1 change: 1 addition & 0 deletions src/LABELS/LABEL_SET_WINGFOLD_TEST/.last_run
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2026-03-19T17:52:21.450107
58 changes: 58 additions & 0 deletions src/LABELS/LABEL_SET_WINGFOLD_TEST/CT_Display.cpp.DISABLED
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
#include "../../Globals.h"
#include "CT_Display.h"
#include "DisplayMapping.h"


DisplayBufferEntry CT_DisplayBuffers[] = {
};
const size_t numCTDisplayBuffers = sizeof(CT_DisplayBuffers)/sizeof(CT_DisplayBuffers[0]);

const DisplayBufferHashEntry CT_DisplayBufferHash[2] = {
{nullptr, nullptr},
{nullptr, nullptr},
};

const DisplayBufferEntry* findDisplayBufferByLabel(const char* label) {
uint16_t startH = labelHash(label) % 2;
for (uint16_t i = 0; i < 2; ++i) {
uint16_t idx = (startH + i >= 2) ? (startH + i - 2) : (startH + i);
const auto& entry = CT_DisplayBufferHash[idx];
if (!entry.label) return nullptr;
if (strcmp(entry.label, label) == 0) return entry.entry;
}
return nullptr;
}


void renderField(const char* label, const char* strValue,
const DisplayFieldDefLabel* defOverride,
FieldState* stateOverride) {
const DisplayFieldDefLabel* def = defOverride ? defOverride : findFieldDefByLabel(label);
if (!def) return;
if (!def->renderFunc) { debugPrintf("[DISPLAY] No renderFunc for label '%s', skipping\n", def->label); return; }

FieldState* state = stateOverride;
if (!state) {
int idx = def - fieldDefs;
state = &fieldStates[idx];
}

bool valid = true;
if (def->type == FIELD_NUMERIC) {
const int value = strToIntFast(strValue);
valid = (value >= def->minValue && value <= def->maxValue);
}
const char* toShow = valid ? strValue : state->lastValue;

// bound compare/copy by field length, clamp to cache size
uint8_t need = def->numDigits ? def->numDigits : 1;
if (need > sizeof(state->lastValue)) need = sizeof(state->lastValue);

if (memcmp(toShow, state->lastValue, need) == 0) return;

memcpy(state->lastValue, toShow, need);
if (def->clearFunc) def->clearFunc(def->driver, def->segMap, *def);
def->renderFunc(def->driver, def->segMap, toShow, *def);
}


23 changes: 23 additions & 0 deletions src/LABELS/LABEL_SET_WINGFOLD_TEST/CT_Display.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// Auto-generated — DO NOT EDIT
#pragma once

#include "../../../lib/CUtils/src/CUtils.h"

// Buffers and dirty flags for all display fields (global)

extern DisplayBufferEntry CT_DisplayBuffers[];
extern const size_t numCTDisplayBuffers;
extern const DisplayBufferHashEntry CT_DisplayBufferHash[];
const DisplayBufferEntry* findDisplayBufferByLabel(const char* label);


// --- Forward declarations for opaque driver pointer types ---
typedef void* DisplayDriverPtr;

// --- Forward declaration for field def struct (real type in DisplayMapping.h) ---
struct DisplayFieldDefLabel;
struct FieldState;

void renderField(const char* label, const char* value, const DisplayFieldDefLabel* defOverride = nullptr, FieldState* stateOverride = nullptr);


10 changes: 10 additions & 0 deletions src/LABELS/LABEL_SET_WINGFOLD_TEST/CoverGates.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// CoverGates.h -- Per-label-set cover gate configuration
// Defines selectors/buttons that are physically guarded by a cover.
// Edit via the Label Creator tool or manually.

#pragma once

static const CoverGateDef kCoverGates[] = {
// { "ACTION", "RELEASE_OR_nullptr", "COVER", CoverGateKind::Selector, delay_ms, close_delay_ms },
};
static const unsigned kCoverGateCount = sizeof(kCoverGates) / sizeof(kCoverGates[0]);
122 changes: 122 additions & 0 deletions src/LABELS/LABEL_SET_WINGFOLD_TEST/CustomPins.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
// CustomPins.h - Label-set-specific pin definitions for CockpitOS
//
// This file is automatically included by LabelSetConfig.h if present.
// Uncomment and set ONLY the pins your hardware actually uses.
// The PIN(X) macro converts S2 pins to S3 equivalents automatically.
//
// ============================================================================

#pragma once

// --- Feature Enables --------------------------------------------------------
#define ENABLE_TFT_GAUGES 0 // 1 = Enable TFT gauge rendering (only if TFT displays are present)
#define ENABLE_PCA9555 0 // 1 = Enable PCA9555 I/O expander logic (only if PCA chips are present)

// --- I2C Pins ---------------------------------------------------------------
// Used by PCA9555 expanders, OLED displays, or any I2C peripherals.
// #define SDA_PIN PIN(8)
// #define SCL_PIN PIN(9)

// --- HC165 Shift Register ---------------------------------------------------
// For reading banks of physical switches via daisy-chained 74HC165 chips.
// HC165_BITS = total number of inputs across all chained chips (8 per chip).
// Set to 0 or leave commented to disable.
// #define HC165_BITS 16
// #define HC165_CONTROLLER_PL PIN(39) // Latch (PL)
// #define HC165_CONTROLLER_CP PIN(38) // Clock (CP)
// #define HC165_CONTROLLER_QH PIN(40) // Data (QH)

// --- WS2812B Addressable LED Strip ------------------------------------------
// #define WS2812B_PIN PIN(35)

// --- Mode Switch ------------------------------------------------------------
// HID selector switch for mode control (e.g., rotary or toggle).
// #define MODE_SWITCH_PIN PIN(33)

// --- TM1637 / HT16K33 7-Segment Displays -----------------------------------
// Pairs of DIO + CLK pins for each 7-segment display module.
// #define LA_DIO_PIN PIN(39) // Left Angle display DIO
// #define LA_CLK_PIN PIN(37) // Left Angle display CLK
// #define RA_DIO_PIN PIN(40) // Right Angle display DIO
// #define RA_CLK_PIN PIN(37) // Right Angle display CLK
// #define CA_DIO_PIN PIN(36) // Caution Advisory display DIO
// #define CA_CLK_PIN PIN(37) // Caution Advisory display CLK
// #define JETT_DIO_PIN PIN(8) // Jettison Select display DIO
// #define JETT_CLK_PIN PIN(9) // Jettison Select display CLK

// --- TFT Gauge Display Pins ------------------------------------------------
// Each TFT gauge needs: CS, DC, MOSI, SCLK (required) + RST, MISO (optional).
// Use -1 for unused RST/MISO pins.
//
// Example (Cabin Pressure gauge):
// #define CABIN_PRESSURE_CS_PIN PIN(36)
// #define CABIN_PRESSURE_DC_PIN PIN(18)
// #define CABIN_PRESSURE_MOSI_PIN PIN(39)
// #define CABIN_PRESSURE_SCLK_PIN PIN(40)
// #define CABIN_PRESSURE_RST_PIN -1 // Not connected
// #define CABIN_PRESSURE_MISO_PIN -1 // Not connected
//
// Example (Brake Pressure gauge):
// #define BRAKE_PRESSURE_CS_PIN PIN(5)
// #define BRAKE_PRESSURE_DC_PIN PIN(7)
// #define BRAKE_PRESSURE_MOSI_PIN PIN(10)
// #define BRAKE_PRESSURE_SCLK_PIN PIN(11)
// #define BRAKE_PRESSURE_RST_PIN -1
// #define BRAKE_PRESSURE_MISO_PIN -1
//
// Example (Hydraulic Pressure gauge):
// #define HYD_PRESSURE_CS_PIN PIN(17)
// #define HYD_PRESSURE_DC_PIN PIN(3)
// #define HYD_PRESSURE_MOSI_PIN PIN(4)
// #define HYD_PRESSURE_SCLK_PIN PIN(12)
// #define HYD_PRESSURE_RST_PIN -1
// #define HYD_PRESSURE_MISO_PIN -1
//
// Example (Radar Altimeter gauge):
// #define RADARALT_CS_PIN PIN(10)
// #define RADARALT_DC_PIN PIN(11)
// #define RADARALT_MOSI_PIN PIN(13)
// #define RADARALT_SCLK_PIN PIN(14)
// #define RADARALT_RST_PIN -1
// #define RADARALT_MISO_PIN -1
//
// Example (Battery gauge):
// #define BATTERY_CS_PIN PIN(36)
// #define BATTERY_DC_PIN PIN(13)
// #define BATTERY_MOSI_PIN PIN(8)
// #define BATTERY_SCLK_PIN PIN(9)
// #define BATTERY_RST_PIN PIN(12)

// --- IFEI LCD Panel Pins ----------------------------------------------------
// Parallel-interface LCD pairs (left + right) for the IFEI display.
// #define DATA0_PIN PIN(34) // Left LCD data
// #define WR0_PIN PIN(35) // Left LCD write enable
// #define CS0_PIN PIN(36) // Left LCD chip select
// #define DATA1_PIN PIN(18) // Right LCD data
// #define WR1_PIN PIN(21) // Right LCD write enable
// #define CS1_PIN PIN(33) // Right LCD chip select

// --- IFEI Backlight Pins ----------------------------------------------------
// #define BL_GREEN_PIN PIN(1) // Day mode backlight
// #define BL_WHITE_PIN PIN(2) // White backlight
// #define BL_NVG_PIN PIN(4) // NVG mode backlight

// --- ALR-67 Countermeasures Panel -------------------------------------------
// #define ALR67_STROBE_1 PIN(16)
// #define ALR67_STROBE_2 PIN(17)
// #define ALR67_STROBE_3 PIN(21)
// #define ALR67_STROBE_4 PIN(37)
// #define ALR67_DataPin PIN(38)
// #define ALR67_BACKLIGHT_PIN PIN(14)

// --- RS485 Communication Pins -----------------------------------------------
// Only needed for RS485 Slave or Master label sets.
// #define RS485_TX_PIN 17 // GPIO for TX (connect to RS485 board DI)
// #define RS485_RX_PIN 18 // GPIO for RX (connect to RS485 board RO)
// #define RS485_DE_PIN -1 // GPIO for DE pin (-1 if not used)

// --- RS485 Test Pins (development only, remove for production) --------------
// All three feed into int8_t fields → use -1 for disabled.
// #define RS485_TEST_BUTTON_GPIO -1
// #define RS485_TEST_SWITCH_GPIO -1
// #define RS485_TEST_LED_GPIO -1
Loading
Loading