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

Cleanup and refactoring of Cipulot keyboards folder #21577

Closed
wants to merge 7 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
8 changes: 4 additions & 4 deletions keyboards/cipulot/ec_23u/ec_switch_matrix.c
Original file line number Diff line number Diff line change
Expand Up @@ -118,17 +118,17 @@ uint16_t ecsm_readkey_raw(uint8_t channel, uint8_t row, uint8_t col) {
}

// Update press/release state of key
bool ecsm_update_key(matrix_row_t* current_row, uint8_t row, uint8_t col, uint16_t sw_value) {
bool ecsm_update_key(matrix_row_t* current_row, uint8_t col, uint16_t sw_value) {
bool current_state = (*current_row >> col) & 1;

// Press to release
if (current_state && sw_value < config.ecsm_actuation_threshold) {
if (current_state && sw_value < config.ecsm_release_threshold) {
*current_row &= ~(1 << col);
return true;
}

// Release to press
if ((!current_state) && sw_value > config.ecsm_release_threshold) {
if ((!current_state) && sw_value > config.ecsm_actuation_threshold) {
*current_row |= (1 << col);
return true;
}
Expand All @@ -143,7 +143,7 @@ bool ecsm_matrix_scan(matrix_row_t current_matrix[]) {
for (int col = 0; col < sizeof(col_channels); col++) {
for (int row = 0; row < MATRIX_ROWS; row++) {
ecsm_sw_value[row][col] = ecsm_readkey_raw(0, row, col);
updated |= ecsm_update_key(&current_matrix[row], row, col, ecsm_sw_value[row][col]);
updated |= ecsm_update_key(&current_matrix[row], col, ecsm_sw_value[row][col]);
}
}

Expand Down
2 changes: 1 addition & 1 deletion keyboards/cipulot/ec_23u/ec_switch_matrix.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@ int ecsm_init(ecsm_config_t const* const ecsm_config);
int ecsm_update(ecsm_config_t const* const ecsm_config);
bool ecsm_matrix_scan(matrix_row_t current_matrix[]);
uint16_t ecsm_readkey_raw(uint8_t channel, uint8_t row, uint8_t col);
bool ecsm_update_key(matrix_row_t* current_row, uint8_t row, uint8_t col, uint16_t sw_value);
bool ecsm_update_key(matrix_row_t* current_row, uint8_t col, uint16_t sw_value);
void ecsm_print_matrix(void);
6 changes: 0 additions & 6 deletions keyboards/cipulot/ec_23u/info.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,13 @@
},
"diode_direction": "COL2ROW",
"features": {
"audio": false,
"backlight": false,
"bootmagic": true,
"command": false,
"console": true,
"extrakey": true,
"mousekey": true,
"nkro": true,
"rgblight": true
},
"mouse_key": {
"enabled": true
},
"indicators": {
"num_lock": "B14"
},
Expand Down
19 changes: 1 addition & 18 deletions keyboards/cipulot/ec_23u/keymaps/default/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,23 +32,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
_______, _______, _______, _______,
_______, _______, _______, _______,
_______, _______, _______, _______,
_______, _______, QK_BOOT, _______),


[2] = LAYOUT_all(
_______, _______, _______, _______,
_______, _______, _______, _______,
_______, _______, _______, _______,
_______, _______, _______, _______,
_______, _______, _______, _______,
_______, _______, _______, _______),

[3] = LAYOUT_all(
_______, _______, _______, _______,
_______, _______, _______, _______,
_______, _______, _______, _______,
_______, _______, _______, _______,
_______, _______, _______, _______,
_______, _______, _______, _______)
_______, _______, QK_BOOT, _______)
// clang-format on
};
19 changes: 1 addition & 18 deletions keyboards/cipulot/ec_23u/keymaps/numpad_6x4/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,23 +32,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
_______, _______, _______, _______,
_______, _______, _______, _______,
_______, _______, _______, _______,
_______, QK_BOOT),


[2] = LAYOUT_numpad_6x4(
_______, _______, _______, _______,
_______, _______, _______,
_______, _______, _______, _______,
_______, _______, _______, _______,
_______, _______, _______, _______,
_______, _______),

[3] = LAYOUT_numpad_6x4(
_______, _______, _______, _______,
_______, _______, _______,
_______, _______, _______, _______,
_______, _______, _______, _______,
_______, _______, _______, _______,
_______, _______)
_______, QK_BOOT)
// clang-format on
};
19 changes: 1 addition & 18 deletions keyboards/cipulot/ec_23u/keymaps/via/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,23 +32,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
_______, _______, _______, _______,
_______, _______, _______, _______,
_______, _______, _______, _______,
_______, _______, QK_BOOT, _______),


[2] = LAYOUT_all(
_______, _______, _______, _______,
_______, _______, _______, _______,
_______, _______, _______, _______,
_______, _______, _______, _______,
_______, _______, _______, _______,
_______, _______, _______, _______),

