Revert "Disable software SPI for ESP32 MCUs"

This reverts commit 793b53dd4c.
This commit is contained in:
jacob.eva 2024-01-20 13:23:39 +00:00
parent f4c2fa592d
commit a304b892b7
No known key found for this signature in database
GPG Key ID: 0B92E083BBCCAA1E
3 changed files with 6 additions and 17 deletions

View File

@ -316,7 +316,6 @@
const int pin_dio = 47; const int pin_dio = 47;
const int pin_led_rx = LED_BLUE; const int pin_led_rx = LED_BLUE;
const int pin_led_tx = LED_GREEN; const int pin_led_tx = LED_GREEN;
#define RXEN_BUSY_PINS
#endif #endif
#else #else
#error An unsupported board was selected. Cannot compile RNode firmware. #error An unsupported board was selected. Cannot compile RNode firmware.
@ -334,17 +333,12 @@
#define eeprom_addr(a) (a+EEPROM_OFFSET) #define eeprom_addr(a) (a+EEPROM_OFFSET)
#if MODEM == SX1276 || MODEM == SX1278 #if MODEM == SX1276 || MODEM == SX1278
SPIClass spiModem(); SPIClass spiModem(pin_miso, pin_sclk, pin_mosi);
#elif MODEM == SX1262 #elif MODEM == SX1262
SPIClass spiModem(NRF_SPIM2, pin_miso, pin_sclk, pin_mosi); SPIClass spiModem(NRF_SPIM2, pin_miso, pin_sclk, pin_mosi);
#endif #endif
// MCU independent configuration parameters // MCU independent configuration parameters
#ifndef RXEN_BUSY_PINS
const int pin_rxen = -1;
const int pin_busy = -1;
#endif
const long serial_baudrate = 115200; const long serial_baudrate = 115200;
// SX1276 RSSI offset to get dBm value from // SX1276 RSSI offset to get dBm value from

View File

@ -86,11 +86,7 @@ void setup() {
// Set chip select, reset and interrupt // Set chip select, reset and interrupt
// pins for the LoRa module // pins for the LoRa module
if ((pin_rxen != -1) && (pin_busy != -1)) { LoRa.setPins(pin_cs, pin_reset, pin_dio, pin_rxen, pin_busy);
LoRa.setPins(pin_cs, pin_reset, pin_dio, pin_rxen, pin_busy);
} else {
LoRa.setPins(pin_cs, pin_reset, pin_dio);
}
#if MCU_VARIANT == MCU_ESP32 || MCU_VARIANT == MCU_NRF52 #if MCU_VARIANT == MCU_ESP32 || MCU_VARIANT == MCU_NRF52
init_channel_stats(); init_channel_stats();
@ -1305,10 +1301,10 @@ void buffer_serial() {
if (!fifo_isfull_locked(&serialFIFO)) { if (!fifo_isfull_locked(&serialFIFO)) {
fifo_push_locked(&serialFIFO, Serial.read()); fifo_push_locked(&serialFIFO, Serial.read());
} }
#elif HAS_BLUETOOTH #else
if (bt_state == BT_STATE_CONNECTED) { if (HAS_BLUETOOTH && bt_state == BT_STATE_CONNECTED) {
if (!fifo_isfull(&serialFIFO)) { if (!fifo_isfull(&serialFIFO)) {
fifo_push(&serialFIFO, SerialBT.read()); //fifo_push(&serialFIFO, SerialBT.read());
} }
} else { } else {
if (!fifo_isfull(&serialFIFO)) { if (!fifo_isfull(&serialFIFO)) {

View File

@ -13,8 +13,6 @@
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>. // along with this program. If not, see <https://www.gnu.org/licenses/>.
#include "Config.h"
#if HAS_EEPROM #if HAS_EEPROM
#include <EEPROM.h> #include <EEPROM.h>
#elif PLATFORM == PLATFORM_NRF52 #elif PLATFORM == PLATFORM_NRF52
@ -22,6 +20,7 @@
int written_bytes = 0; int written_bytes = 0;
#endif #endif
#include <stddef.h> #include <stddef.h>
#include "Config.h"
#include "LoRa.h" #include "LoRa.h"
#include "ROM.h" #include "ROM.h"
#include "Framing.h" #include "Framing.h"