Conversation
Branch Targeting SuggestionYou've targeted the
If This is an automated suggestion to help route contributions to the appropriate branch. |
PR Compliance Guide 🔍All compliance sections have been disabled in the configurations. |
| if (IO_GPIO(io)->odt & mask) { | ||
| IO_GPIO(io)->clr = mask; | ||
| } else { | ||
| IO_GPIO(io)->scr = mask; | ||
| } |
There was a problem hiding this comment.
Suggestion: Refactor the AT32F43x GPIO toggle logic to use the scr register for both setting and clearing pins in a single atomic write, which improves efficiency by removing the if/else branch. [general, importance: 6]
| if (IO_GPIO(io)->odt & mask) { | |
| IO_GPIO(io)->clr = mask; | |
| } else { | |
| IO_GPIO(io)->scr = mask; | |
| } | |
| #elif defined(AT32F43x) | |
| uint32_t toggleMask = mask; | |
| if (IO_GPIO(io)->odt & mask) { | |
| toggleMask <<= 16; | |
| } | |
| IO_GPIO(io)->scr = toggleMask; |
PR Type
Bug fix
Description
This description is generated by an AI tool. It may have inaccuracies
Fixed AT32F43x LED toggle logic using correct register operations
Replaced incorrect bit-shifting approach with proper
clrandscrregistersAdded missing braces for proper conditional statement structure
Diagram Walkthrough
File Walkthrough
io.c
Correct AT32F43x GPIO toggle register operationssrc/main/drivers/io.c
IOToggle()functionusing
clrandscrodtto match proper AT32 HAL usage