mirror of
https://github.com/meshcore-dev/MeshCore.git
synced 2026-04-20 22:13:47 +00:00
18 lines
404 B
C
18 lines
404 B
C
|
|
#pragma once
|
||
|
|
|
||
|
|
#include <Mesh.h>
|
||
|
|
#include <Arduino.h>
|
||
|
|
#include <Wire.h>
|
||
|
|
|
||
|
|
class AutoDiscoverRTCClock : public mesh::RTCClock {
|
||
|
|
mesh::RTCClock* _fallback;
|
||
|
|
|
||
|
|
bool i2c_probe(TwoWire& wire, uint8_t addr);
|
||
|
|
public:
|
||
|
|
AutoDiscoverRTCClock(mesh::RTCClock& fallback) : _fallback(&fallback) { }
|
||
|
|
|
||
|
|
void begin(TwoWire& wire);
|
||
|
|
uint32_t getCurrentTime() override;
|
||
|
|
void setCurrentTime(uint32_t time) override;
|
||
|
|
};
|