This commit is contained in:
Klaus K Wilting 2018-07-25 00:17:31 +02:00
parent 5ae8f47b9d
commit 34ac6b45d0
4 changed files with 13 additions and 16 deletions

View File

@ -12,11 +12,11 @@
; ---> SELECT TARGET PLATFORM HERE! <--- ; ---> SELECT TARGET PLATFORM HERE! <---
[platformio] [platformio]
;env_default = generic ;env_default = generic
env_default = heltec ;env_default = heltec
;env_default = ttgov1 ;env_default = ttgov1
;env_default = ttgov2 ;env_default = ttgov2
;env_default = ttgov21 ;env_default = ttgov21
;env_default = ttgobeam env_default = ttgobeam
;env_default = lopy ;env_default = lopy
;env_default = lopy4 ;env_default = lopy4
;env_default = fipy ;env_default = fipy
@ -27,9 +27,9 @@ env_default = heltec
description = Paxcounter is a proof-of-concept ESP32 device for metering passenger flows in realtime. It counts how many mobile devices are around. description = Paxcounter is a proof-of-concept ESP32 device for metering passenger flows in realtime. It counts how many mobile devices are around.
[common_env_data] [common_env_data]
platform_espressif32 = espressif32@1.0.2 ;platform_espressif32 = espressif32@1.0.2
;platform_espressif32 = espressif32@1.1.2 ;platform_espressif32 = espressif32@1.1.2
;platform_espressif32 = https://github.com/platformio/platform-espressif32.git#feature/stage platform_espressif32 = https://github.com/platformio/platform-espressif32.git#feature/stage
board_build.partitions = no_ota.csv board_build.partitions = no_ota.csv
lib_deps_all = lib_deps_all =
lib_deps_display = lib_deps_display =
@ -45,15 +45,15 @@ build_flags =
; otherwise device may crash in dense environments due to serial buffer overflow ; otherwise device may crash in dense environments due to serial buffer overflow
; ;
; -DCORE_DEBUG_LEVEL=ARDUHAL_LOG_LEVEL_NONE ; -DCORE_DEBUG_LEVEL=ARDUHAL_LOG_LEVEL_NONE
; -DCORE_DEBUG_LEVEL=ARDUHAL_LOG_LEVEL_INFO -DCORE_DEBUG_LEVEL=ARDUHAL_LOG_LEVEL_INFO
-DCORE_DEBUG_LEVEL=ARDUHAL_LOG_LEVEL_DEBUG ; -DCORE_DEBUG_LEVEL=ARDUHAL_LOG_LEVEL_DEBUG
; -DCORE_DEBUG_LEVEL=ARDUHAL_LOG_LEVEL_VERBOSE ; -DCORE_DEBUG_LEVEL=ARDUHAL_LOG_LEVEL_VERBOSE
; ;
; override lora settings from LMiC library in lmic/config.h and use main.h instead ; override lora settings from LMiC library in lmic/config.h and use main.h instead
-D_lmic_config_h_ -D_lmic_config_h_
-include "src/paxcounter.conf" -include "src/paxcounter.conf"
-include "src/hal/${PIOENV}.h" -include "src/hal/${PIOENV}.h"
-w ; -w
[env:heltec] [env:heltec]
platform = ${common_env_data.platform_espressif32} platform = ${common_env_data.platform_espressif32}

View File

@ -1,5 +1,3 @@
std::array<uint32_t, 5>::iterator it; std::array<uint32_t, 5>::iterator it;
std::array<uint32_t, 5> beacons = {0x000000000000, 0x111111111111, std::array<uint32_t, 5> beacons = {0,0,0,0,0};
0x123456789000, 0xaaaaaaaaaaaa,
0x0101010101010};

View File

@ -10,7 +10,9 @@ static const char TAG[] = "main";
// do all housekeeping // do all housekeeping
void doHomework() { void doHomework() {
static uint64_t uptimecounter;
// update uptime counter
uptime();
// read battery voltage into global variable // read battery voltage into global variable
#ifdef HAS_BATTERY_PROBE #ifdef HAS_BATTERY_PROBE
@ -39,10 +41,7 @@ void doHomework() {
reset_counters(); // clear macs container and reset all counters reset_counters(); // clear macs container and reset all counters
reset_salt(); // get new salt for salting hashes reset_salt(); // get new salt for salting hashes
} }
} // doHomework()
// update uptime counter
uptimecounter = uptime();
}
void checkHousekeeping() { void checkHousekeeping() {
if (HomeCycleIRQ) { if (HomeCycleIRQ) {

View File

@ -60,7 +60,7 @@
// Some hardware settings // Some hardware settings
#define RGBLUMINOSITY 30 // RGB LED luminosity [default = 30%] #define RGBLUMINOSITY 30 // RGB LED luminosity [default = 30%]
#define DISPLAYREFRESH_MS 40 // OLED refresh cycle in ms [default = 40] -> 1000/40 = 25 frames per second #define DISPLAYREFRESH_MS 40 // OLED refresh cycle in ms [default = 40] -> 1000/40 = 25 frames per second
#define HOMECYCLE 60 // house keeping cycle in seconds [default = 60 secs] #define HOMECYCLE 30 // house keeping cycle in seconds [default = 30 secs]
// LMIC settings // LMIC settings
// define hardware independent LMIC settings here, settings of standard library in /lmic/config.h will be ignored // define hardware independent LMIC settings here, settings of standard library in /lmic/config.h will be ignored