Skip to content

Commit 8df358d

Browse files
committed
examples
1 parent cee408e commit 8df358d

16 files changed

+24
-24
lines changed

examples/adc.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ fn main() -> ! {
3030
adc.set_oversampling_shift(16);
3131
adc.oversampling_enable(true);
3232

33-
delay.delay(20.us()); // Wait for ADC voltage regulator to stabilize
33+
delay.delay(20.micros()); // Wait for ADC voltage regulator to stabilize
3434
adc.calibrate();
3535

3636
let mut adc_pin = gpioa.pa0.into_analog();

examples/adc_ext_trig_double_dma_serial.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ fn main() -> ! {
191191

192192
// don't enabel the timer bevor the dma
193193
// Set up a timer expiring after
194-
timer.start(50.us());
194+
timer.start(50.micros());
195195
timer.listen();
196196

197197
//enable DMA_CHANNEL1 interrupt

examples/blinky_delay.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,6 @@ fn main() -> ! {
2424

2525
loop {
2626
led.toggle().unwrap();
27-
delay.delay(500.ms());
27+
delay.delay(500.millis());
2828
}
2929
}

examples/blinky_random.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ fn main() -> ! {
3737
match rng.gen_range(20, 200) {
3838
Ok(period) => {
3939
led.toggle().unwrap();
40-
delay.delay(period.ms());
40+
delay.delay(period.millis());
4141
}
4242
Err(err) => hprintln!("RNG error: {:?}", err).unwrap(),
4343
}

examples/blinky_timer.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ fn main() -> ! {
2323
let mut led = gpioa.pa5.into_push_pull_output();
2424

2525
let mut timer = dp.TIM17.timer(&mut rcc);
26-
timer.start(500.ms());
26+
timer.start(500.millis());
2727

2828
loop {
2929
led.toggle().unwrap();

examples/button.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ fn main() -> ! {
2828

2929
loop {
3030
let wait = match button.is_high() {
31-
Ok(true) => 300.ms(),
32-
Ok(false) => 100.ms(),
31+
Ok(true) => 300.millis(),
32+
Ok(false) => 100.millis(),
3333
_ => unreachable!(),
3434
};
3535
delay.delay(wait);

examples/ir_remote.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ const APP: () = {
5151
timer.start(IR_SAMPLERATE);
5252
timer.listen();
5353

54-
let carrier_timer = ctx.device.TIM17.pwm(38.khz(), &mut rcc);
54+
let carrier_timer = ctx.device.TIM17.pwm(38.kHz(), &mut rcc);
5555
let mut ir_pin = carrier_timer.bind_pin(gpiob.pb9);
5656
ir_pin.set_duty(ir_pin.get_max_duty() / 2);
5757
let transmitter = Sender::new(IR_SAMPLERATE.0, ir_pin);

examples/opm.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ const APP: () = {
3737
let led = gpioa.pa5.into_push_pull_output();
3838
gpioc.pc13.listen(SignalEdge::Falling, &mut exti);
3939

40-
let opm = ctx.device.TIM3.opm(4.ms(), &mut rcc);
40+
let opm = ctx.device.TIM3.opm(4.millis(), &mut rcc);
4141

4242
let mut opm_ch1 = opm.bind_pin(gpioa.pa6);
4343
let mut opm_ch2 = opm.bind_pin(gpioa.pa7);

examples/pwm.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ fn main() -> ! {
2020

2121
let mut rcc = dp.RCC.constrain();
2222
let gpioa = dp.GPIOA.split(&mut rcc);
23-
let mut pwm = dp.TIM1.pwm(10.khz(), &mut rcc);
23+
let mut pwm = dp.TIM1.pwm(10.kHz(), &mut rcc);
2424

2525
let mut pwm_ch1 = pwm.bind_pin(gpioa.pa8);
2626
let mut pwm_ch2 = pwm.bind_pin(gpioa.pa9);
@@ -41,7 +41,7 @@ fn main() -> ! {
4141
pwm_ch2.set_duty(max / 16);
4242
asm::bkpt();
4343

44-
pwm.set_freq(20.khz());
44+
pwm.set_freq(20.kHz());
4545

4646
loop {}
4747
}

examples/rtic.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,15 +40,15 @@ mod app {
4040
let gpioc = ctx.device.GPIOC.split(&mut rcc);
4141

4242
let mut timer = ctx.device.TIM17.timer(&mut rcc);
43-
timer.start(3.hz());
43+
timer.start(3.Hz());
4444
timer.listen();
4545

4646
let mut exti = ctx.device.EXTI;
4747
gpioc.pc13.listen(SignalEdge::Falling, &mut exti);
4848

4949
let mut rtc = ctx.device.RTC.constrain(&mut rcc);
5050
rtc.set_date(&Date::new(2019.year(), 11.month(), 24.day()));
51-
rtc.set_time(&Time::new(21.hours(), 15.minutes(), 10.seconds(), false));
51+
rtc.set_time(&Time::new(21.hours(), 15.minutes(), 10.secs(), false));
5252

5353
(
5454
Shared {},

0 commit comments

Comments
 (0)