diff options
| author | Daniel Philipp <[email protected]> | 2024-06-12 19:40:28 +0200 |
|---|---|---|
| committer | GitHub <[email protected]> | 2024-06-12 19:40:28 +0200 |
| commit | 8b0cfde9a6c42ae45463eea42d4749bf919e3ffc (patch) | |
| tree | 4e34a22b6213639c6027e500bcd3c21d4af5cbe0 /examples/stm32h7rs/src/bin/multiprio.rs | |
| parent | dbe21730cdc0a5ce694e7cc84927149452079867 (diff) | |
Clarified comments about the cortex_m::asm::delay functionality in al… (#3064)
* Clarified comments about the cortex_m::asm::delay functionality in all multiprio.rs examples
* fixed formatting
* Changed to using embassy_time::block_for()
* removed my formatting scripts
* specify embassy_time::Duration
Diffstat (limited to 'examples/stm32h7rs/src/bin/multiprio.rs')
| -rw-r--r-- | examples/stm32h7rs/src/bin/multiprio.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/examples/stm32h7rs/src/bin/multiprio.rs b/examples/stm32h7rs/src/bin/multiprio.rs index fcbb6c653..b4620888f 100644 --- a/examples/stm32h7rs/src/bin/multiprio.rs +++ b/examples/stm32h7rs/src/bin/multiprio.rs | |||
| @@ -80,7 +80,7 @@ async fn run_med() { | |||
| 80 | info!(" [med] Starting long computation"); | 80 | info!(" [med] Starting long computation"); |
| 81 | 81 | ||
| 82 | // Spin-wait to simulate a long CPU computation | 82 | // Spin-wait to simulate a long CPU computation |
| 83 | cortex_m::asm::delay(128_000_000); // ~1 second | 83 | embassy_time::block_for(embassy_time::Duration::from_secs(1)); // ~1 second |
| 84 | 84 | ||
| 85 | let end = Instant::now(); | 85 | let end = Instant::now(); |
| 86 | let ms = end.duration_since(start).as_ticks() / 33; | 86 | let ms = end.duration_since(start).as_ticks() / 33; |
| @@ -97,7 +97,7 @@ async fn run_low() { | |||
| 97 | info!("[low] Starting long computation"); | 97 | info!("[low] Starting long computation"); |
| 98 | 98 | ||
| 99 | // Spin-wait to simulate a long CPU computation | 99 | // Spin-wait to simulate a long CPU computation |
| 100 | cortex_m::asm::delay(256_000_000); // ~2 seconds | 100 | embassy_time::block_for(embassy_time::Duration::from_secs(2)); // ~2 seconds |
| 101 | 101 | ||
| 102 | let end = Instant::now(); | 102 | let end = Instant::now(); |
| 103 | let ms = end.duration_since(start).as_ticks() / 33; | 103 | let ms = end.duration_since(start).as_ticks() / 33; |
