From 19dd7c8e336e499ba6492002ccb1f9d20239236c Mon Sep 17 00:00:00 2001 From: cyberman54 Date: Sat, 2 Mar 2019 21:54:55 +0100 Subject: [PATCH] timekeeper bugfix if482 --- platformio.ini | 6 +++--- src/hal/ttgobeam.h | 2 +- src/hal/ttgofox.h | 8 ++++---- src/paxcounter.conf | 4 ++-- src/timekeeper.cpp | 2 +- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/platformio.ini b/platformio.ini index 54912c70..34e70804 100644 --- a/platformio.ini +++ b/platformio.ini @@ -6,7 +6,7 @@ ; ---> SELECT TARGET PLATFORM HERE! <--- [platformio] -env_default = generic +;env_default = generic ;env_default = ebox ;env_default = eboxtube ;env_default = heltec @@ -15,7 +15,7 @@ env_default = generic ;env_default = ttgov2 ;env_default = ttgov21old ;env_default = ttgov21new -;env_default = ttgobeam +env_default = ttgobeam ;env_default = ttgofox ;env_default = lopy ;env_default = lopy4 @@ -33,7 +33,7 @@ description = Paxcounter is a proof-of-concept ESP32 device for metering passeng release_version = 1.7.324 ; 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 = 0 +debug_level = 4 ; UPLOAD MODE: select esptool to flash via USB/UART, select custom to upload to cloud for OTA upload_protocol = esptool ;upload_protocol = custom diff --git a/src/hal/ttgobeam.h b/src/hal/ttgobeam.h index a572260d..d86acd18 100644 --- a/src/hal/ttgobeam.h +++ b/src/hal/ttgobeam.h @@ -23,7 +23,7 @@ // GPS settings #define HAS_GPS 1 // use on board GPS #define GPS_SERIAL 9600, SERIAL_8N1, GPIO_NUM_12, GPIO_NUM_15 // UBlox NEO 6M -//#define GPS_INT GPIO_NUM_34 // 30ns accurary timepulse, to be external wired on pcb: NEO 6M Pin#3 -> GPIO34 +#define GPS_INT GPIO_NUM_34 // 30ns accurary timepulse, to be external wired on pcb: NEO 6M Pin#3 -> GPIO34 // Settings for on board DS3231 RTC chip //#define HAS_RTC MY_OLED_SDA, MY_OLED_SCL // SDA, SCL diff --git a/src/hal/ttgofox.h b/src/hal/ttgofox.h index 3078a467..fe782248 100644 --- a/src/hal/ttgofox.h +++ b/src/hal/ttgofox.h @@ -25,16 +25,16 @@ #define RTC_INT GPIO_NUM_34 // timepulse with accuracy +/- 2*e-6 [microseconds] = 0,1728sec / day // Settings for IF482 interface -//#define HAS_IF482 9600, SERIAL_7E1, GPIO_NUM_12, GPIO_NUM_14 // IF482 serial port parameters +#define HAS_IF482 9600, SERIAL_7E1, GPIO_NUM_12, GPIO_NUM_14 // IF482 serial port parameters // Settings for DCF77 interface //#define HAS_DCF77 GPIO_NUM_14 //#define DCF77_ACTIVE_LOW 1 // Settings for external GPS chip -//#define HAS_GPS 1 // use on board GPS -//#define GPS_SERIAL 9600, SERIAL_8N1, GPIO_NUM_17, GPIO_NUM_16 // UBlox NEO 6M or 7M with default configuration -//#define GPS_INT GPIO_NUM_13 +#define HAS_GPS 1 // use on board GPS +#define GPS_SERIAL 9600, SERIAL_8N1, GPIO_NUM_17, GPIO_NUM_16 // UBlox NEO 6M or 7M with default configuration +#define GPS_INT GPIO_NUM_13 // Pins for LORA chip SPI interface, reset line and interrupt lines #define LORA_SCK (5) diff --git a/src/paxcounter.conf b/src/paxcounter.conf index f5251bdd..7e449439 100644 --- a/src/paxcounter.conf +++ b/src/paxcounter.conf @@ -66,8 +66,8 @@ #define RESPONSE_TIMEOUT_MS 60000 // firmware binary server connection timeout [milliseconds] // settings for syncing time of node with external time source -//#define TIME_SYNC_INTERVAL 2 // sync time attempt each .. minutes from time source (GPS/LORA/RTC) [default = 60], comment out means off -//#define TIME_SYNC_LORA 1 // use LORA network as time source, comment out means off [default = off] +#define TIME_SYNC_INTERVAL 2 // sync time attempt each .. minutes from time source (GPS/LORA/RTC) [default = 60], comment out means off +#define TIME_SYNC_LORA 1 // use LORA network as time source, comment out means off [default = off] // time zone, see https://github.com/JChristensen/Timezone/blob/master/examples/WorldClock/WorldClock.ino #define DAYLIGHT_TIME {"CEST", Last, Sun, Mar, 2, 120} // Central European Summer Time diff --git a/src/timekeeper.cpp b/src/timekeeper.cpp index 3083648b..fe5b3920 100644 --- a/src/timekeeper.cpp +++ b/src/timekeeper.cpp @@ -214,7 +214,7 @@ void clock_loop(void *taskparameter) { // ClockTask #if defined HAS_IF482 - IF482_Pulse(t); + IF482_Pulse(nextsec(t)); #elif defined HAS_DCF77