Factor out board config detection

This commit is contained in:
Adam Novak 2022-02-13 16:58:04 -05:00
parent 498b1f12e9
commit e67b38c005
6 changed files with 65 additions and 41 deletions

View file

@ -6,24 +6,6 @@
#include "LoRa.h"
#define MCU_1284P 0x91
#define MCU_2560 0x92
#define MCU_ESP32 0x81
#if defined(__AVR_ATmega1284P__)
#define PLATFORM PLATFORM_AVR
#define MCU_VARIANT MCU_1284P
#elif defined(__AVR_ATmega2560__)
#define PLATFORM PLATFORM_AVR
#define MCU_VARIANT MCU_2560
#elif defined(ESP32)
#define PLATFORM PLATFORM_ESP32
#define MCU_VARIANT MCU_ESP32
#endif
#ifndef MCU_VARIANT
#error No MCU variant defined, cannot compile
#endif
#if MCU_VARIANT == MCU_ESP32
#include "soc/rtc_wdt.h"
#define ISR_VECT IRAM_ATTR
@ -654,4 +636,4 @@ void ISR_VECT LoRaClass::onDio0Rise()
LoRa.handleDio0Rise();
}
LoRaClass LoRa;
LoRaClass LoRa;