Skip to content

Commit

Permalink
[RF] Allow configuration of CC1101 SPI pins (#2141)
Browse files Browse the repository at this point in the history
If all CC1101 SPI pins are defined, use them to create the SPI device. Otherwise, default to the platform's SPI.
  • Loading branch information
DanEmord authored Jan 3, 2025
1 parent 5e1860a commit 4d6e7f4
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions main/ZcommonRF.ino
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 4d6e7f4

Please sign in to comment.