Fixed intermittent init failure on AVR
This commit is contained in:
parent
7211a3423c
commit
2b37fa7454
2
Config.h
2
Config.h
@ -19,7 +19,7 @@
|
|||||||
#define CONFIG_H
|
#define CONFIG_H
|
||||||
|
|
||||||
#define MAJ_VERS 0x01
|
#define MAJ_VERS 0x01
|
||||||
#define MIN_VERS 0x39
|
#define MIN_VERS 0x3A
|
||||||
|
|
||||||
#define PLATFORM_AVR 0x90
|
#define PLATFORM_AVR 0x90
|
||||||
#define PLATFORM_ESP32 0x80
|
#define PLATFORM_ESP32 0x80
|
||||||
|
@ -88,6 +88,9 @@ void setup() {
|
|||||||
// pins for the LoRa module
|
// pins for the LoRa module
|
||||||
LoRa.setPins(pin_cs, pin_reset, pin_dio);
|
LoRa.setPins(pin_cs, pin_reset, pin_dio);
|
||||||
|
|
||||||
|
#if MCU_VARIANT == MCU_ESP32
|
||||||
|
// Check installed transceiver chip and
|
||||||
|
// probe boot parameters.
|
||||||
if (LoRa.preInit()) {
|
if (LoRa.preInit()) {
|
||||||
sx1276_installed = true;
|
sx1276_installed = true;
|
||||||
uint32_t lfr = LoRa.getFrequency();
|
uint32_t lfr = LoRa.getFrequency();
|
||||||
@ -107,6 +110,11 @@ void setup() {
|
|||||||
} else {
|
} else {
|
||||||
sx1276_installed = false;
|
sx1276_installed = false;
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
// Older variants only came with SX1276/78 chips,
|
||||||
|
// so assume that to be the case for now.
|
||||||
|
sx1276_installed = true;
|
||||||
|
#endif
|
||||||
|
|
||||||
#if HAS_DISPLAY
|
#if HAS_DISPLAY
|
||||||
disp_ready = display_init();
|
disp_ready = display_init();
|
||||||
|
Loading…
Reference in New Issue
Block a user