From 4d6e7f4afae9c83d5fa78c9c5b6ec8eb954d331c Mon Sep 17 00:00:00 2001 From: DanEmord Date: Fri, 3 Jan 2025 07:29:26 -0800 Subject: [PATCH] [RF] Allow configuration of CC1101 SPI pins (#2141) If all CC1101 SPI pins are defined, use them to create the SPI device. Otherwise, default to the platform's SPI. --- main/ZcommonRF.ino | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/main/ZcommonRF.ino b/main/ZcommonRF.ino index d0d29c675d..f5eca348a4 100644 --- a/main/ZcommonRF.ino +++ b/main/ZcommonRF.ino @@ -36,6 +36,10 @@ void initCC1101() { int delayMS = 16; int delayMaxMS = 500; for (int i = 0; i < 10; i++) { +# if defined(RF_MODULE_SCK) && defined(RF_MODULE_MISO) && \ + defined(RF_MODULE_MOSI) && defined(RF_MODULE_CS) + ELECHOUSE_cc1101.setSpiPin(RF_MODULE_SCK, RF_MODULE_MISO, RF_MODULE_MOSI, RF_MODULE_CS); +# endif if (ELECHOUSE_cc1101.getCC1101()) { Log.notice(F("C1101 spi Connection OK" CR)); ELECHOUSE_cc1101.Init();