diff --git a/platformio_orig.ini b/platformio_orig.ini index c8962086..c9dc8755 100644 --- a/platformio_orig.ini +++ b/platformio_orig.ini @@ -46,7 +46,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 @@ -122,11 +122,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 platform = https://github.com/platformio/platform-espressif32.git#feature/arduino-upstream -platform_packages = framework-arduinoespressif32 @ https://github.com/espressif/arduino-esp32.git +platform_packages = framework-arduinoespressif32 @ https://github.com/espressif/arduino-esp32.git#c2e5957 diff --git a/src/i2c.cpp b/src/i2c.cpp index f12334a8..c908d250 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) { 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 diff --git a/src/timekeeper.cpp b/src/timekeeper.cpp index 24c25f9e..32b1e0fe 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,14 +253,16 @@ 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 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 (;;) {