fix via not working issue due to incorrect return type of via_command_kb() in k2/6/8_pro.c

This commit is contained in:
lokher 2022-12-23 15:25:45 +08:00
parent 093ea22832
commit e7d97ceb04
3 changed files with 16 additions and 4 deletions

View File

@ -273,7 +273,7 @@ void battery_calculte_voltage(uint16_t value) {
battery_set_voltage(voltage); battery_set_voltage(voltage);
} }
void via_command_kb(uint8_t *data, uint8_t length) { bool via_command_kb(uint8_t *data, uint8_t length) {
switch (data[0]) { switch (data[0]) {
#ifdef KC_BLUETOOTH_ENABLE #ifdef KC_BLUETOOTH_ENABLE
case 0xAA: case 0xAA:
@ -285,7 +285,11 @@ void via_command_kb(uint8_t *data, uint8_t length) {
factory_test_rx(data, length); factory_test_rx(data, length);
break; break;
#endif #endif
default:
return false;
} }
return true;
} }
#if !defined(VIA_ENABLE) #if !defined(VIA_ENABLE)

View File

@ -270,7 +270,7 @@ void battery_calculte_voltage(uint16_t value) {
battery_set_voltage(voltage); battery_set_voltage(voltage);
} }
void via_command_kb(uint8_t *data, uint8_t length) { bool via_command_kb(uint8_t *data, uint8_t length) {
switch (data[0]) { switch (data[0]) {
#ifdef KC_BLUETOOTH_ENABLE #ifdef KC_BLUETOOTH_ENABLE
case 0xAA: case 0xAA:
@ -282,7 +282,11 @@ void via_command_kb(uint8_t *data, uint8_t length) {
factory_test_rx(data, length); factory_test_rx(data, length);
break; break;
#endif #endif
default:
return false;
} }
return true;
} }
#if !defined(VIA_ENABLE) #if !defined(VIA_ENABLE)

View File

@ -159,7 +159,7 @@ void keyboard_post_init_kb(void) {
power_on_indicator_timer_buffer = sync_timer_read32() | 1; power_on_indicator_timer_buffer = sync_timer_read32() | 1;
writePin(BAT_LOW_LED_PIN, BAT_LOW_LED_PIN_ON_STATE); writePin(BAT_LOW_LED_PIN, BAT_LOW_LED_PIN_ON_STATE);
writePin(LED_CAPS_LOCK_PIN, LED_PIN_ON_STATE); writePin(LED_CAPS_LOCK_PIN, LED_PIN_ON_STATE);
#ifdef KC_BLUETOOTH_ENABLE # ifdef KC_BLUETOOTH_ENABLE
writePin(H3, HOST_LED_PIN_ON_STATE); writePin(H3, HOST_LED_PIN_ON_STATE);
# endif # endif
@ -280,7 +280,7 @@ void battery_calculte_voltage(uint16_t value) {
battery_set_voltage(voltage); battery_set_voltage(voltage);
} }
void via_command_kb(uint8_t *data, uint8_t length) { bool via_command_kb(uint8_t *data, uint8_t length) {
switch (data[0]) { switch (data[0]) {
#ifdef KC_BLUETOOTH_ENABLE #ifdef KC_BLUETOOTH_ENABLE
case 0xAA: case 0xAA:
@ -292,7 +292,11 @@ void via_command_kb(uint8_t *data, uint8_t length) {
factory_test_rx(data, length); factory_test_rx(data, length);
break; break;
#endif #endif
default:
return false;
} }
return true;
} }
#if !defined(VIA_ENABLE) #if !defined(VIA_ENABLE)