espressif / arduino-esp32

Arduino core for the ESP32
GNU Lesser General Public License v2.1
13.6k stars 7.4k forks source link

SPI_HAS_TRANSACTION has issues with being defined #3576

Closed Avamander closed 4 years ago

Avamander commented 4 years ago

I'm one of the maintainers of github.com/nRF24/RF24 and for some reason our previously working code for detecting SPI transaction support does not work for ESP32:

#if defined (SPI_HAS_TRANSACTION) && !defined (SPI_UART) && !defined (SOFTSPI)
  #define RF24_SPI_TRANSACTIONS
#endif // defined (SPI_HAS_TRANSACTION) && !defined (SPI_UART) && !defined (SOFTSPI)

and based on https://github.com/espressif/arduino-esp32/blob/b847f41e24c1080d1e29aceb92b6a0199b05047f/cores/esp32/esp32-hal-spi.h#L25 I'd expect it to work, but it doesn't.

For some reason ESP32 users are saying that transactions don't get enabled and they need frankly weird patches to fix those issues. There's a bit of debugging done in the linked issue, it's... weird.

It would be very appreciated if someone on the core team could take a look at what's missing in ESP32 core that it doesn't act like an Arduino board for those people.

Hardware:

Core Installation version: 1.0.3 IDE name: Arduino IDE and Platform.io Computer OS: Unspecified

stale[bot] commented 4 years ago

[STALE_SET] This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. Thank you for your contributions.

Avamander commented 4 years ago

Ping

stale[bot] commented 4 years ago

[STALE_CLR] This issue has been removed from the stale queue. Please ensure activity to keep it openin the future.

stale[bot] commented 4 years ago

[STALE_SET] This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. Thank you for your contributions.

Avamander commented 4 years ago

Ping

stale[bot] commented 4 years ago

[STALE_CLR] This issue has been removed from the stale queue. Please ensure activity to keep it openin the future.

stale[bot] commented 4 years ago

[STALE_SET] This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. Thank you for your contributions.

Avamander commented 4 years ago

Ping

stale[bot] commented 4 years ago

[STALE_CLR] This issue has been removed from the stale queue. Please ensure activity to keep it openin the future.

atanisoft commented 4 years ago

@Avamander if you know of a fix for this, feel free to submit a PR with it for review.

Avamander commented 4 years ago

@atanisoft https://github.com/espressif/arduino-esp32/pull/3730

Though by now the suspicion is that platform.io "eats" the flag somewhere, but technically the PR should fix it.

atanisoft commented 4 years ago

@Avamander there is a build-platformio.py file under tools that will need to add that default flag. That should fix it for PIO as well.

Avamander commented 4 years ago

@atanisoft

there is a build-platformio.py file under tools that will need to add that default flag. That should fix it for PIO as well.

I made that change too.

stale[bot] commented 4 years ago

[STALE_SET] This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. Thank you for your contributions.

stale[bot] commented 4 years ago

[STALE_DEL] This stale issue has been automatically closed. Thank you for your contributions.