[3] = LAYOUT_all(
_______, _______, _______, _______,
_______, _______, _______, _______,
_______, _______, _______, _______,
_______, _______, _______, _______,
_______, _______, _______, _______,
_______, _______, _______, _______)
_______, _______, QK_BOOT, _______)
// clang-format on
};
2 changes: 1 addition & 1 deletion keyboards/cipulot/ec_23u/keymaps/via/rules.mk
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
VIA_ENABLE = yes

SRC += via_apc.c
SRC += keyboards/cipulot/common/via_apc.c
156 changes: 0 additions & 156 deletions keyboards/cipulot/ec_23u/keymaps/via/via_apc.c

This file was deleted.

3 changes: 2 additions & 1 deletion keyboards/cipulot/ec_23u/rules.mk
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
CUSTOM_MATRIX = lite
QUANTUM_LIB_SRC += analog.c
QUANTUM_LIB_SRC += analog.c
SRC += matrix.c ec_switch_matrix.c
OPT = 2
10 changes: 5 additions & 5 deletions keyboards/cipulot/ec_60/ec_switch_matrix.c
Original file line number Diff line number Diff line change
Expand Up @@ -126,17 +126,17 @@ uint16_t ecsm_readkey_raw(uint8_t channel, uint8_t row, uint8_t col) {
}

// Update press/release state of key
bool ecsm_update_key(matrix_row_t* current_row, uint8_t row, uint8_t col, uint16_t sw_value) {
bool ecsm_update_key(matrix_row_t* current_row, uint8_t col, uint16_t sw_value) {
bool current_state = (*current_row >> col) & 1;

// Press to release
if (current_state && sw_value < config.ecsm_actuation_threshold) {
if (current_state && sw_value < config.ecsm_release_threshold) {
*current_row &= ~(1 << col);
return true;
}

// Release to press
if ((!current_state) && sw_value > config.ecsm_release_threshold) {
if ((!current_state) && sw_value > config.ecsm_actuation_threshold) {
*current_row |= (1 << col);
return true;
}
Expand All @@ -153,7 +153,7 @@ bool ecsm_matrix_scan(matrix_row_t current_matrix[]) {
for (int col = 0; col < sizeof(col_channels); col++) {
for (int row = 0; row < MATRIX_ROWS; row++) {
ecsm_sw_value[row][col] = ecsm_readkey_raw(0, row, col);
updated |= ecsm_update_key(&current_matrix[row], row, col, ecsm_sw_value[row][col]);
updated |= ecsm_update_key(&current_matrix[row], col, ecsm_sw_value[row][col]);
}
}

Expand All @@ -162,7 +162,7 @@ bool ecsm_matrix_scan(matrix_row_t current_matrix[]) {
for (int col = 0; col < (sizeof(col_channels) - 1); col++) {
for (int row = 0; row < MATRIX_ROWS; row++) {
ecsm_sw_value[row][col + 8] = ecsm_readkey_raw(1, row, col);
updated |= ecsm_update_key(&current_matrix[row], row, col + 8, ecsm_sw_value[row][col + 8]);
updated |= ecsm_update_key(&current_matrix[row], col + 8, ecsm_sw_value[row][col + 8]);
}
}
return updated;
Expand Down
2 changes: 1 addition & 1 deletion keyboards/cipulot/ec_60/ec_switch_matrix.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@ int ecsm_init(ecsm_config_t const* const ecsm_config);
int ecsm_update(ecsm_config_t const* const ecsm_config);
bool ecsm_matrix_scan(matrix_row_t current_matrix[]);
uint16_t ecsm_readkey_raw(uint8_t channel, uint8_t row, uint8_t col);
bool ecsm_update_key(matrix_row_t* current_row, uint8_t row, uint8_t col, uint16_t sw_value);
bool ecsm_update_key(matrix_row_t* current_row, uint8_t col, uint16_t sw_value);
void ecsm_print_matrix(void);
10 changes: 2 additions & 8 deletions keyboards/cipulot/ec_60/info.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,13 @@
},
"diode_direction": "COL2ROW",
"features": {
"audio": false,
"backlight": false,
"bootmagic": true,
"command": false,
"console": true,
"extrakey": true,
"mousekey": true,
"nkro": true,
"rgblight": false
},
"mouse_key": {
"enabled": true
"nkro": true
},

"processor": "STM32F401",
"url": "https://www.github.com/Cipulot/EC60",
"usb": {
Expand Down
9 changes: 2 additions & 7 deletions keyboards/cipulot/ec_60/keymaps/60_ansi_tsangan/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#include QMK_KEYBOARD_H

const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
// clang-format off
[0] = LAYOUT_60_ansi_tsangan(
KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC,
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS,
Expand All @@ -37,11 +38,5 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______),

[3] = LAYOUT_60_ansi_tsangan(
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______)
// clang-format on
};
Loading