From 2f51a65b8fec40c3fb83a476071e49733c861945 Mon Sep 17 00:00:00 2001 From: Klaus K Wilting Date: Sat, 22 Dec 2018 18:01:45 +0100 Subject: [PATCH] bugfix lopy.h + lopy4.h --- src/hal/lopy.h | 3 +-- src/hal/lopy4.h | 15 ++++++++------- src/main.cpp | 11 ++++------- 3 files changed, 13 insertions(+), 16 deletions(-) diff --git a/src/hal/lopy.h b/src/hal/lopy.h index 5fe522b2..83ba8290 100644 --- a/src/hal/lopy.h +++ b/src/hal/lopy.h @@ -14,8 +14,7 @@ // Pins for LORA chip SPI interface come from board file, we need some // additional definitions for LMIC -#define LORA_IO1 (23) // Pin tied via diode to DIO0 -#define LORA_IO2 (23) // Pin tied via diode to DIO0 +#define LORA_IRQ (23) // select WIFI antenna (internal = onboard / external = u.fl socket) #define HAS_ANTENNA_SWITCH (16) // pin for switching wifi antenna diff --git a/src/hal/lopy4.h b/src/hal/lopy4.h index 248fc3bc..e7ef88ba 100644 --- a/src/hal/lopy4.h +++ b/src/hal/lopy4.h @@ -9,12 +9,12 @@ #define HAS_LORA 1 // comment out if device shall not send data via LoRa -#define HAS_SPI 1 // comment out if device shall not send data via SPI +//#defin HAS_SPI 1 // comment out if device shall not send data via SPI // pin definitions for local wired SPI slave interface -#define SPI_MOSI GPIO_NUM_22 -#define SPI_MISO GPIO_NUM_33 -#define SPI_SCLK GPIO_NUM_26 -#define SPI_CS GPIO_NUM_36 +//#define SPI_MOSI GPIO_NUM_22 +//#define SPI_MISO GPIO_NUM_33 +//#define SPI_SCLK GPIO_NUM_26 +//#define SPI_CS GPIO_NUM_36 #define CFG_sx1276_radio 1 //#define HAS_LED NOT_A_PIN // LoPy4 has no on board mono LED, we use on board RGB LED @@ -23,8 +23,9 @@ // Pins for LORA chip SPI interface come from board file, we need some // additional definitions for LMIC -#define LORA_IO1 (23) // Pin tied via diode to DIO0 -#define LORA_IO2 (23) // Pin tied via diode to DIO0 +#define LORA_IRQ (23) +#define LORA_RST NOT_A_PIN +#define SS 18 // select WIFI antenna (internal = onboard / external = u.fl socket) #define HAS_ANTENNA_SWITCH (21) // pin for switching wifi antenna (P12) diff --git a/src/main.cpp b/src/main.cpp index 2ba2268e..5a0604cc 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -128,15 +128,12 @@ void setup() { loadConfig(); // includes initialize if necessary #ifdef BOARD_HAS_PSRAM - if (psramFound()) { - ESP_LOGI(TAG, "PSRAM found and initialized"); - strcat_P(features, " PSRAM"); - } else - ESP_LOGI(TAG, "No PSRAM found"); -#else + assert(psramFound()); + ESP_LOGI(TAG, "PSRAM found and initialized"); + strcat_P(features, " PSRAM"); #endif - // initialize leds + // initialize leds #if (HAS_LED != NOT_A_PIN) pinMode(HAS_LED, OUTPUT); strcat_P(features, " LED");