From deaf86035dbdd620ea0b5c1e0fa99a9f4f4f1f0e Mon Sep 17 00:00:00 2001 From: GUVWAF Date: Sun, 11 Aug 2024 17:22:30 +0200 Subject: [PATCH 1/3] STM32WL: Enable DeviceTelemetry --- arch/stm32/stm32.ini | 4 ++-- src/platform/stm32wl/architecture.h | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/arch/stm32/stm32.ini b/arch/stm32/stm32.ini index d6d14e2c9a..ffbc516805 100644 --- a/arch/stm32/stm32.ini +++ b/arch/stm32/stm32.ini @@ -21,7 +21,7 @@ build_flags = -fdata-sections build_src_filter = - ${arduino_base.build_src_filter} - - - - - - - - - - - - - - + ${arduino_base.build_src_filter} - - - - - - - - - - - - - board_upload.offset_address = 0x08000000 upload_protocol = stlink @@ -33,4 +33,4 @@ lib_deps = lib_ignore = https://github.com/mathertel/OneButton@~2.6.1 - Wire + Wire \ No newline at end of file diff --git a/src/platform/stm32wl/architecture.h b/src/platform/stm32wl/architecture.h index 1c021903a1..89df68da9f 100644 --- a/src/platform/stm32wl/architecture.h +++ b/src/platform/stm32wl/architecture.h @@ -9,6 +9,9 @@ #ifndef HAS_RADIO #define HAS_RADIO 1 #endif +#ifndef HAS_TELEMETRY +#define HAS_TELEMETRY 1 +#endif // // set HW_VENDOR From 00883be91ffc9e216fffb53d1145488991e0dbaf Mon Sep 17 00:00:00 2001 From: GUVWAF Date: Sun, 11 Aug 2024 17:23:03 +0200 Subject: [PATCH 2/3] Add long/short name user preference options --- src/mesh/NodeDB.cpp | 8 ++++++++ userPrefs.h | 3 +++ 2 files changed, 11 insertions(+) diff --git a/src/mesh/NodeDB.cpp b/src/mesh/NodeDB.cpp index 0f6c444ce4..666255c74a 100644 --- a/src/mesh/NodeDB.cpp +++ b/src/mesh/NodeDB.cpp @@ -563,8 +563,16 @@ void NodeDB::installDefaultDeviceState() // Set default owner name pickNewNodeNum(); // based on macaddr now +#ifdef CONFIG_OWNER_LONG_NAME_USERPREFS + snprintf(owner.long_name, sizeof(owner.long_name), CONFIG_OWNER_LONG_NAME_USERPREFS); +#else snprintf(owner.long_name, sizeof(owner.long_name), "Meshtastic %02x%02x", ourMacAddr[4], ourMacAddr[5]); +#endif +#ifdef CONFIG_OWNER_SHORT_NAME_USERPREFS + snprintf(owner.short_name, sizeof(owner.short_name), CONFIG_OWNER_SHORT_NAME_USERPREFS); +#else snprintf(owner.short_name, sizeof(owner.short_name), "%02x%02x", ourMacAddr[4], ourMacAddr[5]); +#endif snprintf(owner.id, sizeof(owner.id), "!%08x", getNodeNum()); // Default node ID now based on nodenum memcpy(owner.macaddr, ourMacAddr, sizeof(owner.macaddr)); } diff --git a/userPrefs.h b/userPrefs.h index b365e8c6f8..3ebbefcaf9 100644 --- a/userPrefs.h +++ b/userPrefs.h @@ -19,6 +19,9 @@ // #define CHANNEL_0_NAME_USERPREFS "DEFCONnect" // #define CHANNEL_0_PRECISION_USERPREFS 13 +// #define CONFIG_OWNER_LONG_NAME_USERPREFS "My Long Name" +// #define CONFIG_OWNER_SHORT_NAME_USERPREFS "MLN" + // #define SPLASH_TITLE_USERPREFS "DEFCONtastic" // #define icon_width 34 // #define icon_height 29 From 15e6d7bad265fe87b11f49d3417d7db51506241a Mon Sep 17 00:00:00 2001 From: GUVWAF Date: Sun, 11 Aug 2024 17:23:44 +0200 Subject: [PATCH 3/3] Add new STM32WL-based hardware models --- src/platform/stm32wl/architecture.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/platform/stm32wl/architecture.h b/src/platform/stm32wl/architecture.h index 89df68da9f..325a192a44 100644 --- a/src/platform/stm32wl/architecture.h +++ b/src/platform/stm32wl/architecture.h @@ -16,8 +16,11 @@ // // set HW_VENDOR // - -#ifndef HW_VENDOR +#ifdef _VARIANT_WIOE5_ +#define HW_VENDOR meshtastic_HardwareModel_WIO_E5 +#elif defined(_VARIANT_RAK3172_) +#define HW_VENDOR meshtastic_HardwareModel_RAK3172 +#else #define HW_VENDOR meshtastic_HardwareModel_PRIVATE_HW #endif @@ -25,4 +28,4 @@ #define SX126X_CS 1000 #define SX126X_DIO1 1001 #define SX126X_RESET 1003 -#define SX126X_BUSY 1004 +#define SX126X_BUSY 1004 \ No newline at end of file