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.
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.