Skip to content

Commit 3801f39

Browse files
therealprofTheZoq2
authored andcommitted
Rework examples to apply to more targets and test in CI
This also improves the required-features selection for the examples. Signed-off-by: Daniel Egger <daniel@eggers-club.de>
1 parent 3fd22e9 commit 3801f39

File tree

4 files changed

+24
-17
lines changed

4 files changed

+24
-17
lines changed

.github/workflows/ci.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
on: [push, pull_request]
1+
on:
2+
push:
3+
branches: [ staging, trying, master ]
4+
pull_request:
25

36
name: Continuous integration
47

@@ -7,7 +10,7 @@ jobs:
710
runs-on: ubuntu-latest
811
strategy:
912
matrix:
10-
mcu:
13+
mcu:
1114
- stm32f100
1215
- stm32f101
1316
- stm32f103
@@ -30,5 +33,5 @@ jobs:
3033
override: true
3134
- uses: actions-rs/cargo@v1
3235
with:
33-
command: build
34-
args: --features=${{ matrix.mcu }}
36+
command: check
37+
args: --features=${{ matrix.mcu }},rt --examples

Cargo.toml

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,6 @@ version = "0.5.3"
1515
features = ["stm32f103", "rt", "stm32-usbd"]
1616
default-target = "x86_64-unknown-linux-gnu"
1717

18-
[[example]]
19-
name = "timer-interrupt-rtfm"
20-
required-features = ["rt"]
21-
[[example]]
22-
name = "exti"
23-
required-features = ["rt"]
24-
2518
[dependencies]
2619
cortex-m = "0.6.0"
2720
nb = "0.1.2"
@@ -109,17 +102,28 @@ lto = true
109102

110103
[[example]]
111104
name = "usb_serial"
112-
required-features = ["rt", "stm32f103", "stm32-usbd"]
105+
required-features = ["rt", "stm32-usbd"]
113106

114107
[[example]]
115108
name = "usb_serial_interrupt"
116-
required-features = ["rt", "stm32f103", "stm32-usbd"]
109+
required-features = ["rt", "stm32-usbd"]
117110

118111
[[example]]
119112
name = "usb_serial_rtfm"
120-
required-features = ["rt", "stm32f103", "stm32-usbd"]
113+
required-features = ["rt", "stm32-usbd"]
121114

122115
[[example]]
123116
name = "blinky_timer_irq"
124-
required-features = ["medium", "rt", "stm32f103"]
117+
required-features = ["rt"]
125118

119+
[[example]]
120+
name = "qei"
121+
required-features = ["medium"]
122+
123+
[[example]]
124+
name = "timer-interrupt-rtfm"
125+
required-features = ["rt", "medium"]
126+
127+
[[example]]
128+
name = "exti"
129+
required-features = ["rt"]

examples/delay.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ fn main() -> ! {
2828
#[cfg(feature = "stm32f101")]
2929
let mut led = gpioc.pc9.into_push_pull_output(&mut gpioc.crh);
3030

31-
#[cfg(feature = "stm32f103")]
31+
#[cfg(any(feature = "stm32f103", feature = "stm32f105", feature = "stm32f107"))]
3232
let mut led = gpioc.pc13.into_push_pull_output(&mut gpioc.crh);
3333

3434
let mut delay = Delay::new(cp.SYST, clocks);

examples/led.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ fn main() -> ! {
4040
.set_high()
4141
.unwrap();
4242

43-
#[cfg(feature = "stm32f103")]
43+
#[cfg(any(feature = "stm32f103", feature = "stm32f105", feature = "stm32f107"))]
4444
gpioc
4545
.pc13
4646
.into_push_pull_output(&mut gpioc.crh)

0 commit comments

Comments
 (0)