mirror of
https://github.com/meshcore-dev/MeshCore.git
synced 2026-03-30 14:55:46 +00:00
t-beam supreme: fixes and cleanup
Reverted the SensorManager changes Moved BME into TbeamSupSensorManager Moved printBMEValues into TbeamSupSensorManager Moved scanDevices out of TBeamS3SupremeBoard
This commit is contained in:
@@ -10,10 +10,10 @@
|
||||
|
||||
class SensorManager {
|
||||
public:
|
||||
double node_lat, node_lon, node_temp, node_hum, node_pres; // modify these, if you want to affect Advert location
|
||||
double node_lat, node_lon; // modify these, if you want to affect Advert location
|
||||
double node_altitude; // altitude in meters
|
||||
|
||||
SensorManager() { node_lat = 0; node_lon = 0; node_altitude = 0; node_temp = 0; node_hum = 0; node_pres = 0;}
|
||||
SensorManager() { node_lat = 0; node_lon = 0; node_altitude = 0;}
|
||||
virtual bool begin() { return false; }
|
||||
virtual bool querySensors(uint8_t requester_permissions, CayenneLPP& telemetry) { return false; }
|
||||
virtual void loop() { }
|
||||
|
||||
@@ -55,9 +55,7 @@ class TBeamS3SupremeBoard : public ESP32Board {
|
||||
XPowersAXP2101 PMU;
|
||||
public:
|
||||
#ifdef MESH_DEBUG
|
||||
void scanDevices(TwoWire *w);
|
||||
void printPMU();
|
||||
void printBMEValues();
|
||||
#endif
|
||||
bool power_init();
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
#include <Arduino.h>
|
||||
#include "target.h"
|
||||
#include <helpers/sensors/MicroNMEALocationProvider.h>
|
||||
#include <Adafruit_BME280.h>
|
||||
|
||||
TBeamS3SupremeBoard board;
|
||||
|
||||
@@ -10,7 +9,6 @@ TBeamS3SupremeBoard board;
|
||||
#endif
|
||||
|
||||
bool pmuIntFlag;
|
||||
//#define SEALEVELPRESSURE_HPA (1013.25)
|
||||
|
||||
#ifndef LORA_CR
|
||||
#define LORA_CR 5
|
||||
@@ -29,7 +27,6 @@ ESP32RTCClock fallback_clock;
|
||||
AutoDiscoverRTCClock rtc_clock(fallback_clock);
|
||||
MicroNMEALocationProvider nmea = MicroNMEALocationProvider(Serial1);
|
||||
TbeamSupSensorManager sensors = TbeamSupSensorManager(nmea);
|
||||
Adafruit_BME280 bme;
|
||||
|
||||
static void setPMUIntFlag(){
|
||||
pmuIntFlag = true;
|
||||
@@ -114,7 +111,7 @@ void TBeamS3SupremeBoard::printPMU()
|
||||
|
||||
Serial.println();
|
||||
}
|
||||
void printBMEValues() {
|
||||
void TbeamSupSensorManager::printBMEValues() {
|
||||
Serial.print("Temperature = ");
|
||||
Serial.print(bme.readTemperature());
|
||||
Serial.println(" *C");
|
||||
|
||||
@@ -8,15 +8,20 @@
|
||||
#include <helpers/AutoDiscoverRTCClock.h>
|
||||
#include <helpers/SensorManager.h>
|
||||
#include <helpers/sensors/LocationProvider.h>
|
||||
#include <Adafruit_BME280.h>
|
||||
|
||||
class TbeamSupSensorManager: public SensorManager {
|
||||
bool gps_active = false;
|
||||
LocationProvider * _nmea;
|
||||
|
||||
Adafruit_BME280 bme;
|
||||
double node_temp, node_hum, node_pres;
|
||||
|
||||
#define SEALEVELPRESSURE_HPA (1013.25)
|
||||
|
||||
void start_gps();
|
||||
void sleep_gps();
|
||||
public:
|
||||
TbeamSupSensorManager(LocationProvider &nmea): _nmea(&nmea) { }
|
||||
TbeamSupSensorManager(LocationProvider &nmea): _nmea(&nmea) {node_temp = 0; node_hum = 0; node_pres = 0;}
|
||||
bool begin() override;
|
||||
bool querySensors(uint8_t requester_permissions, CayenneLPP& telemetry) override;
|
||||
void loop() override;
|
||||
@@ -24,6 +29,11 @@ class TbeamSupSensorManager: public SensorManager {
|
||||
const char* getSettingName(int i) const override;
|
||||
const char* getSettingValue(int i) const override;
|
||||
bool setSettingValue(const char* name, const char* value) override;
|
||||
|
||||
#ifdef MESH_DEBUG
|
||||
void printBMEValues();
|
||||
#endif
|
||||
|
||||
};
|
||||
|
||||
extern TBeamS3SupremeBoard board;
|
||||
@@ -53,7 +63,8 @@ enum {
|
||||
OSC32768_ONLINE = _BV(13),
|
||||
};
|
||||
|
||||
bool power_init();
|
||||
void scanDevices(TwoWire *w);
|
||||
static bool l76kProbe();
|
||||
bool radio_init();
|
||||
uint32_t radio_get_rng_seed();
|
||||
void radio_set_params(float freq, float bw, uint8_t sf, uint8_t cr);
|
||||
|
||||
Reference in New Issue
Block a user