-
Notifications
You must be signed in to change notification settings - Fork 183
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
stm32xx-sys: generate constants for EXTI pins (#1734)
Currently, pins used for EXTI IRQs are defined in the `sys` task's config in `app.toml`. When a task wishes to actually use those pins, though, it must _also_ define them separately in order to call `sys.gpio_configure_input` (and if it wants to perform its own GPIO reads on that pin). This is generally done either by hard-coding the port and pin number in the task's source code, or by defining its own config for configuring which pin to use. This is unfortunate, as it results in a duplicated pin definition, either between the source code and the config if hard-coded, or twice in the config, if the task also gets the definition from config. And, if the task configures the pin in its own config, the author of that task must re-implement the config handling. This commit fixes this by adding new code generation to `drv-stm32xx-sys-api` to generate a module called `gpio_irq_pins` containing `PinSet` constants with the name of the IRQ pin and the pin number and port defined in the `sys` task's config section. This way, the same pin set used by `sys` when configuring the EXTI interrupt can be referenced by the task that consumes the interrupt, removing the need to duplicate the pin definition. I've edited the `nucleo-user-button` demo task to demonstrate using this. Signed-off-by: Eliza Weisman <[email protected]>
- Loading branch information
Showing
8 changed files
with
86 additions
and
24 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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