mirror of
https://github.com/raspberrypi/pico-sdk.git
synced 2025-08-07 17:02:52 +03:00
Fix WAIT GPIO n
for n > 32 and when using gpio_base = 16 (#2265)
- fix bug: pioasm was spilling bit 5 of arg2 into arg1 - make pio_add_program flip bit 5 of a WAIT GPIO instruction if gpio_base is 16 Note: pioasm will encode only the bits 4-0 of arg2 (the GPIO number), however it does indicate whether 0-15 means 0-15 or 32-47. This can only be fixed up when loading the program, and indeed once the GPIO base is known. pio_can_add_program and friends already detected the cases where this was impossible
This commit is contained in:
@@ -292,7 +292,7 @@ uint instruction::encode(program &program) {
|
||||
}
|
||||
}
|
||||
// note we store the 6th bit of arg2 above the 16 bits of instruction
|
||||
return (((uint) raw.type) << 13u) | (((uint) _delay | (uint) _sideset) << 8u) | (raw.arg1 << 5u) | raw.arg2 | ((raw.arg2 >> 5) << 16);
|
||||
return (((uint) raw.type) << 13u) | (((uint) _delay | (uint) _sideset) << 8u) | (raw.arg1 << 5u) | (raw.arg2 & 0x1fu) | ((raw.arg2 >> 5) << 16);
|
||||
}
|
||||
|
||||
raw_encoding instruction::raw_encode(program& program) {
|
||||
|
Reference in New Issue
Block a user