This commit is contained in:
Antonio Vanegas 2021-01-19 11:36:06 +01:00
commit cb0d718a11
7 changed files with 27 additions and 36 deletions

View File

@ -22,24 +22,14 @@
#define _bitl(b) (1UL << (b)) #define _bitl(b) (1UL << (b))
// bits in payloadmask for filtering payload data // bits in payloadmask for filtering payload data
#define COUNT_DATA _bit(1) #define COUNT_DATA _bit(0)
#define ALARM_DATA _bit(2) #define ALARM_DATA _bit(1)
#define MEMS_DATA _bit(3) #define MEMS_DATA _bit(2)
#define GPS_DATA _bit(4) #define GPS_DATA _bit(3)
#define SENSOR1_DATA _bit(5) #define SENSOR1_DATA _bit(4)
#define SENSOR2_DATA _bit(6) #define SENSOR2_DATA _bit(5)
#define SENSOR3_DATA _bit(7) #define SENSOR3_DATA _bit(6)
#define BATT_DATA _bit(8) #define BATT_DATA _bit(7)
// bits in configmask for device runmode control
#define GPS_MODE _bit(1)
#define ALARM_MODE _bit(2)
#define BEACON_MODE _bit(3)
#define UPDATE_MODE _bit(4)
#define FILTER_MODE _bit(5)
#define ANTENNA_MODE _bit(6)
#define BLE_MODE _bit(7)
#define SCREEN_MODE _bit(8)
// length of display buffer for lmic event messages // length of display buffer for lmic event messages
#define LMIC_EVENTMSG_LEN 17 #define LMIC_EVENTMSG_LEN 17

View File

@ -1,16 +1,16 @@
#ifndef _IRQHANDLER_H #ifndef _IRQHANDLER_H
#define _IRQHANDLER_H #define _IRQHANDLER_H
#define DISPLAY_IRQ _bitl(1) #define DISPLAY_IRQ _bitl(0)
#define BUTTON_IRQ _bitl(2) #define BUTTON_IRQ _bitl(1)
#define SENDCYCLE_IRQ _bitl(3) #define SENDCYCLE_IRQ _bitl(2)
#define CYCLIC_IRQ _bitl(4) #define CYCLIC_IRQ _bitl(3)
#define TIMESYNC_IRQ _bitl(5) #define TIMESYNC_IRQ _bitl(4)
#define MASK_IRQ _bitl(6) #define MASK_IRQ _bitl(5)
#define UNMASK_IRQ _bitl(7) #define UNMASK_IRQ _bitl(6)
#define BME_IRQ _bitl(8) #define BME_IRQ _bitl(7)
#define MATRIX_DISPLAY_IRQ _bitl(9) #define MATRIX_DISPLAY_IRQ _bitl(8)
#define PMU_IRQ _bitl(10) #define PMU_IRQ _bitl(9)
#include "globals.h" #include "globals.h"
#include "button.h" #include "button.h"

View File

@ -47,7 +47,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 = 2.1.1 release_version = 2.2.0
; 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

@ -262,7 +262,7 @@ var bitmap2 = function (byte) {
} }
var i = bytesToInt(byte); var i = bytesToInt(byte);
var bm = ('00000000' + Number(i).toString(2)).substr(-8).split('').map(Number).map(Boolean); var bm = ('00000000' + Number(i).toString(2)).substr(-8).split('').map(Number).map(Boolean);
return ['battery', 'sensor3', 'sensor2', 'sensor1', 'counter', 'bme', 'alarm', 'gps'] return ['battery', 'sensor3', 'sensor2', 'sensor1', 'gps', 'bme', 'alarm', 'counter']
.reduce(function (obj, pos, index) { .reduce(function (obj, pos, index) {
obj[pos] = +bm[index]; obj[pos] = +bm[index];
return obj; return obj;

View File

@ -119,8 +119,8 @@ time_t get_gpstime(uint16_t *msec) {
tm.Year = CalendarYrToTm(atoi(gpsyear.value())); // year offset from 1970 tm.Year = CalendarYrToTm(atoi(gpsyear.value())); // year offset from 1970
t = makeTime(tm); t = makeTime(tm);
// ESP_LOGD(TAG, "GPS time/date = %2d:%2d:%2d / %2d.%2d.%2d", tm.Hour, ESP_LOGD(TAG, "GPS time/date = %2d:%2d:%2d / %2d.%2d.%2d", tm.Hour,
// tm.Minute, tm.Second, tm.Day, tm.Month, tm.Year + 1970); tm.Minute, tm.Second, tm.Day, tm.Month, tm.Year + 1970);
// add protocol delay with millisecond precision // add protocol delay with millisecond precision
t += delay_ms / 1000 - 1; // whole seconds t += delay_ms / 1000 - 1; // whole seconds

View File

@ -109,8 +109,9 @@ void IRAM_ATTR setMyTime(uint32_t t_sec, uint16_t t_msec,
_seconds(), timeSetSymbols[mytimesource]); _seconds(), timeSetSymbols[mytimesource]);
} else { } else {
timesyncer.attach(TIME_SYNC_INTERVAL_RETRY * 60, setTimeSyncIRQ); timesyncer.attach(TIME_SYNC_INTERVAL_RETRY * 60, setTimeSyncIRQ);
ESP_LOGD(TAG, "[%0.3f] Timesync failed, invalid time fetched | source: %c", time_t unix_sec_at_compilation = compiledUTC();
_seconds(), timeSetSymbols[mytimesource]); ESP_LOGD(TAG, "[%0.3f] Failed to synchronise time from source %c | unix sec obtained from source: %d | unix sec at program compilation: %d",
_seconds(), timeSetSymbols[mytimesource], time_to_set, unix_sec_at_compilation);
} }
} }