Skip to content

Commit 3bd1dc3

Browse files
author
Scott Powell
committed
* minor tidy ups
1 parent 7c9cf2a commit 3bd1dc3

File tree

2 files changed

+14
-25
lines changed

2 files changed

+14
-25
lines changed

variants/rak4631/target.cpp

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,14 @@ RAK4631SensorManager sensors;
2525
#endif
2626
#include <bsec2.h>
2727
static Bsec2 BME680;
28-
float rawPressure = 0;
29-
float rawTemperature = 0;
30-
float compTemperature = 0;
31-
float rawHumidity = 0;
32-
float compHumidity = 0;
33-
float readIAQ = 0;
34-
float readStaticIAQ = 0;
35-
float readCO2 = 0;
28+
static float rawPressure = 0;
29+
static float rawTemperature = 0;
30+
static float compTemperature = 0;
31+
static float rawHumidity = 0;
32+
static float compHumidity = 0;
33+
static float readIAQ = 0;
34+
static float readStaticIAQ = 0;
35+
static float readCO2 = 0;
3636
#endif
3737

3838
#ifdef DISPLAY_CLASS
@@ -41,7 +41,7 @@ float readCO2 = 0;
4141

4242
#ifdef MESH_DEBUG
4343
uint32_t deviceOnline = 0x00;
44-
void scanDevices(TwoWire *w)
44+
static void scanDevices(TwoWire *w)
4545
{
4646
uint8_t err, addr;
4747
int nDevices = 0;
@@ -168,8 +168,7 @@ bool RAK4631SensorManager::gpsIsAwake(uint32_t ioPin){
168168
#endif
169169

170170
#if ENV_INCLUDE_BME680
171-
void checkBMEStatus(Bsec2 bsec)
172-
{
171+
static void checkBMEStatus(Bsec2 bsec) {
173172
if (bsec.status < BSEC_OK)
174173
{
175174
MESH_DEBUG_PRINTLN("BSEC error code : %f", float(bsec.status));
@@ -188,17 +187,15 @@ void checkBMEStatus(Bsec2 bsec)
188187
MESH_DEBUG_PRINTLN("BME68X warning code : %f", bsec.sensor.status);
189188
}
190189
}
191-
void newDataCallback(const bme68xData data, const bsecOutputs outputs, Bsec2 bsec)
192-
{
193-
if (!outputs.nOutputs)
194-
{
190+
191+
static void newDataCallback(const bme68xData data, const bsecOutputs outputs, Bsec2 bsec) {
192+
if (!outputs.nOutputs) {
195193
MESH_DEBUG_PRINTLN("No new data to report out");
196194
return;
197195
}
198196

199197
MESH_DEBUG_PRINTLN("BSEC outputs:\n\tTime stamp = %f", (int) (outputs.output[0].time_stamp / INT64_C(1000000)));
200-
for (uint8_t i = 0; i < outputs.nOutputs; i++)
201-
{
198+
for (uint8_t i = 0; i < outputs.nOutputs; i++) {
202199
const bsecData output = outputs.output[i];
203200
switch (output.sensor_id)
204201
{

variants/rak4631/target.h

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,6 @@
1111
#include <helpers/sensors/LocationProvider.h>
1212
#include <SparkFun_u-blox_GNSS_Arduino_Library.h>
1313
#endif
14-
#if ENV_INCLUDE_BME680
15-
#include "bsec2.h"
16-
#endif
1714
#ifdef DISPLAY_CLASS
1815
#include <helpers/ui/SSD1306Display.h>
1916
#endif
@@ -84,11 +81,6 @@ enum {
8481
RAK12500_ONLINE = _BV(14),
8582
};
8683

87-
#if ENV_INCLUDE_BME680
88-
void newDataCallback(const bme68xData data, const bsecOutputs outputs, Bsec2 bsec);
89-
void checkBMEStatus(Bsec2 bsec);
90-
#endif
91-
9284
bool radio_init();
9385
uint32_t radio_get_rng_seed();
9486
void radio_set_params(float freq, float bw, uint8_t sf, uint8_t cr);

0 commit comments

Comments
 (0)