-
Notifications
You must be signed in to change notification settings - Fork 92
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(PeriphDrivers): Fix UART DMA Callbacks for UART1+ #1004
Conversation
I recommend designated initializers instead of runtime. That way you don't need any runtime operations after and need to manage more global state. #define NUM_MEMBERS 4
typedef struct
{
int32_t a , b, c;
}example_t;
example_t test[NUM_MEMBERS] = {
[0 ... NUM_MEMBERS - 1] = {.a = -1, .b = -1, .c = -1}
}; |
Thanks @EricB-ADI, I was looking for this type of syntax. Just updated the PR |
@EricB-ADI ready for final review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wow, never knew this syntax existed.
This reverts commit 4495706.
Description
Fixes #998
As the internal UART state struct was only initialized per used UART instance, attempting to use UART1 (or higher) with DMA auto handlers would never trigger the user's callback functions. The state struct's DMA channel values would be initialized to 0 instead of -1, which the drivers would assume was a valid channel acquisition.
This PR fixes the bug by initializing the UART state array correctly.
Checklist Before Requesting Review