mirror of
https://github.com/meshtastic/firmware.git
synced 2025-09-03 18:23:48 +00:00
allow LoRa on SPI/HSPI (elecrow)
This commit is contained in:
parent
8f20bb19ba
commit
dce1c78a66
@ -17,8 +17,8 @@
|
|||||||
#include <SPI.h>
|
#include <SPI.h>
|
||||||
|
|
||||||
#ifdef SDCARD_USE_SPI1
|
#ifdef SDCARD_USE_SPI1
|
||||||
SPIClass SPI1(HSPI);
|
SPIClass SPI_HSPI(HSPI);
|
||||||
#define SDHandler SPI1
|
#define SDHandler SPI_HSPI
|
||||||
#else
|
#else
|
||||||
#define SDHandler SPI
|
#define SDHandler SPI
|
||||||
#endif
|
#endif
|
||||||
|
12
src/main.cpp
12
src/main.cpp
@ -137,6 +137,10 @@ void setupNicheGraphics();
|
|||||||
#include "nicheGraphics.h"
|
#include "nicheGraphics.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if defined(HW_SPI1_DEVICE) && defined(ELECROW)
|
||||||
|
SPIClass SPI1(HSPI);
|
||||||
|
#endif
|
||||||
|
|
||||||
using namespace concurrency;
|
using namespace concurrency;
|
||||||
|
|
||||||
volatile static const char slipstreamTZString[] = {USERPREFS_TZ_STRING};
|
volatile static const char slipstreamTZString[] = {USERPREFS_TZ_STRING};
|
||||||
@ -789,10 +793,16 @@ void setup()
|
|||||||
#elif !defined(ARCH_ESP32) // ARCH_RP2040
|
#elif !defined(ARCH_ESP32) // ARCH_RP2040
|
||||||
SPI.begin();
|
SPI.begin();
|
||||||
#else
|
#else
|
||||||
// ESP32
|
// ESP32
|
||||||
|
#if defined(HW_SPI1_DEVICE) && defined(ELECROW)
|
||||||
|
SPI1.begin(LORA_SCK, LORA_MISO, LORA_MOSI, LORA_CS);
|
||||||
|
LOG_DEBUG("SPI1.begin(SCK=%d, MISO=%d, MOSI=%d, NSS=%d)", LORA_SCK, LORA_MISO, LORA_MOSI, LORA_CS);
|
||||||
|
SPI1.setFrequency(4000000);
|
||||||
|
#else
|
||||||
SPI.begin(LORA_SCK, LORA_MISO, LORA_MOSI, LORA_CS);
|
SPI.begin(LORA_SCK, LORA_MISO, LORA_MOSI, LORA_CS);
|
||||||
LOG_DEBUG("SPI.begin(SCK=%d, MISO=%d, MOSI=%d, NSS=%d)", LORA_SCK, LORA_MISO, LORA_MOSI, LORA_CS);
|
LOG_DEBUG("SPI.begin(SCK=%d, MISO=%d, MOSI=%d, NSS=%d)", LORA_SCK, LORA_MISO, LORA_MOSI, LORA_CS);
|
||||||
SPI.setFrequency(4000000);
|
SPI.setFrequency(4000000);
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Initialize the screen first so we can show the logo while we start up everything else.
|
// Initialize the screen first so we can show the logo while we start up everything else.
|
||||||
|
Loading…
Reference in New Issue
Block a user