Skip to content

Commit

Permalink
Merge pull request qmk#122 from lalalademaxiya1/playground
Browse files Browse the repository at this point in the history
Playground
  • Loading branch information
KeychronMacro authored Apr 22, 2023
2 parents eedf3aa + 30a36ae commit f9a4104
Show file tree
Hide file tree
Showing 198 changed files with 1,617 additions and 427 deletions.
2 changes: 2 additions & 0 deletions keyboards/keychron/c1/ansi/rgb/rules.mk
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# Build Options
# change yes to no to disable.
#
EEPROM_DRIVER = wear_leveling
WEAR_LEVELING_DRIVER = embedded_flash

Expand Down
2 changes: 2 additions & 0 deletions keyboards/keychron/c1/ansi/white/rules.mk
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# Build Options
# change yes to no to disable.
#
EEPROM_DRIVER = wear_leveling
WEAR_LEVELING_DRIVER = embedded_flash

Expand Down
8 changes: 1 addition & 7 deletions keyboards/keychron/c1/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,8 @@

#pragma once

/* Set 0 if debouncing isn't needed */
#define DEBOUNCE 5

/* DIP switch */
#define DIP_SWITCH_MATRIX_GRID \
{ \
{ 5, 4 } \
}
#define DIP_SWITCH_MATRIX_GRID { { 5, 4 } }
#define SCAN_COUNT_MAX 100

/* Disable DIP switch in matrix data */
Expand Down
2 changes: 2 additions & 0 deletions keyboards/keychron/c2/ansi/rgb/rules.mk
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# Build Options
# change yes to no to disable.
#
EEPROM_DRIVER = wear_leveling
WEAR_LEVELING_DRIVER = embedded_flash

Expand Down
2 changes: 2 additions & 0 deletions keyboards/keychron/c2/ansi/white/rules.mk
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# Build Options
# change yes to no to disable.
#
EEPROM_DRIVER = wear_leveling
WEAR_LEVELING_DRIVER = embedded_flash

Expand Down
8 changes: 1 addition & 7 deletions keyboards/keychron/c2/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,8 @@

#pragma once

/* Set 0 if debouncing isn't needed */
#define DEBOUNCE 5

/* DIP switch */
#define DIP_SWITCH_MATRIX_GRID \
{ \
{ 5, 4 } \
}
#define DIP_SWITCH_MATRIX_GRID { { 5, 4 } }
#define SCAN_COUNT_MAX 100

