Merge branch 'development' into bme280

This commit is contained in:
Verkehrsrot authored and GitHub committed 2019-03-13 20:23:14 +01:00
commit 3cc38abaea
24 files changed
+615 -121

No files matched your search

+1 -1
View File
@@ -5,7 +5,7 @@
#include <Arduino.h>
// Time functions
#include <Time.h>
#include "microTime.h"
#include <Timezone.h>
#include <RtcDateTime.h>
#include <Ticker.h>
+2 -2
View File
@@ -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
View File
@@ -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
View File
@@ -9,8 +9,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
+20
View File
@@ -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