Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add forgotten Caps Lock Indicator for Keychron C3 Pro #24887

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions keyboards/keychron/c3_pro/c3_pro.c
Original file line number Diff line number Diff line change
Expand Up @@ -110,3 +110,29 @@ bool led_matrix_indicators_advanced_kb(uint8_t led_min, uint8_t led_max) {
}

#endif // LED_MATRIX_ENABLE && CAPS_LOCK_LED_INDEX

void keyboard_post_init_kb(void) {
setPinOutputPushPull(LED_MAC_OS_PIN);
setPinOutputPushPull(LED_WIN_OS_PIN);
writePin(LED_MAC_OS_PIN, !LED_OS_PIN_ON_STATE);
writePin(LED_WIN_OS_PIN, !LED_OS_PIN_ON_STATE);
keyboard_post_init_user();
adophoxia marked this conversation as resolved.
Show resolved Hide resolved
}

void housekeeping_task_kb(void) {
if (default_layer_state == (1U << 0)) {
zvecr marked this conversation as resolved.
Show resolved Hide resolved
writePin(LED_MAC_OS_PIN, LED_OS_PIN_ON_STATE);
writePin(LED_WIN_OS_PIN, !LED_OS_PIN_ON_STATE);
}
if (default_layer_state == (1U << 2)) {
zvecr marked this conversation as resolved.
Show resolved Hide resolved
writePin(LED_MAC_OS_PIN, !LED_OS_PIN_ON_STATE);
writePin(LED_WIN_OS_PIN, LED_OS_PIN_ON_STATE);
}
adophoxia marked this conversation as resolved.
Show resolved Hide resolved
housekeeping_task_user();
adophoxia marked this conversation as resolved.
Show resolved Hide resolved
}
...
void suspend_power_down_kb(void) {
writePin(LED_WIN_OS_PIN, !LED_OS_PIN_ON_STATE);
writePin(LED_MAC_OS_PIN, !LED_OS_PIN_ON_STATE);
suspend_power_down_user();
}
adophoxia marked this conversation as resolved.
Show resolved Hide resolved
2 changes: 2 additions & 0 deletions keyboards/keychron/c3_pro/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,5 @@
#define I2C1_CLOCK_SPEED 400000
#define I2C1_DUTY_CYCLE FAST_DUTY_CYCLE_2

/* Caps Lock Indicator*/
#define CAPS_LOCK_LED_INDEX 50