Switch from old AXP202X_Library to new XPowersLib

This commit is contained in:
attermann 2023-12-18 19:23:08 -07:00
commit 6e9a1ebfbd
3 changed files with 221 additions and 97 deletions

View file

@ -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;
}