Feature RTC support added (experimental)

This commit is contained in:
Klaus K Wilting committed 2019-01-19 17:53:21 +01:00
1 parent 1efaf9a04e
commit a3414c5622
7 files changed
+159 -2

No files matched your search

+5
View File
@@ -11,6 +11,11 @@
#include "bme680mems.h"
#endif
// Needed for RTC time sync if RTC present on board
#ifdef HAS_RTC
#include "rtc.h"
#endif
void doHousekeeping(void);
void do_timesync(void);
uint64_t uptime(void);
+5
View File
@@ -17,6 +17,11 @@
#include <Wire.h>
#endif
// Needed for RTC time sync if RTC present on board
#ifdef HAS_RTC
#include "rtc.h"
#endif
extern QueueHandle_t LoraSendQueue;
void onEvent(ev_t ev);
+16
View File
@@ -0,0 +1,16 @@
#ifndef _RTC_H
#define _RTC_H
#include "globals.h"
#include <Wire.h> // must be included here so that Arduino library object file references work
#include <RtcDS3231.h>
extern RtcDS3231<TwoWire> Rtc; // Make RTCDS3231 instance globally availabe
int rtc_init(void);
int set_rtc(uint32_t UTCTime);
int set_rtc(RtcDateTime now);
uint32_t get_rtc();
float get_rtc_temp();
#endif