Skip to content

Commit

Permalink
Merge branch 'meshtastic:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
Mictronics authored Aug 12, 2024
2 parents 072aaae + c74bce9 commit 5b92d38
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 52 deletions.
2 changes: 1 addition & 1 deletion protobufs
10 changes: 9 additions & 1 deletion src/gps/GPS.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down Expand Up @@ -1822,4 +1830,4 @@ void GPS::toggleGpsMode()
enable();
}
}
#endif // Exclude GPS
#endif // Exclude GPS
2 changes: 1 addition & 1 deletion src/gps/GPS.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/
Expand Down
10 changes: 2 additions & 8 deletions src/main.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,6 @@ extern bool isVibrating;

extern int TCPPort; // set by Portduino

// extern Observable<meshtastic::PowerStatus> 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();

Expand All @@ -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;
// We default to 4MHz SPI, SPI mode 0
extern SPISettings spiSettings;
4 changes: 4 additions & 0 deletions src/mesh/generated/meshtastic/mesh.pb.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
------------------------------------------------------------------------------------------------------------------------------------------ */
Expand Down
12 changes: 9 additions & 3 deletions src/mesh/generated/meshtastic/telemetry.pb.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down Expand Up @@ -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))



Expand Down
38 changes: 0 additions & 38 deletions src/platform/esp32/SimpleAllocator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 5b92d38

Please sign in to comment.