merge ifdef refactoring (pr #313)
This commit is contained in:
commit
4f9651c401
32 files changed
+726
-152
No files matched your search
@@ -1,9 +1,15 @@
|
||||
#ifndef _BME680MEMS_H
|
||||
#define _BME680MEMS_H
|
||||
#ifndef _BMESENSOR_H
|
||||
#define _BMESENSOR_H
|
||||
|
||||
#include "globals.h"
|
||||
#include <Wire.h>
|
||||
|
||||
#ifdef HAS_BME680
|
||||
#include "../lib/Bosch-BSEC/src/bsec.h"
|
||||
#elif defined HAS_BME280
|
||||
#include <Adafruit_Sensor.h>
|
||||
#include <Adafruit_BME280.h>
|
||||
#endif
|
||||
|
||||
extern bmeStatus_t
|
||||
bme_status; // Make struct for storing gps data globally available
|
||||
+2
-2
@@ -9,8 +9,8 @@
|
||||
#include <lmic.h>
|
||||
#endif
|
||||
|
||||
#if(HAS_BME)
|
||||
#include "bme680mems.h"
|
||||
#if (HAS_BME)
|
||||
#include "bmesensor.h"
|
||||
#endif
|
||||
|
||||
extern Ticker housekeeper;
|
||||
|
||||
+3
-3
@@ -5,7 +5,7 @@
|
||||
#include <Arduino.h>
|
||||
|
||||
// Time functions
|
||||
#include <Time.h>
|
||||
#include "microTime.h"
|
||||
#include <Timezone.h>
|
||||
#include <RtcDateTime.h>
|
||||
#include <Ticker.h>
|
||||
@@ -151,8 +151,8 @@ extern time_t userUTCTime;
|
||||
#include "sensor.h"
|
||||
#endif
|
||||
|
||||
#if(HAS_BME)
|
||||
#include "bme680mems.h"
|
||||
#if (HAS_BME)
|
||||
#include "bmesensor.h"
|
||||
#endif
|
||||
|
||||
#endif
|
||||
+2
-2
@@ -4,8 +4,8 @@
|
||||
#include "globals.h"
|
||||
#include "rcommand.h"
|
||||
#include "timekeeper.h"
|
||||
#if(DBTIMESYNC)
|
||||
#include "DBtimesync.h"
|
||||
#if(TIME_SYNC_TIMESERVER)
|
||||
#include "timesync.h"
|
||||
#endif
|
||||
|
||||
// LMIC-Arduino LoRaWAN Stack
|
||||
|
||||
+5
-3
@@ -16,11 +16,12 @@
|
||||
#define LPP_MSG_CHANNEL 28
|
||||
#define LPP_HUMIDITY_CHANNEL 29
|
||||
#define LPP_BAROMETER_CHANNEL 30
|
||||
#define LPP_AIR_CHANNEL 31
|
||||
#define LPP_AIR_CHANNEL 31
|
||||
|
||||
#endif
|
||||
|
||||
// MyDevices CayenneLPP 2.0 types for Packed Sensor Payload, not using channels, but different FPorts
|
||||
// MyDevices CayenneLPP 2.0 types for Packed Sensor Payload, not using channels,
|
||||
// but different FPorts
|
||||
#define LPP_GPS 136 // 3 byte lon/lat 0.0001 °, 3 bytes alt 0.01m
|
||||
#define LPP_TEMPERATURE 103 // 2 bytes, 0.1°C signed MSB
|
||||
#define LPP_DIGITAL_INPUT 0 // 1 byte
|
||||
@@ -40,6 +41,7 @@ public:
|
||||
void reset(void);
|
||||
uint8_t getSize(void);
|
||||
uint8_t *getBuffer(void);
|
||||
void addByte(uint8_t value);
|
||||
void addCount(uint16_t value, uint8_t sniffytpe);
|
||||
void addConfig(configData_t value);
|
||||
void addStatus(uint16_t voltage, uint64_t uptime, float cputemp, uint32_t mem,
|
||||
@@ -72,7 +74,7 @@ private:
|
||||
void writeFloat(float value);
|
||||
void writeUFloat(float value);
|
||||
void writePressure(float value);
|
||||
void writeVersion(char * version);
|
||||
void writeVersion(char *version);
|
||||
void writeBitmap(bool a, bool b, bool c, bool d, bool e, bool f, bool g,
|
||||
bool h);
|
||||
|
||||
|
||||
+2
-2
@@ -11,8 +11,8 @@
|
||||
#include <rom/rtc.h>
|
||||
#include "cyclic.h"
|
||||
#include "timekeeper.h"
|
||||
#if(DBTIMESYNC)
|
||||
#include "DBtimesync.h"
|
||||
#if(TIME_SYNC_TIMESERVER)
|
||||
#include "timesync.h"
|
||||
#endif
|
||||
|
||||
// table of remote commands and assigned functions
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
#ifndef _TIME_SYNC_TIMESERVER_H
|
||||
#define _TIME_SYNC_TIMESERVER_H
|
||||
|
||||
#include <chrono>
|
||||
#include "globals.h"
|
||||
#include "timesync.h"
|
||||
#include "timekeeper.h"
|
||||
|
||||
#define TIME_SYNC_SAMPLES 3 // number of time requests for averaging
|
||||
#define TIME_SYNC_CYCLE 20 // seconds between two time requests
|
||||
#define TIME_SYNC_TIMEOUT 120 // timeout seconds waiting for timeserver answer
|
||||
#define TIME_SYNC_TRIGGER 1 // time deviation threshold triggering time sync
|
||||
#define TIME_SYNC_FRAME_LENGTH 0x06 // timeserver answer frame length
|
||||
|
||||
void send_timesync_req(void);
|
||||
void recv_timesync_ans(uint8_t buf[], uint8_t buf_len);
|
||||
void process_timesync_req(void *taskparameter);
|
||||
void store_time_sync_req(time_t secs, uint32_t micros);
|
||||
|
||||
#endif
|
||||
Reference in new issue
Block a user