Skip to content

Commit 4cf09d9

Browse files
committed
bugfix usb keyboard O3 optimization
1 parent 072afc1 commit 4cf09d9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

klib/usb/device/keyboard.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ namespace klib::usb::device {
324324
const __attribute__((aligned(4))) static inline auto serial = string_descriptor("00001337");
325325

326326
// configuration value. Value is set in the set config function
327-
static inline uint8_t configuration = 0x00;
327+
static inline volatile uint8_t configuration = 0x00;
328328

329329
// flag if remote wakeup is supported
330330
static inline bool remote_wakeup = false;
@@ -817,7 +817,7 @@ namespace klib::usb::device {
817817
const auto result = Usb::write(
818818
usb::status_callback<Usb>, usb::control_endpoint,
819819
usb::endpoint_mode::in,
820-
{&configuration, sizeof(configuration)}
820+
{const_cast<uint8_t*>(&configuration), sizeof(configuration)}
821821
);
822822

823823
// check if something went wrong already

0 commit comments

Comments
 (0)