-
Notifications
You must be signed in to change notification settings - Fork 3k
STM32 GPIO IRQ : add a critical section in gpio_irq_init #12067
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
@@ -194,6 +195,8 @@ int gpio_irq_init(gpio_irq_t *obj, PinName pin, gpio_irq_handler handler, uint32 | |||
return -1; | |||
} | |||
|
|||
core_util_critical_section_enter(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please also protect also the free function ...
Also please add a comment why only init (& free) need to be protected (because other functions are protected at upper level (mbed driver or hal level)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
critical section and clear flag added in the free function
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Getting back to Pull Request message s not always handy ... I'd like to see the below information either in the code comments, or in commit message (or both)
We are adding a critical section in gpio_irq init and free functions to protect shared code structures
Note that other functions are protected in API level in InterruptIn
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Commit message updated!
Thx
@jeromecoutant, thank you for your changes. |
8cde76c
to
ada4228
Compare
@@ -194,6 +195,8 @@ int gpio_irq_init(gpio_irq_t *obj, PinName pin, gpio_irq_handler handler, uint32 | |||
return -1; | |||
} | |||
|
|||
core_util_critical_section_enter(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Getting back to Pull Request message s not always handy ... I'd like to see the below information either in the code comments, or in commit message (or both)
We are adding a critical section in gpio_irq init and free functions to protect shared code structures
Note that other functions are protected in API level in InterruptIn
critical section added in gpio_irq init and free functions to protect shared code structures Note that other functions are protected in API level in InterruptIn
ada4228
to
9317bea
Compare
CI started |
Test run: SUCCESSSummary: 11 of 11 test jobs passed |
Summary of changes
In 5.14 branch, got issues with STM32F0 targets and PWM tests (ci-shield)
Same line is used for different IRQ for our targets,
we are then adding a critical section in gpio_irq init and free functions
Note that other functions are protected in API level in InterruptIn
Impact of changes
Ci-shield tests are OK
Migration actions required
Documentation
Pull request type
Test results
Reviewers