Skip to content

Commit

Permalink
Sync with qmk 0.23.1, changes from edykim
Browse files Browse the repository at this point in the history
  • Loading branch information
jincao1 committed Dec 11, 2023
1 parent 67fcfe4 commit 40da0c3
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 13 deletions.
4 changes: 4 additions & 0 deletions keyboards/nuphy/air75_v2/ansi/ansi.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ extern uint8_t side_speed;
extern uint8_t side_rgb;
extern uint8_t side_colour;

#ifdef NKRO_ENABLE
extern report_nkro_t *nkro_report;
#endif

void rf_uart_init(void);
void rf_device_init(void);
void dev_sts_sync(void);
Expand Down
1 change: 1 addition & 0 deletions keyboards/nuphy/air75_v2/ansi/keymaps/via/rules.mk
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
VIA_ENABLE = yes
NKRO_ENABLE = yes
23 changes: 13 additions & 10 deletions keyboards/nuphy/air75_v2/ansi/rf.c
Original file line number Diff line number Diff line change
Expand Up @@ -93,22 +93,25 @@ void uart_send_report_func(void) {

if (dev_info.link_mode == LINK_USB) return;
keyboard_protocol = 1;
keyboard_report->nkro.mods = get_mods() | get_weak_mods();

if ((dev_info.sys_sw_state == SYS_SW_MAC) && (memcmp(bytekb_report_buf, keyboard_report->raw, 8))) {
no_act_time = 0;
f_bytekb_active = 1;
keyboard_report->raw[1] = 0;
memcpy(bytekb_report_buf, keyboard_report->raw, 8);
#ifdef NKRO_ENABLE
nkro_report->mods = get_mods() | get_weak_mods();
#endif

if ((dev_info.sys_sw_state == SYS_SW_MAC) && (memcmp(bytekb_report_buf, keyboard_report, 8))) {
no_act_time = 0;
f_bytekb_active = 1;
keyboard_report->reserved = 0;
memcpy(bytekb_report_buf, keyboard_report, 8);
uart_send_report(CMD_RPT_BYTE_KB, bytekb_report_buf, 8);
}

else if ((dev_info.sys_sw_state == SYS_SW_WIN) && (memcmp(bitkb_report_buf, &keyboard_report->nkro.mods, 16))) {
#ifdef NKRO_ENABLE
else if ((dev_info.sys_sw_state == SYS_SW_WIN) && (memcmp(bitkb_report_buf, &nkro_report->mods, 16))) {
no_act_time = 0;
f_bitkb_active = 1;
memcpy(&bitkb_report_buf[0], &keyboard_report->nkro.mods, 16);
memcpy(&bitkb_report_buf[0], &nkro_report->mods, 16);
uart_send_report(CMD_RPT_BIT_KB, bitkb_report_buf, 16);
}
#endif

else if (conkb_report != host_last_consumer_usage()) {
uart_send_consumer_report();
Expand Down
4 changes: 2 additions & 2 deletions keyboards/nuphy/air75_v2/ansi/side.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ const uint8_t side_led_index_tab[SIDE_LINE][2] = {
};

#define SIDE_LED_NUM 12
LED_TYPE side_leds[SIDE_LED_NUM] = {0};
rgb_led_t side_leds[SIDE_LED_NUM] = {0};

extern DEV_INFO_STRUCT dev_info;
extern user_config_t user_config;
Expand All @@ -71,7 +71,7 @@ extern bool f_sys_show;
extern bool f_sleep_show;
extern bool f_dev_sleep_enable;

void side_ws2812_setleds(LED_TYPE *ledarray, uint16_t leds);
void side_ws2812_setleds(rgb_led_t *ledarray, uint16_t leds);
void rgb_matrix_update_pwm_buffers(void);

/**
Expand Down
2 changes: 1 addition & 1 deletion keyboards/nuphy/air75_v2/ansi/side_driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ void side_sendByte(uint8_t byte)
}

// Setleds for standard RGB
void side_ws2812_setleds(LED_TYPE *ledarray, uint16_t leds)
void side_ws2812_setleds(rgb_led_t *ledarray, uint16_t leds)
{
// this code is very time dependent, so we need to disable interrupts
chSysLock();
Expand Down

0 comments on commit 40da0c3

Please sign in to comment.