Merge pull request #560 from cyberman54/development

v1.9.92
This commit is contained in:
Verkehrsrot 2020-03-01 23:51:31 +01:00 committed by GitHub
commit 40e88d79ae
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 6 deletions

View File

@ -45,7 +45,7 @@ description = Paxcounter is a device for metering passenger flows in realtime. I
[common] [common]
; for release_version use max. 10 chars total, use any decimal format like "a.b.c" ; for release_version use max. 10 chars total, use any decimal format like "a.b.c"
release_version = 1.9.91 release_version = 1.9.92
; DEBUG LEVEL: For production run set to 0, otherwise device will leak RAM while running! ; 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 ; 0=None, 1=Error, 2=Warn, 3=Info, 4=Debug, 5=Verbose
debug_level = 3 debug_level = 3

View File

@ -120,8 +120,8 @@ void process_timesync_req(void *taskparameter) {
// calculate time offset with millisecond precision using LMIC's time base, // calculate time offset with millisecond precision using LMIC's time base,
// since we use LMIC's ostime_t txEnd as tx timestamp. // since we use LMIC's ostime_t txEnd as tx timestamp.
// Also apply calibration const to compensate processing time. // Also apply calibration const to compensate processing time.
time_offset_ms += time_offset_ms += milliseconds(osticks2ms(os_getTime())) -
milliseconds(osticks2ms(os_getTime())) + milliseconds(TIME_SYNC_FIXUP); milliseconds(millis()) + milliseconds(TIME_SYNC_FIXUP);
// calculate absolute time in UTC epoch: convert to whole seconds, round to // calculate absolute time in UTC epoch: convert to whole seconds, round to
// ceil, and calculate fraction milliseconds // ceil, and calculate fraction milliseconds
@ -208,10 +208,9 @@ int recv_timesync_ans(const uint8_t buf[], const uint8_t buf_len) {
uint16_t timestamp_msec = 4 * buf[0]; uint16_t timestamp_msec = 4 * buf[0];
// construct the timepoint when message was seen on gateway // construct the timepoint when message was seen on gateway
time_sync_rx[k] += time_sync_rx[k] += seconds(timestamp_sec) + milliseconds(timestamp_msec);
seconds(timestamp_sec) + milliseconds(timestamp_msec);
// we guess timepoint is recent if it newer than code compile date // we guess timepoint is recent if it is newer than code compile date
if (timeIsValid(myClock::to_time_t(time_sync_rx[k]))) { if (timeIsValid(myClock::to_time_t(time_sync_rx[k]))) {
ESP_LOGD(TAG, "[%0.3f] Timesync request #%d of %d rcvd at %d.%03d", ESP_LOGD(TAG, "[%0.3f] Timesync request #%d of %d rcvd at %d.%03d",
millis() / 1000.0, k + 1, TIME_SYNC_SAMPLES, timestamp_sec, millis() / 1000.0, k + 1, TIME_SYNC_SAMPLES, timestamp_sec,