Skip to content

Commit a52f011

Browse files
barafaelRafael Bachmann
authored andcommitted
Use an array instead of heapless::Vec for intervals
1 parent f8098e0 commit a52f011

File tree

1 file changed

+9
-9
lines changed
  • rtic_v1/stm32l4_heartbeat/src

1 file changed

+9
-9
lines changed

rtic_v1/stm32l4_heartbeat/src/main.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
#![no_main]
44
#![no_std]
55

6-
use heapless::Vec;
76
use panic_rtt_target as _;
87
use rtic::app;
98
use rtt_target::{rprintln, rtt_init_print};
@@ -21,7 +20,7 @@ mod app {
2120
#[local]
2221
struct Local {
2322
led: PB3<Output<PushPull>>,
24-
intervals: Vec<u32, 6>,
23+
intervals: [u32; 6],
2524
}
2625

2726
#[monotonic(binds = SysTick, default = true)]
@@ -48,13 +47,14 @@ mod app {
4847
led.set_low();
4948

5049
// Simple heart beat LED on/off sequence
51-
let mut intervals: Vec<u32, 6> = Vec::new();
52-
intervals.push(30).unwrap(); // P Wave
53-
intervals.push(40).unwrap(); // PR Segment
54-
intervals.push(120).unwrap(); // QRS Complex
55-
intervals.push(30).unwrap(); // ST Segment
56-
intervals.push(60).unwrap(); // T Wave
57-
intervals.push(720).unwrap(); // Rest
50+
let intervals: [u32; 6] = [
51+
30, // P Wave
52+
40, // PR Segment
53+
120, // QRS Complex
54+
30, // ST Segment
55+
60, // T Wave
56+
720, // Rest
57+
];
5858

5959
// Schedule the blinking task
6060
blink::spawn(0).unwrap();

0 commit comments

Comments
 (0)