diff --git a/protobufs b/protobufs index 2fa7d6a4b7..071fd931ec 160000 --- a/protobufs +++ b/protobufs @@ -1 +1 @@ -Subproject commit 2fa7d6a4b702fcd58b54b0d1d6e4b3b85164f649 +Subproject commit 071fd931ec6679bb21427c872f9839edea63e351 diff --git a/src/gps/GPS.cpp b/src/gps/GPS.cpp index 82370937bb..0164b554d8 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 diff --git a/src/gps/GPS.h b/src/gps/GPS.h index 1c0977bddd..96171cba52 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 ea2d80f94a..52a3fff1f8 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/mesh/generated/meshtastic/mesh.pb.h b/src/mesh/generated/meshtastic/mesh.pb.h index 59664b792f..1bea952cea 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 82cd0a55d9..a4acd3f4a4 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)) diff --git a/src/platform/esp32/SimpleAllocator.cpp b/src/platform/esp32/SimpleAllocator.cpp index 63f3b02de0..04ce35eb32 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