add config switch

This commit is contained in:
2022-12-23 14:48:47 +01:00
parent 015309f20f
commit 0923c59280
4 changed files with 27 additions and 3 deletions

View File

@ -26,8 +26,8 @@ const uint32_t MAGIC = 0xaffe0001;
config_t myConfig = {
.magic = MAGIC,
.appEui = { 0, 0, 0, 0, 0, 0, 0, 0 },
.appKey = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
.appEui = { 0xa0, 0x57, 0x81, 0x00, 0x01, 0x12, 0xaa, 0xf3 },
.appKey = { 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88 },
.modbus_poll_slots = {
{ .typ = INPUT_REGISTERS, .id = 7, .address = 0x01 },
{ .typ = INPUT_REGISTERS, .id = 7, .address = 0x02 },

View File

@ -18,10 +18,13 @@ void setup() {
pinMode(LED_GREEN, OUTPUT);
digitalWrite(LED_GREEN, LOW);
pinMode(CONFIG_SWITCH, INPUT_PULLUP);
Serial.begin(115200);
configLoad();
productionMode = (digitalRead(CONFIG_SWITCH) == HIGH);
if (productionMode) {
productionSetup();
} else {