Skip to content

Commit a38be0c

Browse files
committed
fix extra keys
1 parent b804f25 commit a38be0c

File tree

3 files changed

+16
-16
lines changed

3 files changed

+16
-16
lines changed

src/platform/sh68f90a/usb.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,7 @@ void usb_init()
357357
IEN1 |= _EUSB;
358358
}
359359

360-
void usb_send_report(report_keyboard_t *report)
360+
void usb_send_report(__xdata report_keyboard_t *report)
361361
{
362362
uint8_t timeout = 0;
363363
while (timeout < 255 && EP1CON & _IEP1RDY) {
@@ -371,7 +371,7 @@ void usb_send_report(report_keyboard_t *report)
371371
SET_EP1_IN_RDY;
372372
}
373373

374-
void usb_send_nkro(report_nkro_t *report)
374+
void usb_send_nkro(__xdata report_nkro_t *report)
375375
{
376376
uint8_t timeout = 0;
377377
while (timeout < 255 && EP2CON & _IEP2RDY) {
@@ -385,7 +385,7 @@ void usb_send_nkro(report_nkro_t *report)
385385
SET_EP2_IN_RDY;
386386
}
387387

388-
void usb_send_extra(report_extra_t *report)
388+
void usb_send_extra(__xdata report_extra_t *report)
389389
{
390390
uint8_t timeout = 0;
391391
while (timeout < 255 && EP2CON & _IEP2RDY) {

src/platform/sh68f90a/usb.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ enum {
1010
};
1111

1212
void usb_init();
13-
void usb_send_report(report_keyboard_t *report);
14-
void usb_send_nkro(report_nkro_t *report);
15-
void usb_send_extra(report_extra_t *report);
13+
void usb_send_report(__xdata report_keyboard_t *report);
14+
void usb_send_nkro(__xdata report_nkro_t *report);
15+
void usb_send_extra(__xdata report_extra_t *report);
1616
uint8_t usb_device_state_get_protocol();
1717

1818
void usb_interrupt_handler() __interrupt(_INT_USB);

src/smk/host.c

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
static __xdata uint16_t last_system_usage = 0;
77
static __xdata uint16_t last_consumer_usage = 0;
88

9+
static __xdata report_extra_t extra_report;
10+
911
void host_keyboard_send(__xdata report_keyboard_t *report)
1012
{
1113
kb_send_report(report);
@@ -21,21 +23,19 @@ void host_system_send(uint16_t usage)
2123
if (usage == last_system_usage) return;
2224
last_system_usage = usage;
2325

24-
__xdata report_extra_t report = {
25-
.report_id = REPORT_ID_SYSTEM,
26-
.usage = usage,
27-
};
28-
kb_send_extra(&report);
26+
extra_report.report_id = REPORT_ID_SYSTEM;
27+
extra_report.usage = usage;
28+
29+
kb_send_extra(&extra_report);
2930
}
3031

3132
void host_consumer_send(uint16_t usage)
3233
{
3334
if (usage == last_consumer_usage) return;
3435
last_consumer_usage = usage;
3536

36-
__xdata report_extra_t report = {
37-
.report_id = REPORT_ID_CONSUMER,
38-
.usage = usage,
39-
};
40-
kb_send_extra(&report);
37+
extra_report.report_id = REPORT_ID_CONSUMER;
38+
extra_report.usage = usage;
39+
40+
kb_send_extra(&extra_report);
4141
}

0 commit comments

Comments
 (0)