Skip to content
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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

jfischer-no
Copy link
Collaborator

@jfischer-no jfischer-no commented Feb 3, 2025

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.

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>
@zephyrbot zephyrbot added area: Samples Samples area: USB Universal Serial Bus labels Feb 3, 2025
@zephyrbot zephyrbot requested a review from nashif February 3, 2025 13:38
@kartben kartben assigned jfischer-no and unassigned kartben Feb 3, 2025
name[ROUND_UP(size, UDC_BUF_GRANULARITY)];
name[ROUND_UP(size, UDC_BUF_GRANULARITY)]
Copy link
Member

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.

Copy link
Collaborator Author

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.

@tmon-nordic tmon-nordic requested a review from tejlmand February 5, 2025 08:20
* 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));
Copy link
Collaborator

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?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Opened #85236

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Samples Samples area: USB Universal Serial Bus
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants