* new helper: AutoDiscoverRTCClock, which detects: DS3231 (on i2c addr 0x68), or RV3028 (on i2c addr 0x52)
* repeater and room server: ver bump (v5), now use AutoDiscoverRTCClock * various Board::begin() now should do Wire.begin(), with custom pin mappings if needed * examples removed: ping client/server, and test_admin
This commit is contained in:
17
src/helpers/AutoDiscoverRTCClock.h
Normal file
17
src/helpers/AutoDiscoverRTCClock.h
Normal file
@@ -0,0 +1,17 @@
|
||||
#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;
|
||||
};
|
||||
Reference in New Issue
Block a user