* refactor: rtc_clock now defined by variants/*/target modules
This commit is contained in:
@@ -1422,7 +1422,7 @@ public:
|
|||||||
|
|
||||||
StdRNG fast_rng;
|
StdRNG fast_rng;
|
||||||
SimpleMeshTables tables;
|
SimpleMeshTables tables;
|
||||||
MyMesh the_mesh(radio_driver, fast_rng, *new VolatileRTCClock(), tables);
|
MyMesh the_mesh(radio_driver, fast_rng, *new VolatileRTCClock(), tables); // TODO: test with 'rtc_clock' in target.cpp
|
||||||
|
|
||||||
void halt() {
|
void halt() {
|
||||||
while (1) ;
|
while (1) ;
|
||||||
|
|||||||
@@ -11,7 +11,6 @@
|
|||||||
#include <helpers/StaticPoolPacketManager.h>
|
#include <helpers/StaticPoolPacketManager.h>
|
||||||
#include <helpers/SimpleMeshTables.h>
|
#include <helpers/SimpleMeshTables.h>
|
||||||
#include <helpers/IdentityStore.h>
|
#include <helpers/IdentityStore.h>
|
||||||
#include <helpers/AutoDiscoverRTCClock.h>
|
|
||||||
#include <helpers/AdvertDataHelpers.h>
|
#include <helpers/AdvertDataHelpers.h>
|
||||||
#include <helpers/TxtDataHelpers.h>
|
#include <helpers/TxtDataHelpers.h>
|
||||||
#include <helpers/CommonCLI.h>
|
#include <helpers/CommonCLI.h>
|
||||||
@@ -600,13 +599,6 @@ public:
|
|||||||
StdRNG fast_rng;
|
StdRNG fast_rng;
|
||||||
SimpleMeshTables tables;
|
SimpleMeshTables tables;
|
||||||
|
|
||||||
#ifdef ESP32
|
|
||||||
ESP32RTCClock fallback_clock;
|
|
||||||
#else
|
|
||||||
VolatileRTCClock fallback_clock;
|
|
||||||
#endif
|
|
||||||
AutoDiscoverRTCClock rtc_clock(fallback_clock);
|
|
||||||
|
|
||||||
MyMesh the_mesh(board, radio_driver, *new ArduinoMillis(), fast_rng, rtc_clock, tables);
|
MyMesh the_mesh(board, radio_driver, *new ArduinoMillis(), fast_rng, rtc_clock, tables);
|
||||||
|
|
||||||
void halt() {
|
void halt() {
|
||||||
@@ -620,10 +612,6 @@ void setup() {
|
|||||||
delay(1000);
|
delay(1000);
|
||||||
|
|
||||||
board.begin();
|
board.begin();
|
||||||
#ifdef ESP32
|
|
||||||
fallback_clock.begin();
|
|
||||||
#endif
|
|
||||||
rtc_clock.begin(Wire);
|
|
||||||
|
|
||||||
if (!radio_init()) { halt(); }
|
if (!radio_init()) { halt(); }
|
||||||
|
|
||||||
|
|||||||
@@ -11,7 +11,6 @@
|
|||||||
#include <helpers/StaticPoolPacketManager.h>
|
#include <helpers/StaticPoolPacketManager.h>
|
||||||
#include <helpers/SimpleMeshTables.h>
|
#include <helpers/SimpleMeshTables.h>
|
||||||
#include <helpers/IdentityStore.h>
|
#include <helpers/IdentityStore.h>
|
||||||
#include <helpers/AutoDiscoverRTCClock.h>
|
|
||||||
#include <helpers/AdvertDataHelpers.h>
|
#include <helpers/AdvertDataHelpers.h>
|
||||||
#include <helpers/TxtDataHelpers.h>
|
#include <helpers/TxtDataHelpers.h>
|
||||||
#include <helpers/CommonCLI.h>
|
#include <helpers/CommonCLI.h>
|
||||||
@@ -823,14 +822,6 @@ public:
|
|||||||
|
|
||||||
StdRNG fast_rng;
|
StdRNG fast_rng;
|
||||||
SimpleMeshTables tables;
|
SimpleMeshTables tables;
|
||||||
|
|
||||||
#ifdef ESP32
|
|
||||||
ESP32RTCClock fallback_clock;
|
|
||||||
#else
|
|
||||||
VolatileRTCClock fallback_clock;
|
|
||||||
#endif
|
|
||||||
AutoDiscoverRTCClock rtc_clock(fallback_clock);
|
|
||||||
|
|
||||||
MyMesh the_mesh(board, radio_driver, *new ArduinoMillis(), fast_rng, rtc_clock, tables);
|
MyMesh the_mesh(board, radio_driver, *new ArduinoMillis(), fast_rng, rtc_clock, tables);
|
||||||
|
|
||||||
void halt() {
|
void halt() {
|
||||||
@@ -844,10 +835,6 @@ void setup() {
|
|||||||
delay(1000);
|
delay(1000);
|
||||||
|
|
||||||
board.begin();
|
board.begin();
|
||||||
#ifdef ESP32
|
|
||||||
fallback_clock.begin();
|
|
||||||
#endif
|
|
||||||
rtc_clock.begin(Wire);
|
|
||||||
|
|
||||||
if (!radio_init()) { halt(); }
|
if (!radio_init()) { halt(); }
|
||||||
|
|
||||||
|
|||||||
@@ -523,7 +523,7 @@ public:
|
|||||||
|
|
||||||
StdRNG fast_rng;
|
StdRNG fast_rng;
|
||||||
SimpleMeshTables tables;
|
SimpleMeshTables tables;
|
||||||
MyMesh the_mesh(radio_driver, fast_rng, *new VolatileRTCClock(), tables);
|
MyMesh the_mesh(radio_driver, fast_rng, *new VolatileRTCClock(), tables); // TODO: test with 'rtc_clock' in target.cpp
|
||||||
|
|
||||||
void halt() {
|
void halt() {
|
||||||
while (1) ;
|
while (1) ;
|
||||||
|
|||||||
@@ -6,7 +6,11 @@ ESP32Board board;
|
|||||||
|
|
||||||
ESPNOWRadio radio_driver;
|
ESPNOWRadio radio_driver;
|
||||||
|
|
||||||
|
ESP32RTCClock rtc_clock;
|
||||||
|
|
||||||
bool radio_init() {
|
bool radio_init() {
|
||||||
|
rtc_clock.begin();
|
||||||
|
|
||||||
// NOTE: radio_driver.begin() is called by Dispatcher::begin(), so not needed here
|
// NOTE: radio_driver.begin() is called by Dispatcher::begin(), so not needed here
|
||||||
return true; // success
|
return true; // success
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
|
|
||||||
extern ESP32Board board;
|
extern ESP32Board board;
|
||||||
extern ESPNOWRadio radio_driver;
|
extern ESPNOWRadio radio_driver;
|
||||||
|
extern ESP32RTCClock rtc_clock;
|
||||||
|
|
||||||
bool radio_init();
|
bool radio_init();
|
||||||
uint32_t radio_get_rng_seed();
|
uint32_t radio_get_rng_seed();
|
||||||
|
|||||||
@@ -12,11 +12,17 @@ HeltecV2Board board;
|
|||||||
|
|
||||||
WRAPPER_CLASS radio_driver(radio, board);
|
WRAPPER_CLASS radio_driver(radio, board);
|
||||||
|
|
||||||
|
ESP32RTCClock fallback_clock;
|
||||||
|
AutoDiscoverRTCClock rtc_clock(fallback_clock);
|
||||||
|
|
||||||
#ifndef LORA_CR
|
#ifndef LORA_CR
|
||||||
#define LORA_CR 5
|
#define LORA_CR 5
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
bool radio_init() {
|
bool radio_init() {
|
||||||
|
fallback_clock.begin();
|
||||||
|
rtc_clock.begin(Wire);
|
||||||
|
|
||||||
#if defined(P_LORA_SCLK)
|
#if defined(P_LORA_SCLK)
|
||||||
spi.begin(P_LORA_SCLK, P_LORA_MISO, P_LORA_MOSI);
|
spi.begin(P_LORA_SCLK, P_LORA_MISO, P_LORA_MOSI);
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -5,9 +5,11 @@
|
|||||||
#include <helpers/RadioLibWrappers.h>
|
#include <helpers/RadioLibWrappers.h>
|
||||||
#include <helpers/HeltecV2Board.h>
|
#include <helpers/HeltecV2Board.h>
|
||||||
#include <helpers/CustomSX1276Wrapper.h>
|
#include <helpers/CustomSX1276Wrapper.h>
|
||||||
|
#include <helpers/AutoDiscoverRTCClock.h>
|
||||||
|
|
||||||
extern HeltecV2Board board;
|
extern HeltecV2Board board;
|
||||||
extern WRAPPER_CLASS radio_driver;
|
extern WRAPPER_CLASS radio_driver;
|
||||||
|
extern AutoDiscoverRTCClock rtc_clock;
|
||||||
|
|
||||||
bool radio_init();
|
bool radio_init();
|
||||||
uint32_t radio_get_rng_seed();
|
uint32_t radio_get_rng_seed();
|
||||||
|
|||||||
@@ -12,11 +12,17 @@ HeltecV3Board board;
|
|||||||
|
|
||||||
WRAPPER_CLASS radio_driver(radio, board);
|
WRAPPER_CLASS radio_driver(radio, board);
|
||||||
|
|
||||||
|
ESP32RTCClock fallback_clock;
|
||||||
|
AutoDiscoverRTCClock rtc_clock(fallback_clock);
|
||||||
|
|
||||||
#ifndef LORA_CR
|
#ifndef LORA_CR
|
||||||
#define LORA_CR 5
|
#define LORA_CR 5
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
bool radio_init() {
|
bool radio_init() {
|
||||||
|
fallback_clock.begin();
|
||||||
|
rtc_clock.begin(Wire);
|
||||||
|
|
||||||
#ifdef SX126X_DIO3_TCXO_VOLTAGE
|
#ifdef SX126X_DIO3_TCXO_VOLTAGE
|
||||||
float tcxo = SX126X_DIO3_TCXO_VOLTAGE;
|
float tcxo = SX126X_DIO3_TCXO_VOLTAGE;
|
||||||
#else
|
#else
|
||||||
|
|||||||
@@ -5,9 +5,11 @@
|
|||||||
#include <helpers/RadioLibWrappers.h>
|
#include <helpers/RadioLibWrappers.h>
|
||||||
#include <helpers/HeltecV3Board.h>
|
#include <helpers/HeltecV3Board.h>
|
||||||
#include <helpers/CustomSX1262Wrapper.h>
|
#include <helpers/CustomSX1262Wrapper.h>
|
||||||
|
#include <helpers/AutoDiscoverRTCClock.h>
|
||||||
|
|
||||||
extern HeltecV3Board board;
|
extern HeltecV3Board board;
|
||||||
extern WRAPPER_CLASS radio_driver;
|
extern WRAPPER_CLASS radio_driver;
|
||||||
|
extern AutoDiscoverRTCClock rtc_clock;
|
||||||
|
|
||||||
bool radio_init();
|
bool radio_init();
|
||||||
uint32_t radio_get_rng_seed();
|
uint32_t radio_get_rng_seed();
|
||||||
|
|||||||
@@ -12,11 +12,17 @@ ESP32Board board;
|
|||||||
|
|
||||||
WRAPPER_CLASS radio_driver(radio, board);
|
WRAPPER_CLASS radio_driver(radio, board);
|
||||||
|
|
||||||
|
ESP32RTCClock fallback_clock;
|
||||||
|
AutoDiscoverRTCClock rtc_clock(fallback_clock);
|
||||||
|
|
||||||
#ifndef LORA_CR
|
#ifndef LORA_CR
|
||||||
#define LORA_CR 5
|
#define LORA_CR 5
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
bool radio_init() {
|
bool radio_init() {
|
||||||
|
fallback_clock.begin();
|
||||||
|
rtc_clock.begin(Wire);
|
||||||
|
|
||||||
#ifdef SX126X_DIO3_TCXO_VOLTAGE
|
#ifdef SX126X_DIO3_TCXO_VOLTAGE
|
||||||
float tcxo = SX126X_DIO3_TCXO_VOLTAGE;
|
float tcxo = SX126X_DIO3_TCXO_VOLTAGE;
|
||||||
#else
|
#else
|
||||||
|
|||||||
@@ -5,9 +5,11 @@
|
|||||||
#include <helpers/RadioLibWrappers.h>
|
#include <helpers/RadioLibWrappers.h>
|
||||||
#include <helpers/ESP32Board.h>
|
#include <helpers/ESP32Board.h>
|
||||||
#include <helpers/CustomSX1262Wrapper.h>
|
#include <helpers/CustomSX1262Wrapper.h>
|
||||||
|
#include <helpers/AutoDiscoverRTCClock.h>
|
||||||
|
|
||||||
extern ESP32Board board;
|
extern ESP32Board board;
|
||||||
extern WRAPPER_CLASS radio_driver;
|
extern WRAPPER_CLASS radio_driver;
|
||||||
|
extern AutoDiscoverRTCClock rtc_clock;
|
||||||
|
|
||||||
bool radio_init();
|
bool radio_init();
|
||||||
uint32_t radio_get_rng_seed();
|
uint32_t radio_get_rng_seed();
|
||||||
|
|||||||
@@ -12,11 +12,17 @@ TBeamBoard board;
|
|||||||
|
|
||||||
WRAPPER_CLASS radio_driver(radio, board);
|
WRAPPER_CLASS radio_driver(radio, board);
|
||||||
|
|
||||||
|
ESP32RTCClock fallback_clock;
|
||||||
|
AutoDiscoverRTCClock rtc_clock(fallback_clock);
|
||||||
|
|
||||||
#ifndef LORA_CR
|
#ifndef LORA_CR
|
||||||
#define LORA_CR 5
|
#define LORA_CR 5
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
bool radio_init() {
|
bool radio_init() {
|
||||||
|
fallback_clock.begin();
|
||||||
|
rtc_clock.begin(Wire);
|
||||||
|
|
||||||
#if defined(P_LORA_SCLK)
|
#if defined(P_LORA_SCLK)
|
||||||
spi.begin(P_LORA_SCLK, P_LORA_MISO, P_LORA_MOSI);
|
spi.begin(P_LORA_SCLK, P_LORA_MISO, P_LORA_MOSI);
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -5,9 +5,11 @@
|
|||||||
#include <helpers/RadioLibWrappers.h>
|
#include <helpers/RadioLibWrappers.h>
|
||||||
#include <helpers/TBeamBoard.h>
|
#include <helpers/TBeamBoard.h>
|
||||||
#include <helpers/CustomSX1276Wrapper.h>
|
#include <helpers/CustomSX1276Wrapper.h>
|
||||||
|
#include <helpers/AutoDiscoverRTCClock.h>
|
||||||
|
|
||||||
extern TBeamBoard board;
|
extern TBeamBoard board;
|
||||||
extern WRAPPER_CLASS radio_driver;
|
extern WRAPPER_CLASS radio_driver;
|
||||||
|
extern AutoDiscoverRTCClock rtc_clock;
|
||||||
|
|
||||||
bool radio_init();
|
bool radio_init();
|
||||||
uint32_t radio_get_rng_seed();
|
uint32_t radio_get_rng_seed();
|
||||||
|
|||||||
@@ -8,11 +8,17 @@ RADIO_CLASS radio = new Module(P_LORA_NSS, P_LORA_DIO_0, P_LORA_RESET, P_LORA_DI
|
|||||||
|
|
||||||
WRAPPER_CLASS radio_driver(radio, board);
|
WRAPPER_CLASS radio_driver(radio, board);
|
||||||
|
|
||||||
|
ESP32RTCClock fallback_clock;
|
||||||
|
AutoDiscoverRTCClock rtc_clock(fallback_clock);
|
||||||
|
|
||||||
#ifndef LORA_CR
|
#ifndef LORA_CR
|
||||||
#define LORA_CR 5
|
#define LORA_CR 5
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
bool radio_init() {
|
bool radio_init() {
|
||||||
|
fallback_clock.begin();
|
||||||
|
rtc_clock.begin(Wire);
|
||||||
|
|
||||||
spi.begin(P_LORA_SCLK, P_LORA_MISO, P_LORA_MOSI);
|
spi.begin(P_LORA_SCLK, P_LORA_MISO, P_LORA_MOSI);
|
||||||
int status = radio.begin(LORA_FREQ, LORA_BW, LORA_SF, LORA_CR, RADIOLIB_SX126X_SYNC_WORD_PRIVATE, LORA_TX_POWER, 8);
|
int status = radio.begin(LORA_FREQ, LORA_BW, LORA_SF, LORA_CR, RADIOLIB_SX126X_SYNC_WORD_PRIVATE, LORA_TX_POWER, 8);
|
||||||
if (status != RADIOLIB_ERR_NONE) {
|
if (status != RADIOLIB_ERR_NONE) {
|
||||||
|
|||||||
@@ -5,9 +5,11 @@
|
|||||||
#include <helpers/RadioLibWrappers.h>
|
#include <helpers/RadioLibWrappers.h>
|
||||||
#include <helpers/LilyGoTLoraBoard.h>
|
#include <helpers/LilyGoTLoraBoard.h>
|
||||||
#include <helpers/CustomSX1276Wrapper.h>
|
#include <helpers/CustomSX1276Wrapper.h>
|
||||||
|
#include <helpers/AutoDiscoverRTCClock.h>
|
||||||
|
|
||||||
extern LilyGoTLoraBoard board;
|
extern LilyGoTLoraBoard board;
|
||||||
extern WRAPPER_CLASS radio_driver;
|
extern WRAPPER_CLASS radio_driver;
|
||||||
|
extern AutoDiscoverRTCClock rtc_clock;
|
||||||
|
|
||||||
bool radio_init();
|
bool radio_init();
|
||||||
uint32_t radio_get_rng_seed();
|
uint32_t radio_get_rng_seed();
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
#include <Arduino.h>
|
#include <Arduino.h>
|
||||||
#include "target.h"
|
#include "target.h"
|
||||||
|
#include <helpers/ArduinoHelpers.h>
|
||||||
|
|
||||||
FaketecBoard board;
|
FaketecBoard board;
|
||||||
|
|
||||||
@@ -7,11 +8,16 @@ RADIO_CLASS radio = new Module(P_LORA_NSS, P_LORA_DIO_1, P_LORA_RESET, P_LORA_BU
|
|||||||
|
|
||||||
WRAPPER_CLASS radio_driver(radio, board);
|
WRAPPER_CLASS radio_driver(radio, board);
|
||||||
|
|
||||||
|
VolatileRTCClock fallback_clock;
|
||||||
|
AutoDiscoverRTCClock rtc_clock(fallback_clock);
|
||||||
|
|
||||||
#ifndef LORA_CR
|
#ifndef LORA_CR
|
||||||
#define LORA_CR 5
|
#define LORA_CR 5
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
bool radio_init() {
|
bool radio_init() {
|
||||||
|
rtc_clock.begin(Wire);
|
||||||
|
|
||||||
#ifdef SX126X_DIO3_TCXO_VOLTAGE
|
#ifdef SX126X_DIO3_TCXO_VOLTAGE
|
||||||
float tcxo = SX126X_DIO3_TCXO_VOLTAGE;
|
float tcxo = SX126X_DIO3_TCXO_VOLTAGE;
|
||||||
#else
|
#else
|
||||||
|
|||||||
@@ -6,9 +6,11 @@
|
|||||||
#include <helpers/nrf52/FaketecBoard.h>
|
#include <helpers/nrf52/FaketecBoard.h>
|
||||||
#include <helpers/CustomSX1262Wrapper.h>
|
#include <helpers/CustomSX1262Wrapper.h>
|
||||||
#include <helpers/CustomLLCC68Wrapper.h>
|
#include <helpers/CustomLLCC68Wrapper.h>
|
||||||
|
#include <helpers/AutoDiscoverRTCClock.h>
|
||||||
|
|
||||||
extern FaketecBoard board;
|
extern FaketecBoard board;
|
||||||
extern WRAPPER_CLASS radio_driver;
|
extern WRAPPER_CLASS radio_driver;
|
||||||
|
extern AutoDiscoverRTCClock rtc_clock;
|
||||||
|
|
||||||
bool radio_init();
|
bool radio_init();
|
||||||
uint32_t radio_get_rng_seed();
|
uint32_t radio_get_rng_seed();
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
#include <Arduino.h>
|
#include <Arduino.h>
|
||||||
#include "target.h"
|
#include "target.h"
|
||||||
|
#include <helpers/ArduinoHelpers.h>
|
||||||
|
|
||||||
RAK4631Board board;
|
RAK4631Board board;
|
||||||
|
|
||||||
@@ -7,11 +8,16 @@ RADIO_CLASS radio = new Module(P_LORA_NSS, P_LORA_DIO_1, P_LORA_RESET, P_LORA_BU
|
|||||||
|
|
||||||
WRAPPER_CLASS radio_driver(radio, board);
|
WRAPPER_CLASS radio_driver(radio, board);
|
||||||
|
|
||||||
|
VolatileRTCClock fallback_clock;
|
||||||
|
AutoDiscoverRTCClock rtc_clock(fallback_clock);
|
||||||
|
|
||||||
#ifndef LORA_CR
|
#ifndef LORA_CR
|
||||||
#define LORA_CR 5
|
#define LORA_CR 5
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
bool radio_init() {
|
bool radio_init() {
|
||||||
|
rtc_clock.begin(Wire);
|
||||||
|
|
||||||
#ifdef SX126X_DIO3_TCXO_VOLTAGE
|
#ifdef SX126X_DIO3_TCXO_VOLTAGE
|
||||||
float tcxo = SX126X_DIO3_TCXO_VOLTAGE;
|
float tcxo = SX126X_DIO3_TCXO_VOLTAGE;
|
||||||
#else
|
#else
|
||||||
|
|||||||
@@ -5,9 +5,11 @@
|
|||||||
#include <helpers/RadioLibWrappers.h>
|
#include <helpers/RadioLibWrappers.h>
|
||||||
#include <helpers/nrf52/RAK4631Board.h>
|
#include <helpers/nrf52/RAK4631Board.h>
|
||||||
#include <helpers/CustomSX1262Wrapper.h>
|
#include <helpers/CustomSX1262Wrapper.h>
|
||||||
|
#include <helpers/AutoDiscoverRTCClock.h>
|
||||||
|
|
||||||
extern RAK4631Board board;
|
extern RAK4631Board board;
|
||||||
extern WRAPPER_CLASS radio_driver;
|
extern WRAPPER_CLASS radio_driver;
|
||||||
|
extern AutoDiscoverRTCClock rtc_clock;
|
||||||
|
|
||||||
bool radio_init();
|
bool radio_init();
|
||||||
uint32_t radio_get_rng_seed();
|
uint32_t radio_get_rng_seed();
|
||||||
|
|||||||
@@ -12,11 +12,17 @@ StationG2Board board;
|
|||||||
|
|
||||||
WRAPPER_CLASS radio_driver(radio, board);
|
WRAPPER_CLASS radio_driver(radio, board);
|
||||||
|
|
||||||
|
ESP32RTCClock fallback_clock;
|
||||||
|
AutoDiscoverRTCClock rtc_clock(fallback_clock);
|
||||||
|
|
||||||
#ifndef LORA_CR
|
#ifndef LORA_CR
|
||||||
#define LORA_CR 5
|
#define LORA_CR 5
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
bool radio_init() {
|
bool radio_init() {
|
||||||
|
fallback_clock.begin();
|
||||||
|
rtc_clock.begin(Wire);
|
||||||
|
|
||||||
#ifdef SX126X_DIO3_TCXO_VOLTAGE
|
#ifdef SX126X_DIO3_TCXO_VOLTAGE
|
||||||
float tcxo = SX126X_DIO3_TCXO_VOLTAGE;
|
float tcxo = SX126X_DIO3_TCXO_VOLTAGE;
|
||||||
#else
|
#else
|
||||||
|
|||||||
@@ -5,9 +5,11 @@
|
|||||||
#include <helpers/RadioLibWrappers.h>
|
#include <helpers/RadioLibWrappers.h>
|
||||||
#include <helpers/StationG2Board.h>
|
#include <helpers/StationG2Board.h>
|
||||||
#include <helpers/CustomSX1262Wrapper.h>
|
#include <helpers/CustomSX1262Wrapper.h>
|
||||||
|
#include <helpers/AutoDiscoverRTCClock.h>
|
||||||
|
|
||||||
extern StationG2Board board;
|
extern StationG2Board board;
|
||||||
extern WRAPPER_CLASS radio_driver;
|
extern WRAPPER_CLASS radio_driver;
|
||||||
|
extern AutoDiscoverRTCClock rtc_clock;
|
||||||
|
|
||||||
bool radio_init();
|
bool radio_init();
|
||||||
uint32_t radio_get_rng_seed();
|
uint32_t radio_get_rng_seed();
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
#include <Arduino.h>
|
#include <Arduino.h>
|
||||||
#include "target.h"
|
#include "target.h"
|
||||||
|
#include <helpers/ArduinoHelpers.h>
|
||||||
|
|
||||||
T1000eBoard board;
|
T1000eBoard board;
|
||||||
|
|
||||||
@@ -7,6 +8,9 @@ RADIO_CLASS radio = new Module(P_LORA_NSS, P_LORA_DIO_1, P_LORA_RESET, P_LORA_BU
|
|||||||
|
|
||||||
WRAPPER_CLASS radio_driver(radio, board);
|
WRAPPER_CLASS radio_driver(radio, board);
|
||||||
|
|
||||||
|
VolatileRTCClock fallback_clock;
|
||||||
|
AutoDiscoverRTCClock rtc_clock(fallback_clock);
|
||||||
|
|
||||||
#ifndef LORA_CR
|
#ifndef LORA_CR
|
||||||
#define LORA_CR 5
|
#define LORA_CR 5
|
||||||
#endif
|
#endif
|
||||||
@@ -34,6 +38,8 @@ static const Module::RfSwitchMode_t rfswitch_table[] = {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
bool radio_init() {
|
bool radio_init() {
|
||||||
|
rtc_clock.begin(Wire);
|
||||||
|
|
||||||
#ifdef LR11X0_DIO3_TCXO_VOLTAGE
|
#ifdef LR11X0_DIO3_TCXO_VOLTAGE
|
||||||
float tcxo = LR11X0_DIO3_TCXO_VOLTAGE;
|
float tcxo = LR11X0_DIO3_TCXO_VOLTAGE;
|
||||||
#else
|
#else
|
||||||
|
|||||||
@@ -5,9 +5,11 @@
|
|||||||
#include <helpers/RadioLibWrappers.h>
|
#include <helpers/RadioLibWrappers.h>
|
||||||
#include <helpers/nrf52/T1000eBoard.h>
|
#include <helpers/nrf52/T1000eBoard.h>
|
||||||
#include <helpers/CustomLR1110Wrapper.h>
|
#include <helpers/CustomLR1110Wrapper.h>
|
||||||
|
#include <helpers/AutoDiscoverRTCClock.h>
|
||||||
|
|
||||||
extern T1000eBoard board;
|
extern T1000eBoard board;
|
||||||
extern WRAPPER_CLASS radio_driver;
|
extern WRAPPER_CLASS radio_driver;
|
||||||
|
extern AutoDiscoverRTCClock rtc_clock;
|
||||||
|
|
||||||
bool radio_init();
|
bool radio_init();
|
||||||
uint32_t radio_get_rng_seed();
|
uint32_t radio_get_rng_seed();
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
#include <Arduino.h>
|
#include <Arduino.h>
|
||||||
#include "target.h"
|
#include "target.h"
|
||||||
|
#include <helpers/ArduinoHelpers.h>
|
||||||
|
|
||||||
T114Board board;
|
T114Board board;
|
||||||
|
|
||||||
@@ -7,11 +8,16 @@ RADIO_CLASS radio = new Module(P_LORA_NSS, P_LORA_DIO_1, P_LORA_RESET, P_LORA_BU
|
|||||||
|
|
||||||
WRAPPER_CLASS radio_driver(radio, board);
|
WRAPPER_CLASS radio_driver(radio, board);
|
||||||
|
|
||||||
|
VolatileRTCClock fallback_clock;
|
||||||
|
AutoDiscoverRTCClock rtc_clock(fallback_clock);
|
||||||
|
|
||||||
#ifndef LORA_CR
|
#ifndef LORA_CR
|
||||||
#define LORA_CR 5
|
#define LORA_CR 5
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
bool radio_init() {
|
bool radio_init() {
|
||||||
|
rtc_clock.begin(Wire);
|
||||||
|
|
||||||
#ifdef SX126X_DIO3_TCXO_VOLTAGE
|
#ifdef SX126X_DIO3_TCXO_VOLTAGE
|
||||||
float tcxo = SX126X_DIO3_TCXO_VOLTAGE;
|
float tcxo = SX126X_DIO3_TCXO_VOLTAGE;
|
||||||
#else
|
#else
|
||||||
|
|||||||
@@ -5,9 +5,11 @@
|
|||||||
#include <helpers/RadioLibWrappers.h>
|
#include <helpers/RadioLibWrappers.h>
|
||||||
#include <helpers/nrf52/T114Board.h>
|
#include <helpers/nrf52/T114Board.h>
|
||||||
#include <helpers/CustomSX1262Wrapper.h>
|
#include <helpers/CustomSX1262Wrapper.h>
|
||||||
|
#include <helpers/AutoDiscoverRTCClock.h>
|
||||||
|
|
||||||
extern T114Board board;
|
extern T114Board board;
|
||||||
extern WRAPPER_CLASS radio_driver;
|
extern WRAPPER_CLASS radio_driver;
|
||||||
|
extern AutoDiscoverRTCClock rtc_clock;
|
||||||
|
|
||||||
bool radio_init();
|
bool radio_init();
|
||||||
uint32_t radio_get_rng_seed();
|
uint32_t radio_get_rng_seed();
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
#include <Arduino.h>
|
#include <Arduino.h>
|
||||||
#include "target.h"
|
#include "target.h"
|
||||||
|
#include <helpers/ArduinoHelpers.h>
|
||||||
|
|
||||||
TechoBoard board;
|
TechoBoard board;
|
||||||
|
|
||||||
@@ -7,11 +8,16 @@ RADIO_CLASS radio = new Module(P_LORA_NSS, P_LORA_DIO_1, P_LORA_RESET, P_LORA_BU
|
|||||||
|
|
||||||
WRAPPER_CLASS radio_driver(radio, board);
|
WRAPPER_CLASS radio_driver(radio, board);
|
||||||
|
|
||||||
|
VolatileRTCClock fallback_clock;
|
||||||
|
AutoDiscoverRTCClock rtc_clock(fallback_clock);
|
||||||
|
|
||||||
#ifndef LORA_CR
|
#ifndef LORA_CR
|
||||||
#define LORA_CR 5
|
#define LORA_CR 5
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
bool radio_init() {
|
bool radio_init() {
|
||||||
|
rtc_clock.begin(Wire);
|
||||||
|
|
||||||
#ifdef SX126X_DIO3_TCXO_VOLTAGE
|
#ifdef SX126X_DIO3_TCXO_VOLTAGE
|
||||||
float tcxo = SX126X_DIO3_TCXO_VOLTAGE;
|
float tcxo = SX126X_DIO3_TCXO_VOLTAGE;
|
||||||
#else
|
#else
|
||||||
|
|||||||
@@ -5,9 +5,11 @@
|
|||||||
#include <helpers/RadioLibWrappers.h>
|
#include <helpers/RadioLibWrappers.h>
|
||||||
#include <helpers/nrf52/TechoBoard.h>
|
#include <helpers/nrf52/TechoBoard.h>
|
||||||
#include <helpers/CustomSX1262Wrapper.h>
|
#include <helpers/CustomSX1262Wrapper.h>
|
||||||
|
#include <helpers/AutoDiscoverRTCClock.h>
|
||||||
|
|
||||||
extern TechoBoard board;
|
extern TechoBoard board;
|
||||||
extern WRAPPER_CLASS radio_driver;
|
extern WRAPPER_CLASS radio_driver;
|
||||||
|
extern AutoDiscoverRTCClock rtc_clock;
|
||||||
|
|
||||||
bool radio_init();
|
bool radio_init();
|
||||||
uint32_t radio_get_rng_seed();
|
uint32_t radio_get_rng_seed();
|
||||||
|
|||||||
@@ -12,11 +12,17 @@ XiaoC3Board board;
|
|||||||
|
|
||||||
WRAPPER_CLASS radio_driver(radio, board);
|
WRAPPER_CLASS radio_driver(radio, board);
|
||||||
|
|
||||||
|
ESP32RTCClock fallback_clock;
|
||||||
|
AutoDiscoverRTCClock rtc_clock(fallback_clock);
|
||||||
|
|
||||||
#ifndef LORA_CR
|
#ifndef LORA_CR
|
||||||
#define LORA_CR 5
|
#define LORA_CR 5
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
bool radio_init() {
|
bool radio_init() {
|
||||||
|
fallback_clock.begin();
|
||||||
|
rtc_clock.begin(Wire);
|
||||||
|
|
||||||
#ifdef SX126X_DIO3_TCXO_VOLTAGE
|
#ifdef SX126X_DIO3_TCXO_VOLTAGE
|
||||||
float tcxo = SX126X_DIO3_TCXO_VOLTAGE;
|
float tcxo = SX126X_DIO3_TCXO_VOLTAGE;
|
||||||
#else
|
#else
|
||||||
|
|||||||
@@ -6,9 +6,11 @@
|
|||||||
#include <helpers/XiaoC3Board.h>
|
#include <helpers/XiaoC3Board.h>
|
||||||
#include <helpers/CustomSX1262Wrapper.h>
|
#include <helpers/CustomSX1262Wrapper.h>
|
||||||
#include <helpers/CustomSX1268Wrapper.h>
|
#include <helpers/CustomSX1268Wrapper.h>
|
||||||
|
#include <helpers/AutoDiscoverRTCClock.h>
|
||||||
|
|
||||||
extern XiaoC3Board board;
|
extern XiaoC3Board board;
|
||||||
extern WRAPPER_CLASS radio_driver;
|
extern WRAPPER_CLASS radio_driver;
|
||||||
|
extern AutoDiscoverRTCClock rtc_clock;
|
||||||
|
|
||||||
bool radio_init();
|
bool radio_init();
|
||||||
uint32_t radio_get_rng_seed();
|
uint32_t radio_get_rng_seed();
|
||||||
|
|||||||
@@ -12,11 +12,17 @@ ESP32Board board;
|
|||||||
|
|
||||||
WRAPPER_CLASS radio_driver(radio, board);
|
WRAPPER_CLASS radio_driver(radio, board);
|
||||||
|
|
||||||
|
ESP32RTCClock fallback_clock;
|
||||||
|
AutoDiscoverRTCClock rtc_clock(fallback_clock);
|
||||||
|
|
||||||
#ifndef LORA_CR
|
#ifndef LORA_CR
|
||||||
#define LORA_CR 5
|
#define LORA_CR 5
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
bool radio_init() {
|
bool radio_init() {
|
||||||
|
fallback_clock.begin();
|
||||||
|
rtc_clock.begin(Wire);
|
||||||
|
|
||||||
#ifdef SX126X_DIO3_TCXO_VOLTAGE
|
#ifdef SX126X_DIO3_TCXO_VOLTAGE
|
||||||
float tcxo = SX126X_DIO3_TCXO_VOLTAGE;
|
float tcxo = SX126X_DIO3_TCXO_VOLTAGE;
|
||||||
#else
|
#else
|
||||||
|
|||||||
@@ -5,9 +5,11 @@
|
|||||||
#include <helpers/RadioLibWrappers.h>
|
#include <helpers/RadioLibWrappers.h>
|
||||||
#include <helpers/ESP32Board.h>
|
#include <helpers/ESP32Board.h>
|
||||||
#include <helpers/CustomSX1262Wrapper.h>
|
#include <helpers/CustomSX1262Wrapper.h>
|
||||||
|
#include <helpers/AutoDiscoverRTCClock.h>
|
||||||
|
|
||||||
extern ESP32Board board;
|
extern ESP32Board board;
|
||||||
extern WRAPPER_CLASS radio_driver;
|
extern WRAPPER_CLASS radio_driver;
|
||||||
|
extern AutoDiscoverRTCClock rtc_clock;
|
||||||
|
|
||||||
bool radio_init();
|
bool radio_init();
|
||||||
uint32_t radio_get_rng_seed();
|
uint32_t radio_get_rng_seed();
|
||||||
|
|||||||
Reference in New Issue
Block a user