Bus_SPI: detect SCT on ESP-IDF 6.1 - #322
Merged
Merged
Conversation
ESP-IDF 6.1 removed SOC_SPI_SCT_SUPPORTED and SOC_SPI_SCT_SUPPORTED_PERIPH from soc_caps.h; the capability is now SPI_LL_PERIPH_HAS_SCT(host) in hal/spi_ll.h. The check saw no macros, so the Segmented-Configure-Transfer path was compiled out on ESP32-S3 / C3 / C6 / C2 / H2: DMA transfers over 32 KB fell back to restarting every segment from the CPU and waiting for it in between, and the SCT-only transfer fixes (AFIFO reset before start, CS setup after SCT) were dropped too. Fall back to hal/spi_ll.h on ESP-IDF 6.1 and later when soc_caps.h has no SCT macros, and use one LGFX_SPI_SCT_PERIPH(host) for both the compile-time check and the per-host runtime check. Older ESP-IDF keeps using soc_caps.h and does not include the LL header.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ESP-IDF 6.1 removed
SOC_SPI_SCT_SUPPORTEDandSOC_SPI_SCT_SUPPORTED_PERIPHfromsoc_caps.h; the capability is nowSPI_LL_PERIPH_HAS_SCT(host)inhal/spi_ll.h. Bus_SPI found neither macro, so the Segmented-Configure-Transfer path was compiled out on ESP32-S3 / C3 / C6 / C2 / H2 with ESP-IDF 6.1:This PR falls back to
hal/spi_ll.hon ESP-IDF 6.1 and later, only whensoc_caps.hhas no SCT macros. It also uses oneLGFX_SPI_SCT_PERIPH(host)for both the compile-time check and the per-host runtime check. Older ESP-IDF keeps usingsoc_caps.hand does not include the LL header.Tested:
pushImageDMA) and read back from the panel: