From 98c2ad38382575e4bd09358e11a76f20d910a1ff Mon Sep 17 00:00:00 2001 From: Chrisotph Schultz Date: Mon, 5 Oct 2020 12:40:33 +0200 Subject: [PATCH] corrected some errors --- include/globals.h | 4 +--- src/configmanager.cpp | 8 ++------ 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/include/globals.h b/include/globals.h index b4395c38..fb3aae7b 100644 --- a/include/globals.h +++ b/include/globals.h @@ -82,10 +82,8 @@ 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 1b4dab82..221ee8be 100644 --- a/src/configmanager.cpp +++ b/src/configmanager.cpp @@ -28,10 +28,8 @@ static uint8_t buffer[cfgLen + cfgLen2]; // (configData_t cfg)] // 3. magicByte [cfgLen2 bytes, containing a fixed identifier] -static void defaultConfig(configData_t *myconfig) { +static void defaultConfig(configData_t *myconfig) { //device factory settings 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 @@ -44,8 +42,7 @@ static void defaultConfig(configData_t *myconfig) { 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) @@ -54,7 +51,6 @@ static void defaultConfig(configData_t *myconfig) { 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