diff --git a/platformio.ini b/platformio.ini index d30e441..f79b5db 100644 --- a/platformio.ini +++ b/platformio.ini @@ -8,10 +8,7 @@ ; Please visit documentation for the other options and examples ; https://docs.platformio.org/page/projectconf.html -[env:heltec_wifi_lora_32_V2] -platform = espressif32 -board = heltec_wifi_lora_32_V2 -framework = arduino +[env] lib_ldf_mode = deep+ monitor_speed = 115200 lib_deps = @@ -21,3 +18,13 @@ lib_deps = APRS-Decoder-Lib NTPClient APRS-IS-Lib + +[env:heltec_wifi_lora_32] +platform = espressif32 +board = heltec_wifi_lora_32 +framework = arduino + +[env:heltec_wifi_lora_32_V2] +platform = espressif32 +board = heltec_wifi_lora_32_V2 +framework = arduino diff --git a/src/LoRa_APRS_iGate.ino b/src/LoRa_APRS_iGate.ino index 82b6f05..cd7e760 100644 --- a/src/LoRa_APRS_iGate.ino +++ b/src/LoRa_APRS_iGate.ino @@ -173,7 +173,7 @@ void setup_lora() { Serial.println("[INFO] Set SPI pins!"); SPI.begin(SCK, MISO, MOSI, SS); - LoRa.setPins(SS, RST, DIO0); + LoRa.setPins(SS, RST_LoRa, DIO0); Serial.println("[INFO] Set LoRa pins!"); long freq = 433775000; diff --git a/src/display.cpp b/src/display.cpp index 7f82e79..9746945 100644 --- a/src/display.cpp +++ b/src/display.cpp @@ -5,22 +5,16 @@ #include "display.h" -#define OLED_SDA 4 -#define OLED_SCL 15 -#define OLED_RST 16 -#define SCREEN_WIDTH 128 // OLED display width, in pixels -#define SCREEN_HEIGHT 64 // OLED display height, in pixels - -Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RST); +Adafruit_SSD1306 display(DISPLAY_WIDTH, DISPLAY_HEIGHT, &Wire, RST_OLED); void setup_display() { - pinMode(OLED_RST, OUTPUT); - digitalWrite(OLED_RST, LOW); + pinMode(RST_OLED, OUTPUT); + digitalWrite(RST_OLED, LOW); delay(20); - digitalWrite(OLED_RST, HIGH); + digitalWrite(RST_OLED, HIGH); - Wire.begin(OLED_SDA, OLED_SCL); + Wire.begin(SDA_OLED, SCL_OLED); if(!display.begin(SSD1306_SWITCHCAPVCC, 0x3c, false, false)) { Serial.println("SSD1306 allocation failed"); diff --git a/src/settings.h b/src/settings.h index 857664a..0354eb4 100644 --- a/src/settings.h +++ b/src/settings.h @@ -15,14 +15,6 @@ //#define SERVER "euro.aprs2.net" #define PORT 14580 -// LoRa Pins: -#define SCK 5 -#define MISO 19 -#define MOSI 27 -#define SS 18 -#define RST 14 -#define DIO0 26 - #define BROADCAST_TIMEOUT 15 #define BROADCAST_MESSAGE "OE5BPA-10>APRS:=4819.82NI01418.68E&LoRa IGATE (test RX mode), Info: github.com/peterus/LoRa_APRS_iGate"