From 959f714fb95b8c585e5d5b539b820d0291178c5e Mon Sep 17 00:00:00 2001 From: Mathias Gottschlag Date: Tue, 28 Sep 2021 20:07:25 +0200 Subject: [PATCH] pio: Fix marking used instruction space. --- rp2040-hal/src/pio.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rp2040-hal/src/pio.rs b/rp2040-hal/src/pio.rs index 3b97e2d..1bf15da 100644 --- a/rp2040-hal/src/pio.rs +++ b/rp2040-hal/src/pio.rs @@ -229,7 +229,7 @@ impl PIO

{ self.pio.instr_mem[i + offset].write(|w| unsafe { w.bits(instr as u32) }) } self.used_instruction_space = - self.used_instruction_space | ((1 << instructions.len()) - 1); + self.used_instruction_space | (((1 << p.code.len()) - 1) << offset); Some(offset) } else { None