Skip to content

Commit 50e7801

Browse files
authored
Merge pull request #29 from jannic/hal-0.11-on-target-tests
Fix on-target tests
2 parents 92c282f + fe93de3 commit 50e7801

File tree

3 files changed

+16
-3
lines changed

3 files changed

+16
-3
lines changed

Cargo.toml

+13
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,16 @@ fugit = "0.3.5"
2222
defmt = { version = "0.3.0", optional = true }
2323
either = { version = "1.10.0", default-features = false }
2424
heapless = { version = "0.8.0", default-features = false }
25+
26+
[profile.dev]
27+
codegen-units = 1
28+
incremental = false
29+
lto = 'fat'
30+
opt-level = 's'
31+
32+
[profile.test]
33+
codegen-units = 1
34+
incremental = false
35+
lto = 'fat'
36+
opt-level = 's'
37+

on-target-tests/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ defmt-rtt = "0.4"
2525
defmt-test = "0.3.1"
2626
panic-probe = { version = "0.3", features = ["print-defmt"] }
2727

28-
rp2040-hal = { version = "0.10.0", features = [
28+
rp2040-hal = { version = "0.11.0", features = [
2929
"critical-section-impl",
3030
"defmt",
3131
"rt",

on-target-tests/tests/i2c_tests/blocking.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -105,15 +105,15 @@ pub fn system_setup<T: ValidAddress>(xtal_freq_hz: u32, addr: T) -> State {
105105

106106
critical_section::with(|cs| TARGET.replace(cs, Some(i2c_target)));
107107

108-
static mut STACK: rp2040_hal::multicore::Stack<10240> = rp2040_hal::multicore::Stack::new();
108+
static STACK: rp2040_hal::multicore::Stack<10240> = rp2040_hal::multicore::Stack::new();
109109
unsafe {
110110
// delegate I2C1 irqs to core 1
111111
// If the IRQ is not defined, core 1 will just spin in the default IRQ without doing anything
112112
hal::multicore::Multicore::new(&mut pac.PSM, &mut pac.PPB, &mut sio.fifo)
113113
.cores()
114114
.get_mut(1)
115115
.expect("core 1 is not available")
116-
.spawn(&mut STACK.mem, || {
116+
.spawn(STACK.take().unwrap(), || {
117117
pac::NVIC::unpend(hal::pac::Interrupt::I2C1_IRQ);
118118
pac::NVIC::unmask(hal::pac::Interrupt::I2C1_IRQ);
119119

0 commit comments

Comments
 (0)