Controllers/MNTKeyboardController: MSVC does not like C99 variable length...

This commit is contained in:
josch
2025-12-06 21:46:21 +00:00
committed by Adam Honse
parent 246150b44a
commit 0b5010cda6
2 changed files with 4 additions and 2 deletions

View File

@@ -20,7 +20,7 @@ void MNTKeyboardController::SendColorMatrix(unsigned char *color_map)
{
unsigned char row_size = kbd_cols * KBD_COLOR_SIZE;
unsigned char cmdbuf_size = CMD_OFFSET + row_size;
unsigned char usb_buf[cmdbuf_size];
unsigned char *usb_buf = new unsigned char[cmdbuf_size];
memcpy(usb_buf, CMD_PREFIX, CMD_PREFIX_LEN);
for(unsigned int row_idx = 0; row_idx < KBD_ROWS; row_idx++)
{
@@ -28,4 +28,5 @@ void MNTKeyboardController::SendColorMatrix(unsigned char *color_map)
memcpy(usb_buf + CMD_OFFSET, color_map + row_idx * row_size, row_size);
hid_write(dev, usb_buf, cmdbuf_size);
}
delete[] usb_buf;
}