Skip to content

Commit 28b2219

Browse files
Piroro-hsburrbull
authored andcommitted
Use CamelCase for gpio::Edge enum variants
1 parent 9775f61 commit 28b2219

File tree

5 files changed

+10
-9
lines changed

5 files changed

+10
-9
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
3434
- Added open-drain pin mode support for PWM output [#313]
3535
- Added missing error flags for dma streams [#318]
3636
- Added PWM input capability to all compatable timers [#271]
37+
- [breaking-change] `gpio::Edge::{RISING, FALLING, RISING_FALLING}` are renamed to `Rising`, `Falling`, `RisingFalling`, respectively.
3738

3839
[#265]: https://github.com/stm32-rs/stm32f4xx-hal/pull/265
3940
[#271] https://github.com/stm32-rs/stm32f4xx-hal/pull/271

examples/analog-stopwatch-with-spi-ssd1306.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ fn main() -> ! {
8686
let mut board_btn = gpioa.pa0.into_pull_down_input();
8787
board_btn.make_interrupt_source(&mut syscfg);
8888
board_btn.enable_interrupt(&mut dp.EXTI);
89-
board_btn.trigger_on_edge(&mut dp.EXTI, Edge::FALLING);
89+
board_btn.trigger_on_edge(&mut dp.EXTI, Edge::Falling);
9090

9191
//spi4
9292
//sck - pe2

examples/rtic.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ const APP: () = {
3030
let mut button = gpioa.pa0.into_pull_down_input();
3131
button.make_interrupt_source(&mut syscfg);
3232
button.enable_interrupt(&mut ctx.device.EXTI);
33-
button.trigger_on_edge(&mut ctx.device.EXTI, Edge::RISING);
33+
button.trigger_on_edge(&mut ctx.device.EXTI, Edge::Rising);
3434

3535
init::LateResources { button, led }
3636
}

examples/stopwatch-with-ssd1306-and-interrupts.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ fn main() -> ! {
8181
let mut board_btn = gpioc.pc13.into_pull_up_input();
8282
board_btn.make_interrupt_source(&mut syscfg);
8383
board_btn.enable_interrupt(&mut dp.EXTI);
84-
board_btn.trigger_on_edge(&mut dp.EXTI, Edge::FALLING);
84+
board_btn.trigger_on_edge(&mut dp.EXTI, Edge::Falling);
8585

8686
let interface = I2CDIBuilder::new().init(i2c);
8787
let mut disp: GraphicsMode<_, _> = Builder::new().connect(interface).into();

src/gpio.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -106,9 +106,9 @@ pub enum Speed {
106106

107107
#[derive(Debug, PartialEq, Eq, Clone, Copy)]
108108
pub enum Edge {
109-
RISING,
110-
FALLING,
111-
RISING_FALLING,
109+
Rising,
110+
Falling,
111+
RisingFalling,
112112
}
113113

114114
mod sealed {
@@ -171,19 +171,19 @@ where
171171
fn trigger_on_edge(&mut self, exti: &mut EXTI, edge: Edge) {
172172
let i = self.pin_id();
173173
match edge {
174-
Edge::RISING => {
174+
Edge::Rising => {
175175
exti.rtsr
176176
.modify(|r, w| unsafe { w.bits(r.bits() | (1 << i)) });
177177
exti.ftsr
178178
.modify(|r, w| unsafe { w.bits(r.bits() & !(1 << i)) });
179179
}
180-
Edge::FALLING => {
180+
Edge::Falling => {
181181
exti.ftsr
182182
.modify(|r, w| unsafe { w.bits(r.bits() | (1 << i)) });
183183
exti.rtsr
184184
.modify(|r, w| unsafe { w.bits(r.bits() & !(1 << i)) });
185185
}
186-
Edge::RISING_FALLING => {
186+
Edge::RisingFalling => {
187187
exti.rtsr
188188
.modify(|r, w| unsafe { w.bits(r.bits() | (1 << i)) });
189189
exti.ftsr

0 commit comments

Comments
 (0)