You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Having come from Micropython, where I wasn't writing raw assembly, and with the error not pointing at a specific instruction, I hadn't realised that specifying .side_set without opt meant that a side set was mandatory on every instruction, and the PIO example is also slightly misleading:
".side_set 1", // each instruction may set 1 bit
The comment should probably say "each instruction must set 1 bit".
I think the proc macro error could be clearer either if it was possible to isolate the line with an issue (I don't know if this can be done), or alternatively perhaps a change to something like "every instruction requires 'side' set", but being new to Rust and not really knowing how things work yet, I don't want to propose anything more concrete.
The PIO section of the RP2040 datasheet does specify this behaviour, but already having something that was working elsewhere I wasn't looking too closely at it, and being brand new to Rust I was sort of assuming I'd messed up something somewhere else.
The text was updated successfully, but these errors were encountered:
jannic
added a commit
to jannic/rp-hal
that referenced
this issue
Aug 27, 2024
The rp2040 and rp235x example of pio_side_set have diverged a bit.
Port the changes made to the rp235x back to rp2040, where applicable.
Also update a comment, as suggested in rp-rs/pio-rs#62
I've been attempting to port over some PIO code I wrote in Micropython to Rust, and the following error left me very confused:
Having come from Micropython, where I wasn't writing raw assembly, and with the error not pointing at a specific instruction, I hadn't realised that specifying
.side_set
withoutopt
meant that a side set was mandatory on every instruction, and the PIO example is also slightly misleading:The comment should probably say "each instruction must set 1 bit".
I think the proc macro error could be clearer either if it was possible to isolate the line with an issue (I don't know if this can be done), or alternatively perhaps a change to something like "every instruction requires 'side' set", but being new to Rust and not really knowing how things work yet, I don't want to propose anything more concrete.
The PIO section of the RP2040 datasheet does specify this behaviour, but already having something that was working elsewhere I wasn't looking too closely at it, and being brand new to Rust I was sort of assuming I'd messed up something somewhere else.
The text was updated successfully, but these errors were encountered: