rp-rs / pio-rs

Support crate for Raspberry Pi's PIO architecture.
MIT License
149 stars 22 forks source link

Fix encoding of IN instruction with bit_count == 32 w/ tests #60

Closed 9names closed 6 months ago

9names commented 6 months ago

Replaces #58 Fixes #57

9names commented 6 months ago

I did try to add a panic on bit_count == 0, but it breaks existing tests.

jannic commented 6 months ago

I did try to add a panic on bit_count == 0, but it breaks existing tests.

That actually pointed to another bug in the handling of bit_count: The instruction decoder took a value of 0 literally, instead of interpreting it as 32. I fixed that in #58 and added the panic for bit_count == 0.

9names commented 6 months ago

Thanks, glad you worked it out (I'll have to read your fix). I'll close this PR since you've got it covered