From a304b892b70399e72f0b1dd6f15e8ece2d1b7f19 Mon Sep 17 00:00:00 2001 From: "jacob.eva" Date: Sat, 20 Jan 2024 13:23:39 +0000 Subject: [PATCH] Revert "Disable software SPI for ESP32 MCUs" This reverts commit 793b53dd4cc71ba7695a31d50e8fef46f39d322b. --- Config.h | 8 +------- RNode_Firmware.ino | 12 ++++-------- Utilities.h | 3 +-- 3 files changed, 6 insertions(+), 17 deletions(-) diff --git a/Config.h b/Config.h index 4eda6c7..1e4ac80 100644 --- a/Config.h +++ b/Config.h @@ -316,7 +316,6 @@ const int pin_dio = 47; const int pin_led_rx = LED_BLUE; const int pin_led_tx = LED_GREEN; - #define RXEN_BUSY_PINS #endif #else #error An unsupported board was selected. Cannot compile RNode firmware. @@ -334,17 +333,12 @@ #define eeprom_addr(a) (a+EEPROM_OFFSET) #if MODEM == SX1276 || MODEM == SX1278 - SPIClass spiModem(); + SPIClass spiModem(pin_miso, pin_sclk, pin_mosi); #elif MODEM == SX1262 SPIClass spiModem(NRF_SPIM2, pin_miso, pin_sclk, pin_mosi); #endif // MCU independent configuration parameters - #ifndef RXEN_BUSY_PINS - const int pin_rxen = -1; - const int pin_busy = -1; - #endif - const long serial_baudrate = 115200; // SX1276 RSSI offset to get dBm value from diff --git a/RNode_Firmware.ino b/RNode_Firmware.ino index df36c5c..b59c5d1 100644 --- a/RNode_Firmware.ino +++ b/RNode_Firmware.ino @@ -86,11 +86,7 @@ void setup() { // Set chip select, reset and interrupt // pins for the LoRa module - if ((pin_rxen != -1) && (pin_busy != -1)) { - LoRa.setPins(pin_cs, pin_reset, pin_dio, pin_rxen, pin_busy); - } else { - LoRa.setPins(pin_cs, pin_reset, pin_dio); - } + LoRa.setPins(pin_cs, pin_reset, pin_dio, pin_rxen, pin_busy); #if MCU_VARIANT == MCU_ESP32 || MCU_VARIANT == MCU_NRF52 init_channel_stats(); @@ -1305,10 +1301,10 @@ void buffer_serial() { if (!fifo_isfull_locked(&serialFIFO)) { fifo_push_locked(&serialFIFO, Serial.read()); } - #elif HAS_BLUETOOTH - if (bt_state == BT_STATE_CONNECTED) { + #else + if (HAS_BLUETOOTH && bt_state == BT_STATE_CONNECTED) { if (!fifo_isfull(&serialFIFO)) { - fifo_push(&serialFIFO, SerialBT.read()); + //fifo_push(&serialFIFO, SerialBT.read()); } } else { if (!fifo_isfull(&serialFIFO)) { diff --git a/Utilities.h b/Utilities.h index fe61b7c..a3597a4 100644 --- a/Utilities.h +++ b/Utilities.h @@ -13,8 +13,6 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . -#include "Config.h" - #if HAS_EEPROM #include #elif PLATFORM == PLATFORM_NRF52 @@ -22,6 +20,7 @@ int written_bytes = 0; #endif #include +#include "Config.h" #include "LoRa.h" #include "ROM.h" #include "Framing.h"