/* Disable DIP switch in matrix data */
Expand Down
24 changes: 1 addition & 23 deletions keyboards/keychron/common/keychron_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -189,34 +189,12 @@ bool led_update_kb(led_t led_state) {

#endif

#ifdef ENCODER_ENABLE
bool encoder_update_kb(uint8_t index, bool clockwise) {
if (!encoder_update_user(index, clockwise)) {
return false; /* Don't process further events if user function exists and returns false */
}
if (index == 0) { /* First encoder */
if (clockwise) {
tap_code_delay(KC_VOLU, 10);
} else {
tap_code_delay(KC_VOLD, 10);
}
} else if (index == 1) { /* Second encoder */
if (clockwise) {
tap_code_delay(KC_VOLU, 10);
} else {
tap_code_delay(KC_VOLD, 10);
}
}
return true;
}
#endif

#if defined(ENCODER_ENABLE) && defined(PAL_USE_CALLBACKS)
static void encoder_pad_cb(void *param) {
encoder_inerrupt_read((uint32_t)param & 0XFF);
}

void keyboard_post_init_keychron(void) {
__attribute__((weak)) void keyboard_post_init_kb(void) {
pin_t encoders_pad_a[NUM_ENCODERS] = ENCODERS_PAD_A;
pin_t encoders_pad_b[NUM_ENCODERS] = ENCODERS_PAD_B;
for (uint32_t i = 0; i < NUM_ENCODERS; i++) {
Expand Down
5 changes: 5 additions & 0 deletions keyboards/keychron/common/keychron_ft_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@
#include "keychron_ft_common.h"
#include "raw_hid.h"

#ifndef NKRO
# include <string.h>
# define RAW_EPSIZE 32
#endif

#ifndef BL_TEST_KEY1
# define BL_TEST_KEY1 KC_RIGHT
#endif
Expand Down
6 changes: 3 additions & 3 deletions keyboards/keychron/common/matrix.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@

#ifndef SHIFT_COL_START
# define SHIFT_COL_START 8
# ifndef SHIFT_COL_END
# define SHIFT_COL_END 15
# endif
#endif
#ifndef SHIFT_COL_END
# define SHIFT_COL_END 15
#endif

#if defined(SHIFT_COL_START) && defined(SHIFT_COL_END)
Expand Down
3 changes: 0 additions & 3 deletions keyboards/keychron/q0/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@

#pragma once

/* Set 0 if debouncing isn't needed */
#define DEBOUNCE 5

/* Set LED driver current */
#define CKLED2001_CURRENT_TUNE \
{ 0xFF, 0xFF, 0x70, 0xFF, 0xFF, 0x70, 0xFF, 0xFF, 0x70, 0xFF, 0xFF, 0x70 }
Expand Down
12 changes: 0 additions & 12 deletions keyboards/keychron/q0/q0.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,3 @@
*/

#include "quantum.h"
#include "keychron_common.h"

#if defined(ENCODER_ENABLE) && defined(PAL_USE_CALLBACKS)

void keyboard_post_init_kb(void) {
keyboard_post_init_keychron();

// allow user keymaps to do custom post_init
keyboard_post_init_user();
}

#endif
2 changes: 2 additions & 0 deletions keyboards/keychron/q0/rev_0130/rules.mk
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# Build Options
# change yes to no to disable.
#
EEPROM_DRIVER = wear_leveling
WEAR_LEVELING_DRIVER = embedded_flash

Expand Down
2 changes: 1 addition & 1 deletion keyboards/keychron/q0/rev_0131/info.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"diode_direction": "ROW2COL",
"encoder": {
"rotary": [
{"pin_a": "A3", "pin_b": "A8"}
{"pin_a": "A3", "pin_b": "A4"}
]
},
"bootmagic": {
Expand Down
2 changes: 2 additions & 0 deletions keyboards/keychron/q0/rev_0131/rules.mk
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# Build Options
# change yes to no to disable.
#
EEPROM_DRIVER = wear_leveling
WEAR_LEVELING_DRIVER = embedded_flash

Expand Down
5 changes: 1 addition & 4 deletions keyboards/keychron/q1/ansi_atmega32u4/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,7 @@
#pragma once

/* DIP switch */
#define DIP_SWITCH_MATRIX_GRID \
{ \
{ 0, 1 } \
}
#define DIP_SWITCH_MATRIX_GRID { { 0, 1 } }
#define SCAN_COUNT_MAX 100

/* RGB Matrix Driver Configuration */
Expand Down
5 changes: 1 addition & 4 deletions keyboards/keychron/q1/ansi_atmega32u4_encoder/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,7 @@
#pragma once

/* DIP switch */
#define DIP_SWITCH_MATRIX_GRID \
{ \
{ 0, 1 } \
}
#define DIP_SWITCH_MATRIX_GRID { { 0, 1 } }
#define SCAN_COUNT_MAX 100

/* RGB Matrix Driver Configuration */
Expand Down
5 changes: 1 addition & 4 deletions keyboards/keychron/q1/ansi_stm32l432/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,7 @@
#pragma once

/* DIP switch */
#define DIP_SWITCH_MATRIX_GRID \
{ \
{ 5, 4 } \
}
#define DIP_SWITCH_MATRIX_GRID { { 5, 4 } }
#define SCAN_COUNT_MAX 100

/* RGB Matrix Driver Configuration */
Expand Down
2 changes: 2 additions & 0 deletions keyboards/keychron/q1/ansi_stm32l432/rules.mk
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# Build Options
# change yes to no to disable.
#
EEPROM_DRIVER = wear_leveling
WEAR_LEVELING_DRIVER = embedded_flash

Expand Down
5 changes: 1 addition & 4 deletions keyboards/keychron/q1/ansi_stm32l432_encoder/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,7 @@
#pragma once

/* DIP switch */
#define DIP_SWITCH_MATRIX_GRID \
{ \
{ 5, 4 } \
}
#define DIP_SWITCH_MATRIX_GRID { { 5, 4 } }
#define SCAN_COUNT_MAX 100

/* RGB Matrix Driver Configuration */
Expand Down
2 changes: 2 additions & 0 deletions keyboards/keychron/q1/ansi_stm32l432_encoder/rules.mk
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# Build Options
# change yes to no to disable.
#
EEPROM_DRIVER = wear_leveling
WEAR_LEVELING_DRIVER = embedded_flash

Expand Down
3 changes: 0 additions & 3 deletions keyboards/keychron/q1/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@

#pragma once

/* Set 0 if debouncing isn't needed */
#define DEBOUNCE 5

/* Disable DIP switch in matrix data */
#define MATRIX_MASKED

Expand Down
5 changes: 1 addition & 4 deletions keyboards/keychron/q1/iso_atmega32u4/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,7 @@
#pragma once

/* DIP switch */
#define DIP_SWITCH_MATRIX_GRID \
{ \
{ 0, 1 } \
}
#define DIP_SWITCH_MATRIX_GRID { { 0, 1 } }
#define SCAN_COUNT_MAX 100

/* RGB Matrix Driver Configuration */
Expand Down
5 changes: 1 addition & 4 deletions keyboards/keychron/q1/iso_atmega32u4_encoder/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,7 @@
#pragma once

/* DIP switch */
#define DIP_SWITCH_MATRIX_GRID \
{ \
{ 0, 1 } \
}
#define DIP_SWITCH_MATRIX_GRID { { 0, 1 } }
#define SCAN_COUNT_MAX 100

/* RGB Matrix Driver Configuration */
Expand Down
5 changes: 1 addition & 4 deletions keyboards/keychron/q1/iso_stm32l432/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,7 @@
#pragma once

/* DIP switch */
#define DIP_SWITCH_MATRIX_GRID \
{ \
{ 5, 4 } \
}
#define DIP_SWITCH_MATRIX_GRID { { 5, 4 } }
#define SCAN_COUNT_MAX 100

/* RGB Matrix Driver Configuration */
Expand Down
2 changes: 2 additions & 0 deletions keyboards/keychron/q1/iso_stm32l432/rules.mk
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# Build Options
# change yes to no to disable.
#
EEPROM_DRIVER = wear_leveling
WEAR_LEVELING_DRIVER = embedded_flash

Expand Down
5 changes: 1 addition & 4 deletions keyboards/keychron/q1/iso_stm32l432_encoder/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,7 @@
#pragma once

/* DIP switch */
#define DIP_SWITCH_MATRIX_GRID \
{ \
{ 5, 4 } \
}
#define DIP_SWITCH_MATRIX_GRID { { 5, 4 } }
#define SCAN_COUNT_MAX 100

/* RGB Matrix Driver Configuration */
Expand Down
2 changes: 2 additions & 0 deletions keyboards/keychron/q1/iso_stm32l432_encoder/rules.mk
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# Build Options
# change yes to no to disable.
#
EEPROM_DRIVER = wear_leveling
WEAR_LEVELING_DRIVER = embedded_flash

Expand Down
5 changes: 1 addition & 4 deletions keyboards/keychron/q1/jis_stm32l432/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,7 @@
#pragma once

/* DIP switch */
#define DIP_SWITCH_MATRIX_GRID \
{ \
{ 5, 4 } \
}
#define DIP_SWITCH_MATRIX_GRID { { 5, 4 } }
#define SCAN_COUNT_MAX 100

/* RGB Matrix Driver Configuration */
Expand Down
2 changes: 2 additions & 0 deletions keyboards/keychron/q1/jis_stm32l432/rules.mk
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# Build Options
# change yes to no to disable.
#
EEPROM_DRIVER = wear_leveling
WEAR_LEVELING_DRIVER = embedded_flash

Expand Down
5 changes: 1 addition & 4 deletions keyboards/keychron/q1/jis_stm32l432_encoder/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,7 @@
#pragma once

/* DIP switch */
#define DIP_SWITCH_MATRIX_GRID \
{ \
{ 5, 4 } \
}
#define DIP_SWITCH_MATRIX_GRID { { 5, 4 } }
#define SCAN_COUNT_MAX 100

/* RGB Matrix Driver Configuration */
Expand Down
2 changes: 2 additions & 0 deletions keyboards/keychron/q1/jis_stm32l432_encoder/rules.mk
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# Build Options
# change yes to no to disable.
#
EEPROM_DRIVER = wear_leveling
WEAR_LEVELING_DRIVER = embedded_flash

Expand Down
12 changes: 0 additions & 12 deletions keyboards/keychron/q1/q1.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
*/

#include "quantum.h"
#include "keychron_common.h"

#ifdef DIP_SWITCH_ENABLE
bool dip_switch_update_kb(uint8_t index, bool active) {
Expand All @@ -28,14 +27,3 @@ bool dip_switch_update_kb(uint8_t index, bool active) {
return true;
}
#endif

#if defined(ENCODER_ENABLE) && defined(PAL_USE_CALLBACKS)

void keyboard_post_init_kb(void) {
keyboard_post_init_keychron();

// allow user keymaps to do custom post_init
keyboard_post_init_user();
}

#endif
2 changes: 2 additions & 0 deletions keyboards/keychron/q10/ansi_encoder/rules.mk
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# Build Options
# change yes to no to disable.
#
EEPROM_DRIVER = wear_leveling
WEAR_LEVELING_DRIVER = embedded_flash

Expand Down
5 changes: 1 addition & 4 deletions keyboards/keychron/q10/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,7 @@
{ 0x98, 0x98, 0x4A, 0x98, 0x98, 0x4A, 0x98, 0x98, 0x4A, 0x98, 0x98, 0x4A }

/* DIP switch */
#define DIP_SWITCH_MATRIX_GRID \
{ \
{ 5, 5 } \
}
#define DIP_SWITCH_MATRIX_GRID { { 5, 5 } }
#define SCAN_COUNT_MAX 100

/* Disable DIP switch in matrix data */
Expand Down
2 changes: 2 additions & 0 deletions keyboards/keychron/q10/iso_encoder/rules.mk
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# Build Options
# change yes to no to disable.
#
EEPROM_DRIVER = wear_leveling
WEAR_LEVELING_DRIVER = embedded_flash

Expand Down
Loading

0 comments on commit f9a4104

Please sign in to comment.