diff options
| author | Felipe Balbi <[email protected]> | 2025-11-17 16:36:19 -0800 |
|---|---|---|
| committer | Felipe Balbi <[email protected]> | 2025-11-17 16:36:19 -0800 |
| commit | 017c8020f56a996182788202c8bc9da1cf4d503a (patch) | |
| tree | c953f04faecd06123a7beb788d729fe10c705270 /examples | |
| parent | 02285c2153d22f2c0c93a4ce920cdebc03f18658 (diff) | |
| parent | 62e297c130ac26afe4d7d5752bb79709bd370e39 (diff) | |
Merge remote-tracking branch 'odp/main' into james/impl-clocks
Diffstat (limited to 'examples')
| -rw-r--r-- | examples/.cargo/config.toml | 2 | ||||
| -rw-r--r-- | examples/Cargo.lock | 1 | ||||
| -rw-r--r-- | examples/Cargo.toml | 4 | ||||
| -rw-r--r-- | examples/memory.x | 4 | ||||
| -rw-r--r-- | examples/src/bin/blink.rs | 4 |
5 files changed, 11 insertions, 4 deletions
diff --git a/examples/.cargo/config.toml b/examples/.cargo/config.toml index ecb11be64..aedc55b06 100644 --- a/examples/.cargo/config.toml +++ b/examples/.cargo/config.toml | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | [target.thumbv8m.main-none-eabihf] | 1 | [target.thumbv8m.main-none-eabihf] |
| 2 | runner = 'probe-rs run --chip MCXA276 --preverify --verify' | 2 | runner = 'probe-rs run --chip MCXA276 --preverify --verify --protocol swd --speed 12000' |
| 3 | 3 | ||
| 4 | rustflags = [ | 4 | rustflags = [ |
| 5 | "-C", "linker=flip-link", | 5 | "-C", "linker=flip-link", |
diff --git a/examples/Cargo.lock b/examples/Cargo.lock index b774aff97..b2ac9a051 100644 --- a/examples/Cargo.lock +++ b/examples/Cargo.lock | |||
| @@ -240,7 +240,6 @@ dependencies = [ | |||
| 240 | "critical-section", | 240 | "critical-section", |
| 241 | "defmt", | 241 | "defmt", |
| 242 | "embassy-embedded-hal", | 242 | "embassy-embedded-hal", |
| 243 | "embassy-executor", | ||
| 244 | "embassy-hal-internal", | 243 | "embassy-hal-internal", |
| 245 | "embassy-sync", | 244 | "embassy-sync", |
| 246 | "embassy-time", | 245 | "embassy-time", |
diff --git a/examples/Cargo.toml b/examples/Cargo.toml index 6b100de42..d03d3d95c 100644 --- a/examples/Cargo.toml +++ b/examples/Cargo.toml | |||
| @@ -19,3 +19,7 @@ embassy-time-driver = "0.2.1" | |||
| 19 | embedded-io-async = "0.6.1" | 19 | embedded-io-async = "0.6.1" |
| 20 | heapless = "0.9.2" | 20 | heapless = "0.9.2" |
| 21 | panic-probe = { version = "1.0", features = ["print-defmt"] } | 21 | panic-probe = { version = "1.0", features = ["print-defmt"] } |
| 22 | |||
| 23 | [profile.release] | ||
| 24 | lto = true # better optimizations | ||
| 25 | debug = 2 # enough information for defmt/rtt locations | ||
diff --git a/examples/memory.x b/examples/memory.x index 528545b64..315ced58a 100644 --- a/examples/memory.x +++ b/examples/memory.x | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | MEMORY | 1 | MEMORY |
| 2 | { | 2 | { |
| 3 | FLASH : ORIGIN = 0x20000000, LENGTH = 80K | 3 | FLASH : ORIGIN = 0x00000000, LENGTH = 1M |
| 4 | RAM : ORIGIN = 0x20014000, LENGTH = 48K | 4 | RAM : ORIGIN = 0x20000000, LENGTH = 128K |
| 5 | } | 5 | } |
diff --git a/examples/src/bin/blink.rs b/examples/src/bin/blink.rs index 8c48e79f1..d8b158d50 100644 --- a/examples/src/bin/blink.rs +++ b/examples/src/bin/blink.rs | |||
| @@ -26,6 +26,8 @@ async fn main(_spawner: Spawner) { | |||
| 26 | init_led_gpio_clocks(hal::pac()); | 26 | init_led_gpio_clocks(hal::pac()); |
| 27 | } | 27 | } |
| 28 | 28 | ||
| 29 | defmt::info!("Blink example"); | ||
| 30 | |||
| 29 | // Initialize embassy-time global driver backed by OSTIMER0 | 31 | // Initialize embassy-time global driver backed by OSTIMER0 |
| 30 | hal::ostimer::time_driver::init(hal::config::Config::default().time_interrupt_priority, 1_000_000); | 32 | hal::ostimer::time_driver::init(hal::config::Config::default().time_interrupt_priority, 1_000_000); |
| 31 | 33 | ||
| @@ -41,6 +43,8 @@ async fn main(_spawner: Spawner) { | |||
| 41 | // With pauses between letters and words | 43 | // With pauses between letters and words |
| 42 | 44 | ||
| 43 | loop { | 45 | loop { |
| 46 | defmt::info!("SOS"); | ||
| 47 | |||
| 44 | // S: three short blinks | 48 | // S: three short blinks |
| 45 | for _ in 0..3 { | 49 | for _ in 0..3 { |
| 46 | led.set_low(); | 50 | led.set_low(); |
