Merge branch 'development' into master
This commit is contained in:
25 files changed
+553
-88
No files matched your search
@@ -11,6 +11,11 @@
|
||||
#include "bme680mems.h"
|
||||
#endif
|
||||
|
||||
// Needed for RTC time sync if RTC present on board
|
||||
#ifdef HAS_RTC
|
||||
#include "rtctime.h"
|
||||
#endif
|
||||
|
||||
void doHousekeeping(void);
|
||||
void do_timesync(void);
|
||||
uint64_t uptime(void);
|
||||
|
||||
+8
-1
@@ -9,7 +9,6 @@
|
||||
#include <array>
|
||||
#include <algorithm>
|
||||
#include "mallocator.h"
|
||||
//#include "inc/bsec_datatypes.h"
|
||||
#include "../lib/Bosch-BSEC/src/inc/bsec_datatypes.h"
|
||||
|
||||
// sniffing types
|
||||
@@ -36,6 +35,10 @@
|
||||
#define BLE_MODE (0x40)
|
||||
#define SCREEN_MODE (0x80)
|
||||
|
||||
// I2C bus access control
|
||||
#define I2C_MUTEX_LOCK() xSemaphoreTake(I2Caccess, (DISPLAYREFRESH_MS / portTICK_PERIOD_MS)) == pdTRUE
|
||||
#define I2C_MUTEX_UNLOCK() xSemaphoreGive(I2Caccess)
|
||||
|
||||
// Struct holding devices's runtime configuration
|
||||
typedef struct {
|
||||
uint8_t lorasf; // 7-12, lora spreadfactor
|
||||
@@ -137,4 +140,8 @@ extern TaskHandle_t irqHandlerTask, wifiSwitchTask;
|
||||
#include "bme680mems.h"
|
||||
#endif
|
||||
|
||||
#ifdef HAS_IF482
|
||||
#include "if482.h"
|
||||
#endif
|
||||
|
||||
#endif
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
#define _GPSREAD_H
|
||||
|
||||
#include <TinyGPS++.h> // library for parsing NMEA data
|
||||
#include <TimeLib.h>
|
||||
#include <Time.h>
|
||||
|
||||
#ifdef GPS_I2C // Needed for reading from I2C Bus
|
||||
#include <Wire.h>
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
#ifndef _IF482_H
|
||||
#define _IF482_H
|
||||
|
||||
#include "globals.h"
|
||||
#include "irqhandler.h"
|
||||
|
||||
extern TaskHandle_t IF482Task;
|
||||
|
||||
int if482_init(void);
|
||||
void if482_loop(void *pvParameters);
|
||||
void IRAM_ATTR IF482IRQ(void);
|
||||
|
||||
#endif
|
||||
@@ -25,4 +25,4 @@ void IRAM_ATTR DisplayIRQ();
|
||||
void IRAM_ATTR ButtonIRQ();
|
||||
#endif
|
||||
|
||||
#endif
|
||||
#endif
|
||||
@@ -17,6 +17,11 @@
|
||||
#include <Wire.h>
|
||||
#endif
|
||||
|
||||
// Needed for RTC time sync if RTC present on board
|
||||
#ifdef HAS_RTC
|
||||
#include "rtctime.h"
|
||||
#endif
|
||||
|
||||
extern QueueHandle_t LoraSendQueue;
|
||||
|
||||
void onEvent(ev_t ev);
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
#ifndef _RTCTIME_H
|
||||
#define _RTCTIME_H
|
||||
|
||||
#include "globals.h"
|
||||
#include <Time.h>
|
||||
#include <Timezone.h>
|
||||
#include <Wire.h> // must be included here so that Arduino library object file references work
|
||||
#include <RtcDS3231.h>
|
||||
|
||||
#ifdef HAS_GPS
|
||||
#include "gpsread.h"
|
||||
#endif
|
||||
|
||||
typedef enum {
|
||||
useless = 0, // waiting for good enough signal
|
||||
dirty = 1, // time data available but inconfident
|
||||
reserve = 2, // clock was once synced but now may deviate
|
||||
synced_LORA = 3, // clock driven by LORAWAN network
|
||||
synced_GPS = 4 // best possible quality, clock is driven by GPS
|
||||
} clock_state_t;
|
||||
|
||||
extern RtcDS3231<TwoWire> Rtc; // make RTC instance globally available
|
||||
extern Timezone myTZ; // make Timezone myTZ globally available
|
||||
|
||||
int rtc_init(void);
|
||||
int set_rtctime(uint32_t UTCTime);
|
||||
int set_rtctime(RtcDateTime now);
|
||||
void sync_rtctime(void);
|
||||
time_t get_rtctime(void);
|
||||
float get_rtctemp(void);
|
||||
|
||||
#endif // _RTCTIME_H
|
||||
Reference in new issue
Block a user