Skip to content

Commit d5d5a31

Browse files
committed
Rename adc_dma_rtic to rtic-adc-dma and move it to defmt
Signed-off-by: Alexey Shvetsov <[email protected]>
1 parent 1830113 commit d5d5a31

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

Cargo.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,9 @@ version = "0.3.0"
6161
optional = true
6262

6363
[dev-dependencies]
64+
defmt = "0.3.2"
6465
defmt-rtt = "0.3.2"
66+
panic-probe = { version = "0.3.0", features = [ "print-defmt" ] }
6567
panic-semihosting = "0.6.0"
6668
cortex-m-semihosting = "0.5.0"
6769
heapless = "0.7.16"
@@ -455,7 +457,7 @@ name = "rtic-usart-shell-ssd1306"
455457
required-features = ["stm32f411", "rtic"] # stm32f411
456458

457459
[[example]]
458-
name = "adc_dma_rtic"
460+
name = "rtic-adc-dma"
459461
required-features = ["device-selected", "rtic"] # stm32f401
460462

461463
[[example]]

examples/adc_dma_rtic.rs renamed to examples/rtic-adc-dma.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
#![no_std]
22
#![no_main]
33

4-
use panic_semihosting as _;
4+
use defmt_rtt as _; // global logger
5+
use panic_probe as _;
56

67
#[rtic::app(device = stm32f4xx_hal::pac, dispatchers = [EXTI0])]
78
mod app {
8-
use cortex_m_semihosting::hprintln;
99
use dwt_systick_monotonic::DwtSystick;
1010

1111
use stm32f4xx_hal::{
@@ -126,6 +126,6 @@ mod app {
126126
let temperature = (110.0 - 30.0) * ((raw_temp as f32) - cal30) / (cal110 - cal30) + 30.0;
127127
let voltage = sample_to_millivolts(raw_volt);
128128

129-
hprintln!("temperature: {}, voltage: {}", temperature, voltage).unwrap();
129+
defmt::info!("temperature: {}, voltage: {}", temperature, voltage);
130130
}
131131
}

0 commit comments

Comments
 (0)