diff --git a/include/sensor.h b/include/sensor.h index 9048a666..6e6b837b 100644 --- a/include/sensor.h +++ b/include/sensor.h @@ -3,5 +3,6 @@ uint8_t sensor_mask(uint8_t sensor_no); uint8_t * sensor_read(uint8_t sensor); +void sensor_init(void); #endif \ No newline at end of file diff --git a/platformio.ini b/platformio.ini index b79180ea..5705b2a8 100644 --- a/platformio.ini +++ b/platformio.ini @@ -32,7 +32,7 @@ description = Paxcounter is a proof-of-concept ESP32 device for metering passeng release_version = 1.6.83 ; 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 = 3 ; 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/configmanager.cpp b/src/configmanager.cpp index c90f0f4b..7222447f 100644 --- a/src/configmanager.cpp +++ b/src/configmanager.cpp @@ -317,9 +317,9 @@ void loadConfig() { if (nvs_get_i8(my_handle, "payloadmask", &flash8) == ESP_OK) { cfg.payloadmask = flash8; - ESP_LOGI(TAG, "GPS mode = %d", flash8); + ESP_LOGI(TAG, "payloadmask = %u", flash8); } else { - ESP_LOGI(TAG, "GPS mode set to default %d", cfg.payloadmask); + ESP_LOGI(TAG, "payloadmask set to default %u", cfg.payloadmask); saveConfig(); } diff --git a/src/main.cpp b/src/main.cpp index 0fed89ec..d63aad71 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -158,12 +158,18 @@ void setup() { strcat_P(features, " GPS"); #endif -// initialize gps +// initialize bme #ifdef HAS_BME strcat_P(features, " BME"); bme_init(); #endif +// initialize sensors +#ifdef HAS_SENSORS + strcat_P(features, " SENS"); + sensor_init(); +#endif + // initialize LoRa #ifdef HAS_LORA strcat_P(features, " LORA"); diff --git a/src/sensor.cpp b/src/sensor.cpp index ac5459f8..2c338850 100644 --- a/src/sensor.cpp +++ b/src/sensor.cpp @@ -4,6 +4,13 @@ // Local logging tag static const char TAG[] = "main"; +void sensor_init(void) { + + // this function is called dureing device startup + // put your sensor initialization routines here + +} + uint8_t sensor_mask(uint8_t sensor_no) { switch (sensor_no) { case 1: