Skip to content

fix: correct IOQSPI SS control mask handling on RP2040#5264

Open
rdon-key wants to merge 1 commit intotinygo-org:devfrom
rdon-key:fix/ioqspi-ss-ctrl-mask
Open

fix: correct IOQSPI SS control mask handling on RP2040#5264
rdon-key wants to merge 1 commit intotinygo-org:devfrom
rdon-key:fix/ioqspi-ss-ctrl-mask

Conversation

@rdon-key
Copy link
Contributor

Fix a bug where logical NOT (!) was used instead of bitwise NOT (~) when clearing the OUTOVER field in the GPIO_QSPI_SS_CTRL register.

As per the RP2040 datasheet, this register contains multiple control fields (such as OEOVER, INOVER, and IRQOVER). Using !mask evaluates to 0 or 1, which causes the entire register to be corrupted instead of just the targeted bits.

While the current behavior might appear to work by coincidence (if other fields are intended to be 0), this fix ensures proper bitwise manipulation and prevents potential side effects.

Reference: RP2040 Datasheet
https://datasheets.raspberrypi.com/rp2040/rp2040-datasheet.pdf

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant