I don't like this formatting but I need trunk to STFU

This commit is contained in:
Ben Meadors
2023-01-18 14:51:48 -06:00
parent b218ea9ec7
commit 9046dacec8
39 changed files with 802 additions and 780 deletions

View File

@@ -1,15 +1,13 @@
#include "../mesh/generated/meshtastic/telemetry.pb.h"
#include "configuration.h"
#include "TelemetrySensor.h"
#include "INA260Sensor.h"
#include "../mesh/generated/meshtastic/telemetry.pb.h"
#include "TelemetrySensor.h"
#include "configuration.h"
#include <Adafruit_INA260.h>
INA260Sensor::INA260Sensor() :
TelemetrySensor(TelemetrySensorType_INA260, "INA260")
{
}
INA260Sensor::INA260Sensor() : TelemetrySensor(TelemetrySensorType_INA260, "INA260") {}
int32_t INA260Sensor::runOnce() {
int32_t INA260Sensor::runOnce()
{
LOG_INFO("Init sensor: %s\n", sensorName);
if (!hasSensor()) {
return DEFAULT_SENSOR_MINIMUM_WAIT_TIME_BETWEEN_READS;
@@ -18,13 +16,12 @@ int32_t INA260Sensor::runOnce() {
return initI2CSensor();
}
void INA260Sensor::setup()
{
}
void INA260Sensor::setup() {}
bool INA260Sensor::getMetrics(Telemetry *measurement) {
bool INA260Sensor::getMetrics(Telemetry *measurement)
{
// mV conversion to V
measurement->variant.environment_metrics.voltage = ina260.readBusVoltage() / 1000;
measurement->variant.environment_metrics.current = ina260.readCurrent();
return true;
}
}