add config switch
This commit is contained in:
@ -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 },
|
||||
|
@ -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 {
|
||||
|
Reference in New Issue
Block a user