mirror of
https://github.com/markqvist/RNode_Firmware.git
synced 2026-04-27 22:35:36 +00:00
Switch from old AXP202X_Library to new XPowersLib
This commit is contained in:
parent
acf7ae5c75
commit
6e9a1ebfbd
3 changed files with 221 additions and 97 deletions
12
LoRa.cpp
12
LoRa.cpp
|
|
@ -110,8 +110,16 @@ bool LoRaClass::preInit() {
|
|||
|
||||
SPI.begin();
|
||||
|
||||
// check version
|
||||
uint8_t version = readRegister(REG_VERSION);
|
||||
// check version (retry for up to 2 seconds)
|
||||
uint8_t version;
|
||||
long start = millis();
|
||||
while (((millis() - start) < 2000) && (millis() >= start)) {
|
||||
version = readRegister(REG_VERSION);
|
||||
if (version == 0x12) {
|
||||
break;
|
||||
}
|
||||
delay(100);
|
||||
}
|
||||
if (version != 0x12) {
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue