-
Notifications
You must be signed in to change notification settings - Fork 7.2k
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
samples: hid-keyboard: clear report buffer at startup #85066
base: main
Are you sure you want to change the base?
samples: hid-keyboard: clear report buffer at startup #85066
Conversation
Remove unnecessary semicolons from macro definitions. The semicolon is added by the macro user. Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
Set the report buffer to 0, since it can be placed in a memory area that is not initialized during boot, for example nocache area. Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
name[ROUND_UP(size, UDC_BUF_GRANULARITY)]; | ||
name[ROUND_UP(size, UDC_BUF_GRANULARITY)] |
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.
Did you intend to include this commit here? Asking since it's not mentioned in the PR description.
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.
I fixed it for you.
* Set the report buffer to 0, since it can be placed in a memory area | ||
* that is not initialized during boot. | ||
*/ | ||
memset(report, 0, sizeof(report)); |
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.
report
is defined with UDC_STATIC_BUF_DEFINE(report, KB_REPORT_COUNT);
which essentially does translate static uint8_t
array with attributes. @tejlmand is it really valid that placing a static array in __nocache
section results in it not being initialized at startup?
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.
Opened #85236
include: udc: remove semicolon from macro definition
Set the report buffer to 0, since it can be placed in a memory area
that is not initialized during boot, for example nocache area.