Skip to content

Commit

Permalink
Fix encoding of IN instruction with bit_count == 32
Browse files Browse the repository at this point in the history
Thanks to @xeniarose for finding and reporting this bug

Fixes #57
  • Loading branch information
jannic committed Mar 21, 2024
1 parent 42e8c13 commit acd253c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

- Fixed encoding of IN instruction with `bit_count` == 32

## [0.2.1] [Crates.io](https://crates.io/crates/pio-rs/0.2.1) [Github](https://github.com/rp-rs/pio-rs/releases/tag/v0.2.1)

- Fixed the search path for `pio_file` when using relative paths
Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ impl InstructionOperands {
*index | (if *relative { 0b10000 } else { 0 }),
)
}
InstructionOperands::IN { source, bit_count } => (*source as u8, *bit_count),
InstructionOperands::IN { source, bit_count } => (*source as u8, *bit_count & 0b11111),
InstructionOperands::OUT {
destination,
bit_count,
Expand Down

0 comments on commit acd253c

Please sign in to comment.