From 2ca6bbde33a496e01890c64db0196f7b94c731a9 Mon Sep 17 00:00:00 2001 From: cyberman54 Date: Sun, 27 Feb 2022 18:02:40 +0100 Subject: [PATCH 1/6] fix issue #859 --- src/rcommand.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/rcommand.cpp b/src/rcommand.cpp index 71c6f453..1654b345 100644 --- a/src/rcommand.cpp +++ b/src/rcommand.cpp @@ -85,8 +85,6 @@ void set_sendcycle(uint8_t val[]) { void set_sleepcycle(uint8_t val[]) { // swap byte order from msb to lsb, note: this is a platform dependent hack uint16_t t = __builtin_bswap16(*(uint16_t *)(val)); - if (t == 0) - return; cfg.sleepcycle = t; ESP_LOGI(TAG, "Remote command: set sleep cycle to %d seconds", cfg.sleepcycle * 10); From accada229390cec242c8a3a8bd4301910e5e0f4f Mon Sep 17 00:00:00 2001 From: cyberman54 Date: Sun, 27 Feb 2022 18:04:31 +0100 Subject: [PATCH 2/6] add note in paxcounter_orig.conf --- src/paxcounter_orig.conf | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/paxcounter_orig.conf b/src/paxcounter_orig.conf index e0f0eb11..2848a42d 100644 --- a/src/paxcounter_orig.conf +++ b/src/paxcounter_orig.conf @@ -4,7 +4,9 @@ // // --> adapt to your needs and use case <-- // -// Note: After editing, before "build", use "clean" button in PlatformIO! +// Notes: +// 1. After editing, before "build", use "clean" button in PlatformIO! +// 2. Clear NVRAM of the board to delete previous stored runtime settings (pio run -t erase) // Device options #define VERBOSE 1 // set to 0 to silence the device, 1 enables additional debug output From 22daa95b53e295a2678f51bdc7aada5d23c61130 Mon Sep 17 00:00:00 2001 From: cyberman54 Date: Wed, 2 Mar 2022 08:38:38 +0100 Subject: [PATCH 3/6] fix issue #858 --- src/i2c.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/i2c.cpp b/src/i2c.cpp index 530dee4c..538d1681 100644 --- a/src/i2c.cpp +++ b/src/i2c.cpp @@ -12,7 +12,8 @@ void i2c_init(void) { Wire.begin(); } -void i2c_deinit(void) { Wire.end(); } +//void i2c_deinit(void) { Wire.end(); } +void i2c_deinit(void) { Wire.~TwoWire(); } void i2c_scan(void) { From 7d70b0d0245303e28bfb4aa7779c32ef253d5d60 Mon Sep 17 00:00:00 2001 From: cyberman54 Date: Wed, 2 Mar 2022 09:14:57 +0100 Subject: [PATCH 4/6] timekeeper.cpp: fix compiler warnings --- src/timekeeper.cpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/timekeeper.cpp b/src/timekeeper.cpp index f2765bf7..ff332151 100644 --- a/src/timekeeper.cpp +++ b/src/timekeeper.cpp @@ -33,9 +33,6 @@ void setTimeSyncIRQ() { xTaskNotify(irqHandlerTask, TIMESYNC_IRQ, eSetBits); } void calibrateTime(void) { - time_t t = 0; - uint16_t t_msec = 0; - // kick off asynchronous lora timesync if we have #if (HAS_LORA_TIME) timesync_request(); @@ -43,6 +40,10 @@ void calibrateTime(void) { return; #endif +#if ((HAS_GPS) || (HAS_RTC)) + time_t t = 0; + uint16_t t_msec = 0; + // get GPS time, if we have #if (HAS_GPS) t = get_gpstime(&t_msec); @@ -57,6 +58,8 @@ void calibrateTime(void) { return; #endif +#endif + } // calibrateTime() // set system time (UTC), calibrate RTC and RTC_INT pps @@ -250,9 +253,7 @@ void clock_init(void) { void clock_loop(void *taskparameter) { // ClockTask - uint64_t ClockPulse = 0; uint32_t current_time = 0, previous_time = 0; - int8_t ClockMinute = -1; time_t tt; struct tm t = {0}; #ifdef HAS_TWO_LED @@ -292,6 +293,9 @@ void clock_loop(void *taskparameter) { // ClockTask #elif defined HAS_DCF77 + uint64_t ClockPulse = 0; + int8_t ClockMinute = -1; + // load new frame if second 59 is reached if (t.tm_sec == 0) { ClockMinute = t.tm_min; From a08a2a92a4b0976677cd855eb00623b369913631 Mon Sep 17 00:00:00 2001 From: cyberman54 Date: Wed, 2 Mar 2022 10:52:13 +0100 Subject: [PATCH 5/6] timekeeper.cpp: fix dcf77 #ifdef --- src/timekeeper.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/timekeeper.cpp b/src/timekeeper.cpp index ff332151..d51d1570 100644 --- a/src/timekeeper.cpp +++ b/src/timekeeper.cpp @@ -259,6 +259,10 @@ void clock_loop(void *taskparameter) { // ClockTask #ifdef HAS_TWO_LED static bool led1_state = false; #endif +#ifdef HAS_DCF77 + uint64_t ClockPulse = 0; + int8_t ClockMinute = -1; +#endif // output the next second's pulse/telegram after pps arrived for (;;) { @@ -293,9 +297,6 @@ void clock_loop(void *taskparameter) { // ClockTask #elif defined HAS_DCF77 - uint64_t ClockPulse = 0; - int8_t ClockMinute = -1; - // load new frame if second 59 is reached if (t.tm_sec == 0) { ClockMinute = t.tm_min; From fd85a54e03c590ab475f20289b2bdb955c9ce1c2 Mon Sep 17 00:00:00 2001 From: cyberman54 Date: Thu, 3 Mar 2022 10:37:52 +0100 Subject: [PATCH 6/6] v3.2.1: Move to arduino-esp32 v2.0.2 --- platformio_orig.ini | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/platformio_orig.ini b/platformio_orig.ini index 6baf22c9..2c2112cf 100644 --- a/platformio_orig.ini +++ b/platformio_orig.ini @@ -48,7 +48,7 @@ description = Paxcounter is a device for metering passenger flows in realtime. I [common] ; for release_version use max. 10 chars total, use any decimal format like "a.b.c" -release_version = 3.2.0 +release_version = 3.2.1 ; DEBUG LEVEL: For production run set to 0, otherwise device will leak RAM while running! ; 0=None, 1=Error, 2=Warn, 3=Info, 4=Debug, 5=Verbose debug_level = 3 @@ -125,11 +125,15 @@ monitor_filters = time, esp32_exception_decoder, default [env:ota] upload_protocol = custom +platform = https://github.com/platformio/platform-espressif32.git#feature/arduino-upstream +platform_packages = framework-arduinoespressif32 @ https://github.com/espressif/arduino-esp32.git#c2e5957 [env:usb] upload_protocol = esptool +platform = https://github.com/platformio/platform-espressif32.git#feature/arduino-upstream +platform_packages = framework-arduinoespressif32 @ https://github.com/espressif/arduino-esp32.git#c2e5957 [env:dev] upload_protocol = esptool -build_type = debug platform = https://github.com/platformio/platform-espressif32.git#feature/arduino-upstream +platform_packages = framework-arduinoespressif32 @ https://github.com/espressif/arduino-esp32.git#c2e5957