From e51e5b2bbdde39f522971a33d13a8357700619d4 Mon Sep 17 00:00:00 2001 From: cyberman54 Date: Wed, 20 Nov 2024 21:17:44 +0100 Subject: [PATCH] update lmic in preparation for support of new SX1261/1262 chips --- platformio_orig.ini | 6 +++--- platformio_orig_s3.ini | 2 +- shared/lmic_config.h | 17 +++++++++++++++-- 3 files changed, 19 insertions(+), 6 deletions(-) diff --git a/platformio_orig.ini b/platformio_orig.ini index 2f3efc249..0935eaa48 100644 --- a/platformio_orig.ini +++ b/platformio_orig.ini @@ -47,7 +47,7 @@ description = Paxcounter is a device for metering passenger flows in realtime. I [common] ; for release_version use max. 10 chars total, use any decimal format like "a.b.c" -release_version = 3.6.2 +release_version = 3.7.0 ; 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 = 3 @@ -59,7 +59,7 @@ platform_espressif32 = espressif32@6.4.0 monitor_speed = 115200 upload_speed = 115200 ; set by build.py and taken from hal file lib_deps_lora = - mcci-catena/MCCI LoRaWAN LMIC library @ ^4.1.1 + mcci-catena/MCCI LoRaWAN LMIC library @ ^5.0.0 lib_deps_display = bitbank2/OneBitDisplay @ ^2.3.1 bitbank2/bb_spi_lcd @ 2.4.4 @@ -81,7 +81,7 @@ lib_deps_basic = https://github.com/cyberman54/libpax.git https://github.com/SukkoPera/Arduino-Rokkit-Hash.git bblanchon/ArduinoJson @ ^6.21.5 - makuna/RTC @ ^2.4.3 + makuna/RTC @ ^2.5.0 mathertel/OneButton @ ^2.5.0 lewisxhe/XPowersLib @ ^0.2.6 256dpi/MQTT @ ^2.5.2 diff --git a/platformio_orig_s3.ini b/platformio_orig_s3.ini index dcf5e7ec7..bef9e1d90 100644 --- a/platformio_orig_s3.ini +++ b/platformio_orig_s3.ini @@ -10,7 +10,7 @@ description = Paxcounter is a device for metering passenger flows in realtime. I [common] ; for release_version use max. 10 chars total, use any decimal format like "a.b.c" -release_version = 3.6.2 +release_version = 3.7.0 ; 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 = 3 diff --git a/shared/lmic_config.h b/shared/lmic_config.h index c586846a8..c6258da90 100644 --- a/shared/lmic_config.h +++ b/shared/lmic_config.h @@ -23,13 +23,26 @@ //#define LMIC_USE_INTERRUPTS 1 //#endif +// ensure that a radio is defined. // avoid lmic warning if we don't configure radio in case we haven't one -#if !(defined(CFG_sx1272_radio) || defined(CFG_sx1276_radio)) +#if !(defined(CFG_sx1272_radio) || defined(CFG_sx1276_radio) || defined(CFG_sx1261_radio) || defined(CFG_sx1262_radio)) +//# warning Target radio not defined, assuming CFG_sx1276_radio #define CFG_sx1276_radio 1 +#elif defined(CFG_sx1272_radio) && (defined(CFG_sx1276_radio) || defined(CFG_sx1261_radio) || defined(CFG_sx1262_radio)) +# error You can define at most one target radio +#elif defined(CFG_sx1276_radio) && (defined(CFG_sx1261_radio) || defined(CFG_sx1262_radio)) +# error You can define at most one target radio +#elif defined(CFG_sx1261_radio) && (defined(CFG_sx1261_radio)) +# error You can define at most one target radio #endif // time sync via LoRaWAN network, note: not supported by TTNv2 -#define LMIC_ENABLE_DeviceTimeReq 1 +// LMIC_ENABLE_DeviceTimeReq +// enable support for MCMD_DeviceTimeReq and MCMD_DeviceTimeAns +// this is always defined, and non-zero to enable it. +#if !defined(LMIC_ENABLE_DeviceTimeReq) +# define LMIC_ENABLE_DeviceTimeReq 1 +#endif // This tells LMIC to make the receive windows bigger, in case your clock is // faster or slower. This causes the transceiver to be earlier switched on,