chore: store more hardware settings in hwdef JSON files (#7031)

This commit is contained in:
philmoz
2026-01-29 11:54:14 +10:00
committed by GitHub
parent 71305d502c
commit 2579bc6132
11 changed files with 290 additions and 134 deletions
+30 -1
View File
@@ -100,6 +100,31 @@ class BoardJson
TrimDefn() = default;
};
struct DisplayDefn {
int w = 0;
int h = 0;
int phys_w = 0;
int phys_h = 0;
int depth = 0;
int color = 0;
int oled = 0;
int backlight_color = 0;
};
struct CustomSwitchesDefn {
int rgb_led = 0;
int groups = 0;
};
struct HardwareDefn {
int has_audio_mute = 0;
int has_bling_leds = 0;
int has_ext_module_support = 0;
int has_int_module_support = 0;
int sport_max_baudrate = 0;
int surface = 0;
};
typedef std::vector<TrimDefn> TrimsTable;
explicit BoardJson(Board::Type board, QString hwdefn);
@@ -170,6 +195,9 @@ private:
SwitchesTable *m_switches;
TrimsTable *m_trims;
KeysTable *m_keys;
DisplayDefn m_display;
CustomSwitchesDefn m_cfs;
HardwareDefn m_hardware;
struct InputCounts {
unsigned int flexGyroAxes;
@@ -194,7 +222,8 @@ private:
SwitchCounts m_switchCnt;
static bool loadFile(Board::Type board, QString hwdefn, InputsTable * inputs, SwitchesTable * switches,
KeysTable * keys, TrimsTable * trims);
KeysTable * keys, TrimsTable * trims, DisplayDefn & lcd, CustomSwitchesDefn & cfs,
HardwareDefn & hardware);
static void afterLoadFixups(Board::Type board, InputsTable * inputs, SwitchesTable * switches,
KeysTable * keys, TrimsTable * trims);