mirror of
https://github.com/rstrouse/ESPSomfy-RTS.git
synced 2026-10-31 13:52:15 +01:00
Merge pull request #103 from cjkas/fix/cc1101-spi-bus-hang
fix: CC1101 init hangs the ESP32-S3 when the radio is enabled
This commit is contained in:
commit
ce8b0d0ed2
1 changed files with 9 additions and 0 deletions
|
|
@ -104,10 +104,19 @@ uint8_t PA_TABLE_915[10] {0x03,0x0E,0x1E,0x27,0x38,0x8E,0x84,0xCC,0xC3,0xC0,};
|
|||
void ELECHOUSE_CC1101::SpiStart(void)
|
||||
{
|
||||
// initialize the SPI pins
|
||||
#ifdef ESP32
|
||||
// ESPSomfy-RTS: SPI.begin() sets the bus pins up itself. Init() calls this
|
||||
// again while the bus is running, and on Arduino 3.x a pinMode() on a pin
|
||||
// the bus owns stops the bus while SPI.begin() still thinks it is up. The
|
||||
// next transfer is lost on the ESP32 and hangs forever on the S3, whose
|
||||
// stopped bus has no clock. SS is driven by hand, so it still needs one.
|
||||
pinMode(SS_PIN, OUTPUT);
|
||||
#else
|
||||
pinMode(SCK_PIN, OUTPUT);
|
||||
pinMode(MOSI_PIN, OUTPUT);
|
||||
pinMode(MISO_PIN, INPUT);
|
||||
pinMode(SS_PIN, OUTPUT);
|
||||
#endif
|
||||
|
||||
// enable SPI
|
||||
#ifdef ESP32
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue