-
Notifications
You must be signed in to change notification settings - Fork 164
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
stm32xx-sys: configure EXTI IRQs in app.toml #1693
Conversation
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.
license-eye has totally checked 513 files.
Valid | Invalid | Ignored | Fixed |
---|---|---|---|
512 | 1 | 0 | 0 |
Click to see the invalid file list
- build/stm32xx-sys/src/lib.rs
d8fdfe7
to
2e4eb62
Compare
build/stm32xx-sys/src/lib.rs
Outdated
// i don't like typing | ||
macro_rules! table { | ||
($($variant:ident),*) => { | ||
match self { | ||
$(ConfigPort::$variant => { | ||
tokens.append(Ident::new("Port", Span::call_site())); | ||
tokens.append(Punct::new(':', Spacing::Joint)); | ||
tokens.append(Punct::new(':', Spacing::Alone)); | ||
tokens.append(Ident::new(stringify!($variant), Span::call_site())); | ||
}),* | ||
} | ||
} | ||
} | ||
table! { A, B, C, D, E, F, G, H, I, J, K } |
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.
somehow this macro felt like "less work" than just hand-writing the match
...i don't know what's wrong with me
3f7f6ef
to
06251f0
Compare
This commit adds build-time code generation for the EXTI IRQ dispatch table. Now, an app.toml can define a section like this: ```toml [config.sys.gpio-irq.button] port = "C" pin = 13 owner = { name = "mytask", notification = "button" } ``` To assign PC13's EXTI IRQ to the `button` notification for task `mytask`. The dispatch table is now generated by `build/stm32xx-sys` and will include the EXTI interrupt configurations in the config.
This commit changes the EXTI IRQ configuration from `config.sys.gpio_irqs` to `tasks.sys.gpio_irqs`, because no other task actually needs to read it.
This commit adds documentation explaining the EXTI interrupt TOML configuration surface area in `stm32xx-sys`.
This commit adds a demo task to the STM32H7 Nucleo boards that provides an example of how to receive EXTI GPIO notifications in a user task, replacing the `ping` and `pong` tasks. It toggles an LED when the Nucleo board's user button is pressed.
This commit adds a demo task to the STM32H7 Nucleo boards that provides an example of how to receive EXTI GPIO notifications in a user task, replacing the `ping` and `pong` tasks. It toggles an LED when the Nucleo board's user button is pressed.
This commit adds a demo task to the STM32H7 Nucleo boards that provides an example of how to receive EXTI GPIO notifications in a user task, replacing the `ping` and `pong` tasks. It toggles an LED when the Nucleo board's user button is pressed.
This commit adds build-time code generation for the EXTI IRQ dispatch table. Now, an app.toml can define a section like this: ```toml [config.sys.gpio-irq.button] port = "C" pin = 13 owner = { name = "mytask", notification = "button" } ``` To assign PC13's EXTI IRQ to the `button` notification for task `mytask`. The dispatch table is now generated by `build/stm32xx-sys` and will include the EXTI interrupt configurations in the config.
This commit changes the EXTI IRQ configuration from `config.sys.gpio_irqs` to `tasks.sys.gpio_irqs`, because no other task actually needs to read it.
This commit adds documentation explaining the EXTI interrupt TOML configuration surface area in `stm32xx-sys`.
Since the TOML configuration for EXTI IRQ dispatching in `stm32h7-sys` added in #1693 has a user-provided name for each pin's IRQ, we can generate a nice ringbuf entry (and corresponding entry counter) for each IRQ mapping. This seems nice to have for debugging purposes, so I've added it. When the ringbuf is enabled, `stm32xx-sys` now records a ringbuf entry and corresponding counter for each `gpio_irq_configure` and `gpio_irq_configure` IPC, and for each time an EXTI IRQ is dispatched. This may be useful for debugging cases where a task forgets to enable or disable its IRQ. When the `stm32xx-sys/no-ringbuf` feature flag is set, we skip the IPC events, and just count the number of times we've dispatched each IRQ --- this saves us some RAM while still recording the most interesting information. For example, here's me playing with the button on my Nucleo board: ```console $ cargo xtask humility app/demo-stm32h7-nucleo/app-h753.toml -- ringbuf drv_stm32xx_sys Finished dev [optimized + debuginfo] target(s) in 0.15s Running `target/debug/xtask humility app/demo-stm32h7-nucleo/app-h753.toml -- ringbuf drv_stm32xx_sys` humility: attached via ST-Link V3 humility: ring buffer drv_stm32xx_sys::__RINGBUF in sys: TOTAL VARIANT 3 GpioIrqEnable(button) 2 GpioIrq(button) 1 GpioIrqConfigure NDX LINE GEN COUNT PAYLOAD 0 685 1 1 GpioIrqConfigure { irq: button, rising: false, falling: true } 1 593 1 1 GpioIrqEnable(button) 2 806 1 1 GpioIrq(button) 3 593 1 1 GpioIrqEnable(button) 4 806 1 1 GpioIrq(button) 5 593 1 1 GpioIrqEnable(button) ```
This commit adds build-time code generation for the EXTI IRQ dispatch table. Now, an app.toml can define a section like this:
To assign PC13's EXTI IRQ to the
button
notification for taskmytask
. The dispatch table is now generated bybuild/stm32xx-sys
and will include the EXTI interrupt configurations in the config.