Skip to content

Commit a72865b

Browse files
authored
Allow pio_encode_sideset_opt(0, value) (#2485)
1 parent b3aed37 commit a72865b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/rp2_common/hardware_pio/include/hardware/pio_instructions.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ static inline uint pio_encode_sideset(uint sideset_bit_count, uint value) {
148148
* \return the side set bits to be ORed with an instruction encoding
149149
*/
150150
static inline uint pio_encode_sideset_opt(uint sideset_bit_count, uint value) {
151-
valid_params_if(PIO_INSTRUCTIONS, sideset_bit_count >= 1 && sideset_bit_count <= 4);
151+
valid_params_if(PIO_INSTRUCTIONS, sideset_bit_count >= 0 && sideset_bit_count <= 4);
152152
valid_params_if(PIO_INSTRUCTIONS, value <= ((1u << sideset_bit_count) - 1));
153153
return 0x1000u | value << (12u - sideset_bit_count);
154154
}

0 commit comments

Comments
 (0)