Skip to content

Commit edb498d

Browse files
committed
adjusted nkro report size, it now works
1 parent 90aeb6c commit edb498d

File tree

4 files changed

+16
-8
lines changed

4 files changed

+16
-8
lines changed

src/main.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,6 @@ void main()
5252
{
5353
init();
5454

55-
delay_ms(1000); // perhaps clocks are unstable at this point? influences UART
56-
5755
dprintf("SMK v" TOSTRING(SMK_VERSION) "\r\n");
5856
dprintf("DEVICE vId:" TOSTRING(USB_VID) " pId:" TOSTRING(USB_PID) "\n\r");
5957

src/platform/sh68f90a/usb.c

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,16 @@ const uint8_t hid_report_desc_extra[] = {
133133
HID_RI_COLLECTION(8, 0x01), // Application
134134
HID_RI_REPORT_ID(8, REPORT_ID_NKRO),
135135
// Modifiers (8 bits)
136+
HID_RI_USAGE_PAGE(8, 0x07), // Keyboard/Keypad
137+
HID_RI_USAGE_MINIMUM(8, 0xe0), // Keyboard Left Control
138+
HID_RI_USAGE_MAXIMUM(8, 0xe7), // Keyboard Right Gui
139+
HID_RI_LOGICAL_MINIMUM(8, 0x00),
140+
HID_RI_LOGICAL_MAXIMUM(8, 0x01),
141+
HID_RI_REPORT_SIZE(8, 0x01),
142+
HID_RI_REPORT_COUNT(8, 0x08),
143+
HID_RI_INPUT(8, HID_IOF_DATA | HID_IOF_VARIABLE | HID_IOF_ABSOLUTE),
144+
145+
// NKRO
136146
HID_RI_USAGE_PAGE(8, 0x07), // Keyboard/Keypad
137147
HID_RI_USAGE_MINIMUM(8, 0x00), // was 0x04
138148
HID_RI_USAGE_MAXIMUM(8, NKRO_REPORT_BITS * 8 - 1), // was 0x70
@@ -369,9 +379,9 @@ void usb_send_nkro(report_nkro_t *report)
369379
timeout++;
370380
}
371381

372-
set_ep2_in_buffer(report->raw, sizeof(report_nkro_t));
382+
set_ep2_in_buffer(report->raw, NKRO_REPORT_SIZE);
373383

374-
SET_EP2_CNT(sizeof(report_nkro_t));
384+
SET_EP2_CNT(NKRO_REPORT_SIZE);
375385
SET_EP2_IN_RDY;
376386
}
377387

@@ -383,9 +393,9 @@ void usb_send_extra(report_extra_t *report)
383393
timeout++;
384394
}
385395

386-
set_ep2_in_buffer(report->raw, sizeof(report_extra_t));
396+
set_ep2_in_buffer(report->raw, EXTRA_REPORT_SIZE);
387397

388-
SET_EP2_CNT(sizeof(report_extra_t));
398+
SET_EP2_CNT(EXTRA_REPORT_SIZE);
389399
SET_EP2_IN_RDY;
390400
}
391401

src/smk/report.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ void send_6kro_report()
5555
#ifdef NKRO_ENABLE
5656
void send_nkro_report()
5757
{
58-
nkro_report.report_id = REPORT_ID_NKRO; // TODO: set this once
58+
nkro_report.report_id = REPORT_ID_NKRO; // TODO: set this more permanently
5959
nkro_report.mods = real_mods;
6060
nkro_report.mods |= weak_mods;
6161

src/smk/report.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
#define KEYBOARD_REPORT_SIZE 8
88
#define KEYBOARD_REPORT_KEYS 6
99

10+
#define NKRO_REPORT_BITS 13
1011
#define NKRO_REPORT_SIZE 2 + NKRO_REPORT_BITS
11-
#define NKRO_REPORT_BITS 30
1212

1313
#define EXTRA_REPORT_SIZE 3
1414

0 commit comments

Comments
 (0)