Skip to content

Commit

Permalink
samples: hid-keyboard: initialize report buffer at startup
Browse files Browse the repository at this point in the history
The buffer could be placed in a memory area that is not initialized
after a CPU reset.

Signed-off-by: Johann Fischer <[email protected]>
  • Loading branch information
jfischer-no committed Feb 1, 2025
1 parent dfe29d8 commit 839bcdc
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions samples/subsys/usb/hid-keyboard/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,8 @@ int main(void)
}
}

memset(&report, 0, sizeof(report));

hid_dev = DEVICE_DT_GET_ONE(zephyr_hid_device);
if (!device_is_ready(hid_dev)) {
LOG_ERR("HID Device is not ready");
Expand Down

0 comments on commit 839bcdc

Please sign in to comment.