Skip to content

Commit

Permalink
Merge branch 'meshtastic:master' into ben/fix-heltec-tracker-gps
Browse files Browse the repository at this point in the history
  • Loading branch information
brloomis authored Aug 12, 2024
2 parents 1f7242e + 6cd1882 commit 8e7d711
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 52 deletions.
2 changes: 1 addition & 1 deletion protobufs
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
3 changes: 2 additions & 1 deletion src/modules/AdminModule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
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 8e7d711

Please sign in to comment.