From 0e2a4e6893a9ce3fb214fc6eb99e1535374a21fe Mon Sep 17 00:00:00 2001 From: Chrisotph Schultz Date: Mon, 5 Oct 2020 12:49:54 +0200 Subject: [PATCH] Revert " corrected some errors" This reverts commit 98c2ad38382575e4bd09358e11a76f20d910a1ff. --- include/globals.h | 4 +++- src/configmanager.cpp | 8 ++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/include/globals.h b/include/globals.h index fb3aae7b..b4395c38 100644 --- a/include/globals.h +++ b/include/globals.h @@ -82,8 +82,10 @@ typedef struct __attribute__((packed)) { uint8_t monitormode; // 0=disabled, 1=enabled uint8_t runmode; // 0=normal, 1=update uint8_t payloadmask; // bitswitches for payload data + uint8_t enscount; // 0=disabled 1= enabled - + char version[10]; // Firmware version + #ifdef HAS_BME680 uint8_t bsecstate[BSEC_MAX_STATE_BLOB_SIZE + 1]; // BSEC state for BME680 sensor #endif diff --git a/src/configmanager.cpp b/src/configmanager.cpp index 221ee8be..1b4dab82 100644 --- a/src/configmanager.cpp +++ b/src/configmanager.cpp @@ -28,8 +28,10 @@ static uint8_t buffer[cfgLen + cfgLen2]; // (configData_t cfg)] // 3. magicByte [cfgLen2 bytes, containing a fixed identifier] -static void defaultConfig(configData_t *myconfig) { //device factory settings +static void defaultConfig(configData_t *myconfig) { memcpy(myconfig->version, &PROGVERSION, 10); // Firmware version + + // device factory settings myconfig->loradr = LORADRDEFAULT; // 0-15, lora datarate, see paxcounter.conf myconfig->txpower = LORATXPOWDEFAULT; // 0-15, lora tx power myconfig->adrmode = 1; // 0=disabled, 1=enabled @@ -42,7 +44,8 @@ static void defaultConfig(configData_t *myconfig) { //device factory settings myconfig->wifichancycle = WIFI_CHANNEL_SWITCH_INTERVAL; // wifi channel switch cycle [seconds/100] myconfig->blescantime = - BLESCANINTERVAL /10; // BT channel scan cycle [seconds/100], default 1 (= 10ms) + BLESCANINTERVAL / + 10; // BT channel scan cycle [seconds/100], default 1 (= 10ms) myconfig->blescan = 1; // 0=disabled, 1=enabled myconfig->wifiscan = 1; // 0=disabled, 1=enabled myconfig->wifiant = 0; // 0=internal, 1=external (for LoPy/LoPy4) @@ -51,6 +54,7 @@ static void defaultConfig(configData_t *myconfig) { //device factory settings myconfig->monitormode = 0; // 0=disabled, 1=enabled myconfig->payloadmask = PAYLOADMASK; // all payload switched on myconfig->enscount =0; // 0= disabled, 1 = enabled + memcpy(myconfig->version, version, 10); // Firmware version [exactly 10 chars] #ifdef HAS_BME680 // initial BSEC state for BME680 sensor