summaryrefslogtreecommitdiffstats
path: root/keyboards
diff options
context:
space:
mode:
Diffstat (limited to 'keyboards')
-rw-r--r--keyboards/keychron/bluetooth/battery.c47
-rw-r--r--keyboards/keychron/bluetooth/battery.h9
-rw-r--r--keyboards/keychron/bluetooth/bluetooth.c61
-rw-r--r--keyboards/keychron/bluetooth/bluetooth.mk4
-rw-r--r--keyboards/keychron/bluetooth/ckbt51.c46
-rw-r--r--keyboards/keychron/bluetooth/ckbt51.h3
-rw-r--r--keyboards/keychron/bluetooth/factory_test.c20
-rw-r--r--keyboards/keychron/bluetooth/indicator.c130
-rw-r--r--keyboards/keychron/bluetooth/indicator.h32
-rw-r--r--keyboards/keychron/bluetooth/lpm.c2
-rw-r--r--keyboards/keychron/bluetooth/lpm_stm32l432.c99
-rw-r--r--keyboards/keychron/bluetooth/rtc_timer.c43
-rw-r--r--keyboards/keychron/bluetooth/rtc_timer.h43
-rw-r--r--keyboards/keychron/bluetooth/transport.c30
-rw-r--r--keyboards/keychron/bluetooth/transport.h7
-rw-r--r--keyboards/keychron/k2_pro/ansi/rgb/config.h1
-rw-r--r--keyboards/keychron/k2_pro/ansi/white/config.h1
-rw-r--r--keyboards/keychron/k2_pro/halconf.h1
-rw-r--r--keyboards/keychron/k2_pro/iso/rgb/config.h1
-rw-r--r--keyboards/keychron/k2_pro/iso/white/config.h1
-rw-r--r--keyboards/keychron/k2_pro/k2_pro.c15
-rw-r--r--keyboards/keychron/k2_pro/rules.mk2
-rw-r--r--keyboards/keychron/k2_pro/via_json/k2_pro_ansi_rgb.json203
-rw-r--r--keyboards/keychron/k2_pro/via_json/k2_pro_ansi_white.json202
-rw-r--r--keyboards/keychron/k2_pro/via_json/k2_pro_iso_rgb.json209
-rw-r--r--keyboards/keychron/k2_pro/via_json/k2_pro_iso_white.json208
-rw-r--r--keyboards/keychron/k3_pro/ansi/rgb/config.h106
-rw-r--r--keyboards/keychron/k3_pro/ansi/rgb/info.json106
-rw-r--r--keyboards/keychron/k3_pro/ansi/rgb/keymaps/default/keymap.c59
-rw-r--r--keyboards/keychron/k3_pro/ansi/rgb/keymaps/via/keymap.c59
-rw-r--r--keyboards/keychron/k3_pro/ansi/rgb/keymaps/via/rules.mk1
-rw-r--r--keyboards/keychron/k3_pro/ansi/rgb/rgb.c147
-rw-r--r--keyboards/keychron/k3_pro/ansi/rgb/rules.mk2
-rw-r--r--keyboards/keychron/k3_pro/ansi/white/config.h76
-rw-r--r--keyboards/keychron/k3_pro/ansi/white/info.json107
-rw-r--r--keyboards/keychron/k3_pro/ansi/white/keymaps/default/keymap.c59
-rw-r--r--keyboards/keychron/k3_pro/ansi/white/keymaps/via/keymap.c59
-rw-r--r--keyboards/keychron/k3_pro/ansi/white/keymaps/via/rules.mk1
-rw-r--r--keyboards/keychron/k3_pro/ansi/white/rules.mk2
-rw-r--r--keyboards/keychron/k3_pro/ansi/white/white.c144
-rw-r--r--keyboards/keychron/k3_pro/config.h104
-rw-r--r--keyboards/keychron/k3_pro/halconf.h28
-rw-r--r--keyboards/keychron/k3_pro/iso/rgb/config.h106
-rw-r--r--keyboards/keychron/k3_pro/iso/rgb/info.json107
-rw-r--r--keyboards/keychron/k3_pro/iso/rgb/keymaps/default/keymap.c59
-rw-r--r--keyboards/keychron/k3_pro/iso/rgb/keymaps/via/keymap.c59
-rw-r--r--keyboards/keychron/k3_pro/iso/rgb/keymaps/via/rules.mk1
-rw-r--r--keyboards/keychron/k3_pro/iso/rgb/rgb.c148
-rw-r--r--keyboards/keychron/k3_pro/iso/rgb/rules.mk2
-rw-r--r--keyboards/keychron/k3_pro/iso/white/config.h76
-rw-r--r--keyboards/keychron/k3_pro/iso/white/info.json107
-rw-r--r--keyboards/keychron/k3_pro/iso/white/keymaps/default/keymap.c59
-rw-r--r--keyboards/keychron/k3_pro/iso/white/keymaps/via/keymap.c59
-rw-r--r--keyboards/keychron/k3_pro/iso/white/keymaps/via/rules.mk1
-rw-r--r--keyboards/keychron/k3_pro/iso/white/rules.mk2
-rw-r--r--keyboards/keychron/k3_pro/iso/white/white.c145
-rw-r--r--keyboards/keychron/k3_pro/k3_pro.c293
-rw-r--r--keyboards/keychron/k3_pro/k3_pro.h84
-rw-r--r--keyboards/keychron/k3_pro/matrix.c197
-rw-r--r--keyboards/keychron/k3_pro/mcuconf.h39
-rw-r--r--keyboards/keychron/k3_pro/readme.md21
-rw-r--r--keyboards/keychron/k3_pro/rules.mk32
-rw-r--r--keyboards/keychron/k3_pro/via_json/k3_pro_ansi_rgb.json203
-rw-r--r--keyboards/keychron/k3_pro/via_json/k3_pro_ansi_white.json202
-rw-r--r--keyboards/keychron/k3_pro/via_json/k3_pro_iso_rgb .json209
-rw-r--r--keyboards/keychron/k3_pro/via_json/k3_pro_iso_white.json207
-rw-r--r--keyboards/keychron/k4_pro/ansi/rgb/config.h106
-rw-r--r--keyboards/keychron/k4_pro/ansi/rgb/info.json122
-rw-r--r--keyboards/keychron/k4_pro/ansi/rgb/keymaps/default/keymap.c56
-rw-r--r--keyboards/keychron/k4_pro/ansi/rgb/keymaps/via/keymap.c56
-rw-r--r--keyboards/keychron/k4_pro/ansi/rgb/keymaps/via/rules.mk1
-rw-r--r--keyboards/keychron/k4_pro/ansi/rgb/rgb.c163
-rw-r--r--keyboards/keychron/k4_pro/ansi/rgb/rules.mk2
-rw-r--r--keyboards/keychron/k4_pro/ansi/white/config.h76
-rw-r--r--keyboards/keychron/k4_pro/ansi/white/info.json122
-rw-r--r--keyboards/keychron/k4_pro/ansi/white/keymaps/default/keymap.c56
-rw-r--r--keyboards/keychron/k4_pro/ansi/white/keymaps/via/keymap.c56
-rw-r--r--keyboards/keychron/k4_pro/ansi/white/keymaps/via/rules.mk1
-rw-r--r--keyboards/keychron/k4_pro/ansi/white/rules.mk2
-rw-r--r--keyboards/keychron/k4_pro/ansi/white/white.c161
-rw-r--r--keyboards/keychron/k4_pro/config.h93
-rw-r--r--keyboards/keychron/k4_pro/halconf.h27
-rw-r--r--keyboards/keychron/k4_pro/k4_pro.c288
-rw-r--r--keyboards/keychron/k4_pro/k4_pro.h67
-rw-r--r--keyboards/keychron/k4_pro/matrix.c170
-rw-r--r--keyboards/keychron/k4_pro/mcuconf.h36
-rw-r--r--keyboards/keychron/k4_pro/readme.md21
-rw-r--r--keyboards/keychron/k4_pro/rules.mk32
-rw-r--r--keyboards/keychron/k4_pro/via_json/k4_pro_ansi_rgb.json247
-rw-r--r--keyboards/keychron/k4_pro/via_json/k4_pro_ansi_white.json246
-rw-r--r--keyboards/keychron/k6_pro/ansi/rgb/config.h1
-rw-r--r--keyboards/keychron/k6_pro/ansi/white/config.h3
-rw-r--r--keyboards/keychron/k6_pro/halconf.h1
-rw-r--r--keyboards/keychron/k6_pro/iso/rgb/config.h1
-rw-r--r--keyboards/keychron/k6_pro/iso/white/config.h7
-rw-r--r--keyboards/keychron/k6_pro/k6_pro.c15
-rw-r--r--keyboards/keychron/k6_pro/readme.md2
-rw-r--r--keyboards/keychron/k6_pro/via_json/k6_pro_ansi_rgb.json182
-rw-r--r--keyboards/keychron/k6_pro/via_json/k6_pro_ansi_white.json181
-rw-r--r--keyboards/keychron/k6_pro/via_json/k6_pro_iso_rgb.json183
-rw-r--r--keyboards/keychron/k6_pro/via_json/k6_pro_iso_white.json182
-rw-r--r--keyboards/keychron/k6_pro/via_json/k6_pro_jis_rgb.json188
-rw-r--r--keyboards/keychron/k8_pro/ansi/white/config.h3
-rw-r--r--keyboards/keychron/k8_pro/halconf.h1
-rw-r--r--keyboards/keychron/k8_pro/iso/white/config.h2
-rw-r--r--keyboards/keychron/k8_pro/k8_pro.c15
-rw-r--r--keyboards/keychron/k8_pro/via_json/k8_pro_ansi_rgb.json229
-rw-r--r--keyboards/keychron/k8_pro/via_json/k8_pro_ansi_white.json228
-rw-r--r--keyboards/keychron/k8_pro/via_json/k8_pro_iso_rgb.json232
-rw-r--r--keyboards/keychron/k8_pro/via_json/k8_pro_iso_white.json231
-rw-r--r--keyboards/keychron/k8_pro/via_json/k8_pro_jis_rgb.json228
-rw-r--r--keyboards/keychron/k8_pro/via_json/k8_pro_jis_white.json227
112 files changed, 9260 insertions, 187 deletions
diff --git a/keyboards/keychron/bluetooth/battery.c b/keyboards/keychron/bluetooth/battery.c
index 6dd453357e..bc463f9336 100644
--- a/keyboards/keychron/bluetooth/battery.c
+++ b/keyboards/keychron/bluetooth/battery.c
@@ -20,6 +20,8 @@
#include "transport.h"
#include "ckbt51.h"
#include "lpm.h"
+#include "indicator.h"
+#include "rtc_timer.h"
#define BATTERY_EMPTY_COUNT 10
#define CRITICAL_LOW_COUNT 20
@@ -29,12 +31,14 @@ static uint16_t voltage = FULL_VOLTAGE_VALUE;
static uint8_t bat_empty = 0;
static uint8_t critical_low = 0;
static uint8_t bat_state;
+static uint8_t power_on_sample = 0;
void battery_init(void) {
- bat_monitor_timer_buffer = 0;
bat_state = BAT_NOT_CHARGING;
}
-__attribute__((weak)) void battery_measure(void) {}
+__attribute__((weak)) void battery_measure(void) {
+ ckbt51_read_state_reg(0x05, 0x02);
+}
/* Calculate the voltage */
__attribute__((weak)) void battery_calculate_voltage(uint16_t value) {}
@@ -71,10 +75,16 @@ bool battery_is_critical_low(void) {
void battery_check_empty(void) {
if (voltage < EMPTY_VOLTAGE_VALUE) {
if (bat_empty <= BATTERY_EMPTY_COUNT) {
- if (++bat_empty > BATTERY_EMPTY_COUNT) indicator_battery_low_enable(true);
+ if (++bat_empty > BATTERY_EMPTY_COUNT) {
+#ifdef BAT_LOW_LED_PIN
+ indicator_battery_low_enable(true);
+#endif
+#if defined(LOW_BAT_IND_INDEX)
+ indicator_battery_low_backlit_enable(true);
+#endif