Merge branch 'master' into development
This commit is contained in:
commit
edf29e03c9
@ -78,8 +78,8 @@ lib_deps_sensors =
|
|||||||
lib_deps_basic =
|
lib_deps_basic =
|
||||||
greyrook/libpax @ ^1.1.0
|
greyrook/libpax @ ^1.1.0
|
||||||
https://github.com/SukkoPera/Arduino-Rokkit-Hash.git
|
https://github.com/SukkoPera/Arduino-Rokkit-Hash.git
|
||||||
bblanchon/ArduinoJson @ ^6.21.0
|
bblanchon/ArduinoJson @ ^6.21.2
|
||||||
makuna/RTC @ ^2.3.6
|
makuna/RTC @ ^2.3.7
|
||||||
mathertel/OneButton @ ^2.0.3
|
mathertel/OneButton @ ^2.0.3
|
||||||
lewisxhe/XPowersLib @ ^0.1.5
|
lewisxhe/XPowersLib @ ^0.1.5
|
||||||
256dpi/MQTT @ ^2.5.1
|
256dpi/MQTT @ ^2.5.1
|
||||||
|
@ -456,7 +456,7 @@ void setup() {
|
|||||||
#endif // HAS_BUTTON
|
#endif // HAS_BUTTON
|
||||||
|
|
||||||
// only if we have a timesource we do timesync
|
// only if we have a timesource we do timesync
|
||||||
#if ((HAS_LORA_TIME) || (HAS_GPS) || (HAS_RTC))
|
#if ((HAS_LORA_TIME) || (HAS_GPS) || defined HAS_RTC)
|
||||||
time_init();
|
time_init();
|
||||||
strcat_P(features, " TIME");
|
strcat_P(features, " TIME");
|
||||||
#endif // timesync
|
#endif // timesync
|
||||||
|
@ -8,7 +8,7 @@ RtcDS3231<TwoWire> Rtc(Wire); // RTC hardware i2c interface
|
|||||||
// initialize RTC
|
// initialize RTC
|
||||||
uint8_t rtc_init(void) {
|
uint8_t rtc_init(void) {
|
||||||
Wire.begin(HAS_RTC);
|
Wire.begin(HAS_RTC);
|
||||||
Rtc.Begin(MY_DISPLAY_SDA, MY_DISPLAY_SCL);
|
Rtc.Begin(HAS_RTC);
|
||||||
|
|
||||||
// configure RTC chip
|
// configure RTC chip
|
||||||
Rtc.Enable32kHzPin(false);
|
Rtc.Enable32kHzPin(false);
|
||||||
@ -22,7 +22,7 @@ uint8_t rtc_init(void) {
|
|||||||
#if (TIME_SYNC_COMPILEDATE)
|
#if (TIME_SYNC_COMPILEDATE)
|
||||||
// initialize a blank RTC without battery backup with build time
|
// initialize a blank RTC without battery backup with build time
|
||||||
RtcDateTime tt = Rtc.GetDateTime();
|
RtcDateTime tt = Rtc.GetDateTime();
|
||||||
time_t t = tt.Epoch32Time(); // sec2000 -> epoch
|
time_t t = tt.Unix32Time(); // sec2000 -> epoch
|
||||||
|
|
||||||
if (!Rtc.IsDateTimeValid() || !timeIsValid(t)) {
|
if (!Rtc.IsDateTimeValid() || !timeIsValid(t)) {
|
||||||
ESP_LOGW(TAG, "RTC has no recent time, setting to compiletime");
|
ESP_LOGW(TAG, "RTC has no recent time, setting to compiletime");
|
||||||
@ -53,7 +53,7 @@ time_t get_rtctime(uint16_t *msec) {
|
|||||||
*msec = 0;
|
*msec = 0;
|
||||||
if (Rtc.IsDateTimeValid() && Rtc.GetIsRunning()) {
|
if (Rtc.IsDateTimeValid() && Rtc.GetIsRunning()) {
|
||||||
RtcDateTime tt = Rtc.GetDateTime();
|
RtcDateTime tt = Rtc.GetDateTime();
|
||||||
t = tt.Epoch32Time(); // sec2000 -> epoch
|
t = tt.Unix32Time(); // sec2000 -> epoch
|
||||||
}
|
}
|
||||||
|
|
||||||
// if we have a RTC pulse, we calculate msec
|
// if we have a RTC pulse, we calculate msec
|
||||||
|
@ -82,7 +82,7 @@ void calibrateTime(void) {
|
|||||||
return;
|
return;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if ((HAS_GPS) || (HAS_RTC))
|
#if ((HAS_GPS) || defined HAS_RTC)
|
||||||
time_t t = 0;
|
time_t t = 0;
|
||||||
uint16_t t_msec = 0;
|
uint16_t t_msec = 0;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user