Skip to content

Add possibility to redefine SD detection pin irq handlers at application level #74

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

mallenbach
Copy link
Contributor

@mallenbach mallenbach commented May 21, 2025

Add configuration macro to allow interrupt handlers related to SD detection pin to be deactivated at compile time without changing the source code.

Description

The way STM32F4xx and STM32F7xx ports handle interrupts related to SD detection pin is a bit limiting for 2 reasons:

  • the implementation may use a GPIO outside of EXTI10 to 15 range
  • the implementation may need GPIOs in EXTI10 to 15 range for other purpose

The idea here is to give the possibility to a user to handle this interrupt - if needed - at application level without changing the library source code. This PR introduces ffconfigSDIO_DRIVER_DEFINES_SD_DETECTION_INTERRUPT_HANDLER macro. There is also a modification applied to STM32F4xx and STM32F7xx ports to surround HAL_GPIO_EXTI_Callback and EXTI15_10_IRQHandler with this newly defined macro.

FYI - related to this discussion on the forum.

Test Steps

Integrate the content of this PR in my project to check that functions can be defined at application level without conflicts.

Checklist:

  • I have tested my changes. No regression in existing tests.
  • I have modified and/or added unit-tests to cover the code changes in this Pull Request.

Related Issue

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@mallenbach mallenbach force-pushed the add-possibility-to-redefine-irq-handlers-at-application-level branch from f56bed0 to 5e1cac1 Compare May 21, 2025 10:40
@@ -521,4 +521,10 @@
#define FF_CreateIOManger FF_CreateIOManager
#endif /* ffconfigENABLE_BACKWARD_COMPATIBILITY */

#ifndef ffconfigSDIO_DRIVER_DEFINES_SD_DETECTION_INTERRUPT_HANDLER
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this macro applies to 2 STM32 ports only, pleas move the default value to ff_sddisk.c files for those ports.

aggarg added 3 commits May 22, 2025 06:26
Signed-off-by: Gaurav Aggarwal <aggarg@amazon.com>
Signed-off-by: Gaurav Aggarwal <aggarg@amazon.com>
Signed-off-by: Gaurav Aggarwal <aggarg@amazon.com>
@aggarg aggarg merged commit dfb6d60 into FreeRTOS:main May 22, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants