pio: Fix marking used instruction space.

This commit is contained in:
Mathias Gottschlag 2021-09-28 20:07:25 +02:00
parent 2ff9ae156f
commit 959f714fb9

View file

@ -229,7 +229,7 @@ impl<P: PIOExt> PIO<P> {
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