Skip to content

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
caveman99 authored Jun 17, 2024
2 parents 30b14c5 + e718198 commit 275e393
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 13 deletions.
2 changes: 1 addition & 1 deletion src/input/InputBroker.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include "InputBroker.h"
#include "PowerFSM.h" // needed for event trigger

InputBroker *inputBroker;
InputBroker *inputBroker = nullptr;

InputBroker::InputBroker(){};

Expand Down
2 changes: 1 addition & 1 deletion src/input/cardKbI2cImpl.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "cardKbI2cImpl.h"
#include "InputBroker.h"
#include "detect/ScanI2C.h"
#include "main.h"
#include "detect/ScanI2CTwoWire.h"

CardKbI2cImpl *cardKbI2cImpl;
Expand Down
1 change: 0 additions & 1 deletion src/input/cardKbI2cImpl.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#pragma once
#include "kbI2cBase.h"
#include "main.h"

/**
* @brief The idea behind this class to have static methods for the event handlers.
Expand Down
13 changes: 7 additions & 6 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,14 @@
#endif
#if !MESHTASTIC_EXCLUDE_BLUETOOTH
#include "nimble/NimbleBluetooth.h"
NimbleBluetooth *nimbleBluetooth;
NimbleBluetooth *nimbleBluetooth = nullptr;
#endif
#endif

#ifdef ARCH_NRF52
#include "NRF52Bluetooth.h"
NRF52Bluetooth *nrf52Bluetooth;
NRF52Bluetooth *nrf52Bluetooth = nullptr;
;
#endif

#if HAS_WIFI
Expand Down Expand Up @@ -94,23 +95,23 @@ NRF52Bluetooth *nrf52Bluetooth;
#include "ButtonThread.h"
#endif

#include "AmbientLightingThread.h"
#include "PowerFSMThread.h"

#if !defined(ARCH_PORTDUINO) && !defined(ARCH_STM32WL) && !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR
#include "AccelerometerThread.h"
#include "AmbientLightingThread.h"
AccelerometerThread *accelerometerThread;
AccelerometerThread *accelerometerThread = nullptr;
#endif

#ifdef HAS_I2S
#include "AudioThread.h"
AudioThread *audioThread;
AudioThread *audioThread = nullptr;
#endif

using namespace concurrency;

// We always create a screen object, but we only init it if we find the hardware
graphics::Screen *screen;
graphics::Screen *screen = nullptr;

// Global power status
meshtastic::PowerStatus *powerStatus = new meshtastic::PowerStatus();
Expand Down
1 change: 1 addition & 0 deletions src/modules/Modules.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
#include "modules/Telemetry/DeviceTelemetry.h"
#endif
#if HAS_SENSOR && !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR
#include "main.h"
#include "modules/Telemetry/AirQualityTelemetry.h"
#include "modules/Telemetry/EnvironmentTelemetry.h"
#endif
Expand Down
11 changes: 8 additions & 3 deletions src/modules/Telemetry/Sensor/OPT3001Sensor.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
#include "OPT3001Sensor.h"
#include "configuration.h"

#if !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR

#include "../mesh/generated/meshtastic/telemetry.pb.h"
#include "OPT3001Sensor.h"
#include "TelemetrySensor.h"
#include "configuration.h"
#include <ClosedCube_OPT3001.h>

OPT3001Sensor::OPT3001Sensor() : TelemetrySensor(meshtastic_TelemetrySensorType_OPT3001, "OPT3001") {}
Expand Down Expand Up @@ -41,4 +44,6 @@ bool OPT3001Sensor::getMetrics(meshtastic_Telemetry *measurement)
LOG_INFO("Lux: %f\n", measurement->variant.environment_metrics.lux);

return true;
}
}

#endif
9 changes: 8 additions & 1 deletion src/modules/Telemetry/Sensor/OPT3001Sensor.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
#pragma once
#include "configuration.h"

#if !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR

#include "../mesh/generated/meshtastic/telemetry.pb.h"
#include "TelemetrySensor.h"
#include <ClosedCube_OPT3001.h>
Expand All @@ -14,4 +19,6 @@ class OPT3001Sensor : public TelemetrySensor
OPT3001Sensor();
virtual int32_t runOnce() override;
virtual bool getMetrics(meshtastic_Telemetry *measurement) override;
};
};

#endif

0 comments on commit 275e393

Please sign in to comment.