File tree Expand file tree Collapse file tree 3 files changed +16
-16
lines changed
Expand file tree Collapse file tree 3 files changed +16
-16
lines changed Original file line number Diff line number Diff 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 ) {
Original file line number Diff line number Diff line change 1010};
1111
1212void 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 );
1616uint8_t usb_device_state_get_protocol ();
1717
1818void usb_interrupt_handler () __interrupt (_INT_USB );
Original file line number Diff line number Diff line change 66static __xdata uint16_t last_system_usage = 0 ;
77static __xdata uint16_t last_consumer_usage = 0 ;
88
9+ static __xdata report_extra_t extra_report ;
10+
911void 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
3132void 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}
You can’t perform that action at this time.
0 commit comments