Skip to content

Commit

Permalink
fix extra keys
Browse files Browse the repository at this point in the history
  • Loading branch information
carlossless committed Jan 1, 2025
1 parent b804f25 commit f3f6596
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 22 deletions.
6 changes: 3 additions & 3 deletions src/keyboards/example/kb.c
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
#include "report.h"
#include "usb.h"

void kb_send_report(report_keyboard_t *report)
void kb_send_report(__xdata report_keyboard_t *report)
{
usb_send_report(report);
}

void kb_send_nkro(report_nkro_t *report)
void kb_send_nkro(__xdata report_nkro_t *report)
{
usb_send_nkro(report);
}

void kb_send_extra(report_extra_t *report)
void kb_send_extra(__xdata report_extra_t *report)
{
usb_send_extra(report);
}
6 changes: 3 additions & 3 deletions src/keyboards/eyooso-z11/kb.c
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
#include "report.h"
#include "usb.h"

void kb_send_report(report_keyboard_t *report)
void kb_send_report(__xdata report_keyboard_t *report)
{
usb_send_report(report);
}

void kb_send_nkro(report_nkro_t *report)
void kb_send_nkro(__xdata report_nkro_t *report)
{
usb_send_nkro(report);
}

void kb_send_extra(report_extra_t *report)
void kb_send_extra(__xdata report_extra_t *report)
{
usb_send_extra(report);
}
6 changes: 3 additions & 3 deletions src/platform/sh68f90a/usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@ void usb_init()
IEN1 |= _EUSB;
}

void usb_send_report(report_keyboard_t *report)
void usb_send_report(__xdata report_keyboard_t *report)
{
uint8_t timeout = 0;
while (timeout < 255 && EP1CON & _IEP1RDY) {
Expand All @@ -371,7 +371,7 @@ void usb_send_report(report_keyboard_t *report)
SET_EP1_IN_RDY;
}

void usb_send_nkro(report_nkro_t *report)
void usb_send_nkro(__xdata report_nkro_t *report)
{
uint8_t timeout = 0;
while (timeout < 255 && EP2CON & _IEP2RDY) {
Expand All @@ -385,7 +385,7 @@ void usb_send_nkro(report_nkro_t *report)
SET_EP2_IN_RDY;
}

void usb_send_extra(report_extra_t *report)
void usb_send_extra(__xdata report_extra_t *report)
{
uint8_t timeout = 0;
while (timeout < 255 && EP2CON & _IEP2RDY) {
Expand Down
6 changes: 3 additions & 3 deletions src/platform/sh68f90a/usb.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ enum {
};

void usb_init();
void usb_send_report(report_keyboard_t *report);
void usb_send_nkro(report_nkro_t *report);
void usb_send_extra(report_extra_t *report);
void usb_send_report(__xdata report_keyboard_t *report);
void usb_send_nkro(__xdata report_nkro_t *report);
void usb_send_extra(__xdata report_extra_t *report);
uint8_t usb_device_state_get_protocol();

void usb_interrupt_handler() __interrupt(_INT_USB);
20 changes: 10 additions & 10 deletions src/smk/host.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
static __xdata uint16_t last_system_usage = 0;
static __xdata uint16_t last_consumer_usage = 0;

static __xdata report_extra_t extra_report;

void host_keyboard_send(__xdata report_keyboard_t *report)
{
kb_send_report(report);
Expand All @@ -21,21 +23,19 @@ void host_system_send(uint16_t usage)
if (usage == last_system_usage) return;
last_system_usage = usage;

__xdata report_extra_t report = {
.report_id = REPORT_ID_SYSTEM,
.usage = usage,
};
kb_send_extra(&report);
extra_report.report_id = REPORT_ID_SYSTEM;
extra_report.usage = usage;

kb_send_extra(&extra_report);
}

void host_consumer_send(uint16_t usage)
{
if (usage == last_consumer_usage) return;
last_consumer_usage = usage;

__xdata report_extra_t report = {
.report_id = REPORT_ID_CONSUMER,
.usage = usage,
};
kb_send_extra(&report);
extra_report.report_id = REPORT_ID_CONSUMER;
extra_report.usage = usage;

kb_send_extra(&extra_report);
}

0 comments on commit f3f6596

Please sign in to comment.