From 1d756ae574101b2a6372fedbfe8f9bd2b6d0dcdf Mon Sep 17 00:00:00 2001 From: Eric Severance Date: Thu, 9 Jan 2025 16:25:25 -0800 Subject: [PATCH 1/2] Fix potential memory leak in AtakPluginModule (#5803) --- src/modules/AtakPluginModule.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/AtakPluginModule.cpp b/src/modules/AtakPluginModule.cpp index d242e5501..a51ef54c3 100644 --- a/src/modules/AtakPluginModule.cpp +++ b/src/modules/AtakPluginModule.cpp @@ -131,7 +131,6 @@ void AtakPluginModule::alterReceivedProtobuf(meshtastic_MeshPacket &mp, meshtast } // Decompress for Phone (EUD) - auto decompressedCopy = packetPool.allocCopy(mp); auto uncompressed = cloneTAKPacketData(t); uncompressed.is_compressed = false; if (t->has_contact) { @@ -188,6 +187,7 @@ void AtakPluginModule::alterReceivedProtobuf(meshtastic_MeshPacket &mp, meshtast LOG_DEBUG("Decompressed chat to_callsign: %d bytes", length); } } + auto decompressedCopy = packetPool.allocCopy(mp); decompressedCopy->decoded.payload.size = pb_encode_to_bytes(decompressedCopy->decoded.payload.bytes, sizeof(decompressedCopy->decoded.payload), meshtastic_TAKPacket_fields, &uncompressed); From 2e44de262e2be2fcdb8a11044a47099dc8799ba4 Mon Sep 17 00:00:00 2001 From: Bernd Giesecke Date: Fri, 10 Jan 2025 09:20:38 +0800 Subject: [PATCH 2/2] Add GPS capability to RAK2560 (RAKwireless WisMesh Hub) (#5797) * Add GPS to RAK2560 * Add GPS to RAK2560 --- src/gps/GPS.cpp | 4 ++++ variants/rak2560/platformio.ini | 1 - 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/gps/GPS.cpp b/src/gps/GPS.cpp index e88e774bd..863f956cf 100644 --- a/src/gps/GPS.cpp +++ b/src/gps/GPS.cpp @@ -35,7 +35,11 @@ template std::size_t array_count(const T (&)[N]) } #if defined(NRF52840_XXAA) || defined(NRF52833_XXAA) || defined(ARCH_ESP32) || defined(ARCH_PORTDUINO) +#if defined(RAK2560) +HardwareSerial *GPS::_serial_gps = &Serial2; +#else HardwareSerial *GPS::_serial_gps = &Serial1; +#endif #elif defined(ARCH_RP2040) SerialUART *GPS::_serial_gps = &Serial1; #else diff --git a/variants/rak2560/platformio.ini b/variants/rak2560/platformio.ini index 93c7acf71..96c1bfa92 100644 --- a/variants/rak2560/platformio.ini +++ b/variants/rak2560/platformio.ini @@ -6,7 +6,6 @@ board_check = true build_flags = ${nrf52840_base.build_flags} -Ivariants/rak2560 -D RAK_4631 -L "${platformio.libdeps_dir}/${this.__env__}/bsec2/src/cortex-m4/fpv4-sp-d16-hard" -DGPS_POWER_TOGGLE ; comment this line to disable triple press function on the user button to turn off gps entirely. - -DMESHTASTIC_EXCLUDE_GPS=1 -DHAS_RAKPROT=1 ; Define if RAk OneWireSerial is used (disables GPS) build_src_filter = ${nrf52_base.build_src_filter} +<../variants/rak2560> + + + lib_deps =