From 8daebf80dd958e55ea3dae22a32ceb13f8aa1463 Mon Sep 17 00:00:00 2001 From: Mictronics Date: Sat, 10 Aug 2024 19:32:52 +0200 Subject: [PATCH 1/4] Fix warning: extra tokens at end of #endif directive. (#4432) --- src/modules/AdminModule.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/modules/AdminModule.cpp b/src/modules/AdminModule.cpp index 778b7193d..25450992b 100644 --- a/src/modules/AdminModule.cpp +++ b/src/modules/AdminModule.cpp @@ -828,7 +828,8 @@ void AdminModule::handleGetDeviceConnectionStatus(const meshtastic_MeshPacket &r conn.serial.is_connected = powerFSM.getState() == &stateSERIAL; #else conn.serial.is_connected = powerFSM.getState(); -#endif conn.serial.baud = SERIAL_BAUD; +#endif + conn.serial.baud = SERIAL_BAUD; r.get_device_connection_status_response = conn; r.which_payload_variant = meshtastic_AdminMessage_get_device_connection_status_response_tag; From cf392a4c201f03361563fbcf54caf303d0617fd6 Mon Sep 17 00:00:00 2001 From: Tom Fifield Date: Sun, 11 Aug 2024 20:06:38 +0800 Subject: [PATCH 2/4] Address some FIXME comments (#4435) * Address some FIXME comments These comments have since been addressed by more modern code. Remove them to reduce the clutter in the codebase. * Remove 'dumb idea' from SimpleAllocator 4 year old code that was set never to run can probably be safely deleted. --- src/gps/GPS.h | 2 +- src/main.h | 10 ++----- src/platform/esp32/SimpleAllocator.cpp | 38 -------------------------- 3 files changed, 3 insertions(+), 47 deletions(-) diff --git a/src/gps/GPS.h b/src/gps/GPS.h index 1c0977bdd..96171cba5 100644 --- a/src/gps/GPS.h +++ b/src/gps/GPS.h @@ -51,7 +51,7 @@ enum GPSPowerState : uint8_t { const char *getDOPString(uint32_t dop); /** - * A gps class that only reads from the GPS periodically (and FIXME - eventually keeps the gps powered down except when reading) + * A gps class that only reads from the GPS periodically and keeps the gps powered down except when reading * * When new data is available it will notify observers. */ diff --git a/src/main.h b/src/main.h index ea2d80f94..52a3fff1f 100644 --- a/src/main.h +++ b/src/main.h @@ -65,12 +65,6 @@ extern bool isVibrating; extern int TCPPort; // set by Portduino -// extern Observable newPowerStatus; //TODO: move this to main-esp32.cpp somehow or a helper class - -// extern meshtastic::PowerStatus *powerStatus; -// extern meshtastic::GPSStatus *gpsStatus; -// extern meshtastic::NodeStatusHandler *nodeStatusHandler; - // Return a human readable string of the form "Meshtastic_ab13" const char *getDeviceName(); @@ -91,5 +85,5 @@ void nrf52Setup(), esp32Setup(), nrf52Loop(), esp32Loop(), rp2040Setup(), clearB meshtastic_DeviceMetadata getDeviceMetadata(); -// FIXME, we default to 4MHz SPI, SPI mode 0, check if the datasheet says it can really do that -extern SPISettings spiSettings; \ No newline at end of file +// We default to 4MHz SPI, SPI mode 0 +extern SPISettings spiSettings; diff --git a/src/platform/esp32/SimpleAllocator.cpp b/src/platform/esp32/SimpleAllocator.cpp index 63f3b02de..04ce35eb3 100644 --- a/src/platform/esp32/SimpleAllocator.cpp +++ b/src/platform/esp32/SimpleAllocator.cpp @@ -26,41 +26,3 @@ void *operator new(size_t size, SimpleAllocator &p) { return p.alloc(size); } - -#if 0 -// This was a dumb idea, turn off for now - -SimpleAllocator *activeAllocator; - -AllocatorScope::AllocatorScope(SimpleAllocator &a) -{ - assert(!activeAllocator); - activeAllocator = &a; -} - -AllocatorScope::~AllocatorScope() -{ - assert(activeAllocator); - activeAllocator = NULL; -} - -/// Global new/delete, uses a simple allocator if it is in scope - -void *operator new(size_t sz) throw(std::bad_alloc) -{ - void *mem = activeAllocator ? activeAllocator->alloc(sz) : malloc(sz); - if (mem) - return mem; - else - throw std::bad_alloc(); -} - -void operator delete(void *ptr) throw() -{ - if (activeAllocator) - LOG_WARN("Leaking an active allocator object\n"); // We don't properly handle this yet - else - free(ptr); -} - -#endif \ No newline at end of file From 6cd1882aaa861ef44882d5e55a6c769d42edaccd Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 11 Aug 2024 17:22:01 -0500 Subject: [PATCH 3/4] [create-pull-request] automated change (#4439) Co-authored-by: GUVWAF <78759985+GUVWAF@users.noreply.github.com> --- protobufs | 2 +- src/mesh/generated/meshtastic/mesh.pb.h | 4 ++++ src/mesh/generated/meshtastic/telemetry.pb.h | 12 +++++++++--- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/protobufs b/protobufs index 2fa7d6a4b..071fd931e 160000 --- a/protobufs +++ b/protobufs @@ -1 +1 @@ -Subproject commit 2fa7d6a4b702fcd58b54b0d1d6e4b3b85164f649 +Subproject commit 071fd931ec6679bb21427c872f9839edea63e351 diff --git a/src/mesh/generated/meshtastic/mesh.pb.h b/src/mesh/generated/meshtastic/mesh.pb.h index 59664b792..1bea952ce 100644 --- a/src/mesh/generated/meshtastic/mesh.pb.h +++ b/src/mesh/generated/meshtastic/mesh.pb.h @@ -180,6 +180,10 @@ typedef enum _meshtastic_HardwareModel { meshtastic_HardwareModel_SENSECAP_INDICATOR = 70, /* Seeed studio T1000-E tracker card. NRF52840 w/ LR1110 radio, GPS, button, buzzer, and sensors. */ meshtastic_HardwareModel_TRACKER_T1000_E = 71, + /* RAK3172 STM32WLE5 Module (https://store.rakwireless.com/products/wisduo-lpwan-module-rak3172) */ + meshtastic_HardwareModel_RAK3172 = 72, + /* Seeed Studio Wio-E5 (either mini or Dev kit) using STM32WL chip. */ + meshtastic_HardwareModel_WIO_E5 = 73, /* ------------------------------------------------------------------------------------------------------------------------------------------ Reserved ID For developing private Ports. These will show up in live traffic sparsely, so we can use a high number. Keep it within 8 bits. ------------------------------------------------------------------------------------------------------------------------------------------ */ diff --git a/src/mesh/generated/meshtastic/telemetry.pb.h b/src/mesh/generated/meshtastic/telemetry.pb.h index 82cd0a55d..a4acd3f4a 100644 --- a/src/mesh/generated/meshtastic/telemetry.pb.h +++ b/src/mesh/generated/meshtastic/telemetry.pb.h @@ -63,7 +63,13 @@ typedef enum _meshtastic_TelemetrySensorType { /* DFRobot Lark Weather station (temperature, humidity, pressure, wind speed and direction) */ meshtastic_TelemetrySensorType_DFROBOT_LARK = 24, /* NAU7802 Scale Chip or compatible */ - meshtastic_TelemetrySensorType_NAU7802 = 25 + meshtastic_TelemetrySensorType_NAU7802 = 25, + /* BMP3XX High accuracy temperature and pressure */ + meshtastic_TelemetrySensorType_BMP3XX = 26, + /* ICM-20948 9-Axis digital motion processor */ + meshtastic_TelemetrySensorType_ICM20948 = 27, + /* MAX17048 1S lipo battery sensor (voltage, state of charge, time to go) */ + meshtastic_TelemetrySensorType_MAX17048 = 28 } meshtastic_TelemetrySensorType; /* Struct definitions */ @@ -197,8 +203,8 @@ extern "C" { /* Helper constants for enums */ #define _meshtastic_TelemetrySensorType_MIN meshtastic_TelemetrySensorType_SENSOR_UNSET -#define _meshtastic_TelemetrySensorType_MAX meshtastic_TelemetrySensorType_NAU7802 -#define _meshtastic_TelemetrySensorType_ARRAYSIZE ((meshtastic_TelemetrySensorType)(meshtastic_TelemetrySensorType_NAU7802+1)) +#define _meshtastic_TelemetrySensorType_MAX meshtastic_TelemetrySensorType_MAX17048 +#define _meshtastic_TelemetrySensorType_ARRAYSIZE ((meshtastic_TelemetrySensorType)(meshtastic_TelemetrySensorType_MAX17048+1)) From c74bce93607cd1749d7e8157089b6e1172f1b521 Mon Sep 17 00:00:00 2001 From: Ben Loomis Date: Mon, 12 Aug 2024 04:40:57 -0700 Subject: [PATCH 4/4] Detect UM600 as UC6580 (#4444) --- src/gps/GPS.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/gps/GPS.cpp b/src/gps/GPS.cpp index 82370937b..0164b554d 100644 --- a/src/gps/GPS.cpp +++ b/src/gps/GPS.cpp @@ -1220,6 +1220,14 @@ GnssModel_t GPS::probe(int serialSpeed) return GNSS_MODEL_UC6580; } + clearBuffer(); + _serial_gps->write("$PDTINFO\r\n"); + delay(750); + if (getACK("UM600", 500) == GNSS_RESPONSE_OK) { + LOG_INFO("UM600 detected, using UC6580 Module\n"); + return GNSS_MODEL_UC6580; + } + // Get version information for ATGM336H clearBuffer(); _serial_gps->write("$PCAS06,1*1A\r\n"); @@ -1822,4 +1830,4 @@ void GPS::toggleGpsMode() enable(); } } -#endif // Exclude GPS +#endif // Exclude GPS \ No newline at end of file