Configuration extended and some more LED code improvements

This commit is contained in:
2026-02-03 21:16:51 +01:00
parent 3b6b97011b
commit dcac1f70df
9 changed files with 138 additions and 23 deletions

View File

@@ -35,6 +35,7 @@ struct ConfigDef {
static const ConfigDef configdefs[] = {
{"systemName", ConfigType::STRING, String("OBPkp61")},
{"systemMode", ConfigType::CHAR, 'K'},
{"nightMode", ConfigType::BOOL, false},
{"logLevel", ConfigType::BYTE, uint8_t(4)},
{"adminPassword", ConfigType::STRING, String("obpkp61")},
{"useAdminPass", ConfigType::BOOL, true},
@@ -49,6 +50,8 @@ static const ConfigDef configdefs[] = {
{"cpuSpeed", ConfigType::SHORT, int16_t(160)},
{"ledBrightness", ConfigType::SHORT, int16_t(96)},
{"rgbBrightness", ConfigType::SHORT, int16_t(96)},
{"buzEnable", ConfigType::BOOL, false},
{"buzPower", ConfigType::BYTE, uint8_t(50)},
{"tempFormat", ConfigType::CHAR, 'C'},
{"switchBank", ConfigType::BYTE, uint8_t(0)},
{"key1", ConfigType::BYTE, uint8_t(1)},
@@ -63,6 +66,8 @@ static const ConfigDef configdefs[] = {
{"key5long", ConfigType::BYTE, uint8_t(15)},
{"key6", ConfigType::BYTE, uint8_t(6)},
{"key6long", ConfigType::BYTE, uint8_t(16)},
{"n2kSysInst", ConfigType::BYTE, uint8_t(0)},
{"n2kDevInst", ConfigType::BYTE, uint8_t(0)},
{"n2kDestA", ConfigType::STRING, String("none")},
{"n2kDestB", ConfigType::STRING, String("none")},
{"n2kDestC", ConfigType::STRING, String("none")},

View File

@@ -6,3 +6,4 @@ extern int16_t rgb_brightness;
void led_init();
void led_test();
void led_blink(uint8_t channel, uint8_t count, int16_t brightness, uint32_t interval_ms);
void led_set_mode();

View File

@@ -129,18 +129,24 @@ struct ButtonEvent {
ButtonPressType pressType;
};
extern uint8_t loglevel;
extern Nmea2kTwai &NMEA2000;
extern tN2kDeviceList *pN2kDeviceList;
extern char globalmode;
extern uint8_t loglevel;
extern char mode;
extern char ledmode;
extern char audiomode;
extern char destination;
extern uint64_t chipid;
extern int16_t led_brightness;
extern int16_t rgb_brightness;
// extern int16_t led_brightness;
// extern int16_t rgb_brightness;
extern bool ap_enabled;
extern bool buz_enabled;
extern uint8_t keycode[6];
extern uint8_t longcode[6];
extern float temp;
extern float hum;