This commit is contained in:
lalalademaxiya1 2023-10-23 12:19:29 +08:00
parent 30f9bc5e5a
commit 247ec82b49
9 changed files with 20 additions and 26 deletions

View File

@ -111,3 +111,7 @@ __attribute__((weak)) void keyboard_post_init_kb(void) {
}
}
#endif
void restart_usb_driver(USBDriver *usbp) {
// Do nothing. Restarting the USB driver on these boards breaks it.
}

View File

@ -64,11 +64,6 @@ bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
if (record->event.pressed) {
win_lock_state = !win_lock_state;
eeconfig_update_user_datablock(&win_lock_state);
if (win_lock_state) {
SET_LED_WIN_LOCK_ON;
} else {
SET_LED_WIN_LOCK_OFF;
}
}
return true;
default:

View File

@ -28,7 +28,7 @@
/* Winlock indicator */
#define LED_WIN_LOCK_PIN A5
#define LED_PIN_ON_STATE 1
#define LED_WIN_LOCK_PIN_ON_STATE 1
/* User used eeprom */
#define EECONFIG_USER_DATA_SIZE 1

View File

@ -18,8 +18,8 @@
static uint8_t win_lock_state = 0;
#define SET_LED_WIN_LOCK_ON writePin(LED_WIN_LOCK_PIN, LED_PIN_ON_STATE)
#define SET_LED_WIN_LOCK_OFF writePin(LED_WIN_LOCK_PIN, !LED_PIN_ON_STATE)
#define SET_LED_WIN_LOCK_ON writePin(LED_WIN_LOCK_PIN, LED_WIN_LOCK_PIN_ON_STATE)
#define SET_LED_WIN_LOCK_OFF writePin(LED_WIN_LOCK_PIN, !LED_WIN_LOCK_PIN_ON_STATE)
static void set_led_win_lock_state(void) {
if (win_lock_state) {
@ -64,11 +64,6 @@ bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
if (record->event.pressed) {
win_lock_state = !win_lock_state;
eeconfig_update_user_datablock(&win_lock_state);
if (win_lock_state) {
writePin(LED_WIN_LOCK_PIN, LED_PIN_ON_STATE);
} else {
writePin(LED_WIN_LOCK_PIN, !LED_PIN_ON_STATE);
}
}
return true;
default:

View File

@ -28,7 +28,7 @@
/* Winlock indicator */
#define LED_WIN_LOCK_PIN A3
#define LED_PIN_ON_STATE 1
#define LED_WIN_LOCK_PIN_ON_STATE 1
/* User used eeprom */
#define EECONFIG_USER_DATA_SIZE 1

View File

@ -18,8 +18,8 @@
static uint8_t win_lock_state = 0;
#define SET_LED_WIN_LOCK_ON writePin(LED_WIN_LOCK_PIN, LED_PIN_ON_STATE)
#define SET_LED_WIN_LOCK_OFF writePin(LED_WIN_LOCK_PIN, !LED_PIN_ON_STATE)
#define SET_LED_WIN_LOCK_ON writePin(LED_WIN_LOCK_PIN, LED_WIN_LOCK_PIN_ON_STATE)
#define SET_LED_WIN_LOCK_OFF writePin(LED_WIN_LOCK_PIN, !LED_WIN_LOCK_PIN_ON_STATE)
static void set_led_win_lock_state(void) {
if (win_lock_state) {
@ -64,11 +64,6 @@ bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
if (record->event.pressed) {
win_lock_state = !win_lock_state;
eeconfig_update_user_datablock(&win_lock_state);
if (win_lock_state) {
writePin(LED_WIN_LOCK_PIN, LED_PIN_ON_STATE);
} else {
writePin(LED_WIN_LOCK_PIN, !LED_PIN_ON_STATE);
}
}
return true;
default:

View File

@ -25,6 +25,8 @@
# define LED_MATRIX_LED_COUNT 81
/* Winlock indicator */
# define LED_CAPS_LOCK_INDEX 44
# define DIM_CAPS_LOCK
# define LED_WIN_LOCK_INDEX 72
/* Scan phase of led driver set as MSKPHASE_6CHANNEL(defined as 0x03 in CKLED2001.h) */
@ -46,4 +48,5 @@
/* Encoder Configuration*/
#ifdef ENCODER_ENABLE
# define ENCODER_DEFAULT_POS 0x3
# define ENCODER_MAP_KEY_DELAY 2
#endif

View File

@ -85,5 +85,12 @@ bool led_matrix_indicators_kb(void) {
led_matrix_set_value(LED_WIN_LOCK_INDEX, 0);
}
}
#if defined(LED_CAPS_LOCK_INDEX)
if (host_keyboard_led_state().caps_lock) {
# if defined(DIM_CAPS_LOCK)
led_matrix_set_value(LED_CAPS_LOCK_INDEX, 0);
# endif
#endif
}
return true;
}

View File

@ -64,11 +64,6 @@ bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
if (record->event.pressed) {
win_lock_state = !win_lock_state;
eeconfig_update_user_datablock(&win_lock_state);
if (win_lock_state) {
writePin(LED_WIN_LOCK_PIN, LED_WIN_LOCK_PIN_ON_STATE);
} else {
writePin(LED_WIN_LOCK_PIN, !LED_WIN_LOCK_PIN_ON_STATE);
}
}
return true;
default: