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 all 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
27 changes: 27 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,30 @@ 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) {
gpio_set_pin_output_push_pull(LED_MAC_OS_PIN);
gpio_set_pin_output_push_pull(LED_WIN_OS_PIN);
gpio_write_pin(LED_MAC_OS_PIN, !LED_OS_PIN_ON_STATE);
gpio_write_pin(LED_WIN_OS_PIN, !LED_OS_PIN_ON_STATE);

keyboard_post_init_user();
}

void housekeeping_task_kb(void) {
if (default_layer_state == (1U << 0)) {
zvecr marked this conversation as resolved.
Show resolved Hide resolved
gpio_write_pin(LED_MAC_OS_PIN, LED_OS_PIN_ON_STATE);
gpio_write_pin(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
gpio_write_pin(LED_MAC_OS_PIN, !LED_OS_PIN_ON_STATE);
gpio_write_pin(LED_WIN_OS_PIN, LED_OS_PIN_ON_STATE);
}
}

void suspend_power_down_kb(void) {
gpio_write_pin(LED_WIN_OS_PIN, !LED_OS_PIN_ON_STATE);
gpio_write_pin(LED_MAC_OS_PIN, !LED_OS_PIN_ON_STATE);

suspend_power_down_user();
}
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