You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

121 lines
3.6 KiB

[Keyboard] Add mexsistor/ludmila (#10506) * Add files via upload * Update keyboards/mexsistor/ludmila/config.h Co-authored-by: Drashna Jaelre <drashna@live.com> * Update keyboards/mexsistor/ludmila/ludmila.h Co-authored-by: Drashna Jaelre <drashna@live.com> * Update ludmila.h * Update keymap.c Disable unnecessary code * Update rules.mk * Update matrix.c * Update keyboards/mexsistor/ludmila/rules.mk Co-authored-by: Ryan <fauxpark@gmail.com> * Update keymap.c * Update keyboards/mexsistor/ludmila/readme.md Co-authored-by: Ryan <fauxpark@gmail.com> * Update keymap.c * Update keymap.c * Update ludmila.h * Update keyboards/mexsistor/ludmila/readme.md Co-authored-by: Ryan <fauxpark@gmail.com> * Update keyboards/mexsistor/ludmila/rules.mk Co-authored-by: Ryan <fauxpark@gmail.com> * Update keyboards/mexsistor/ludmila/rules.mk Co-authored-by: Ryan <fauxpark@gmail.com> * Update keyboards/mexsistor/ludmila/rules.mk Co-authored-by: Ryan <fauxpark@gmail.com> * Update keyboards/mexsistor/ludmila/keymaps/default/keymap.c Co-authored-by: Ryan <fauxpark@gmail.com> * Update keyboards/mexsistor/ludmila/readme.md Co-authored-by: Ryan <fauxpark@gmail.com> * Add files via upload * Add files via upload * Delete config.h * Delete * Update readme.md * Update readme.md * Delete tapdance timing * Delete matrix.c * Create matrix.c * Deleted ludmila, add ludmila_v1 * Update readme.md * add ludmila * delete ludmila_v1, create ludmila * Create matrix.c * Change in matrix.c code and sustitute yes/lite custom_matrix in rules.mk * Update keymap.c * Add description; Change on RGB PIN * Revert "Add description; Change on RGB PIN" This reverts commit cfbe5349259446f49e8885e995d9cac1b77dac01. * config.h and rules.mk update * Update keyboards/mexsistor/ludmila/info.json Co-authored-by: James Young <18669334+noroadsleft@users.noreply.github.com> * Update keyboards/mexsistor/ludmila/info.json Co-authored-by: James Young <18669334+noroadsleft@users.noreply.github.com> * Update keyboards/mexsistor/ludmila/rules.mk Co-authored-by: James Young <18669334+noroadsleft@users.noreply.github.com> Co-authored-by: Drashna Jaelre <drashna@live.com> Co-authored-by: Ryan <fauxpark@gmail.com> Co-authored-by: U-MEXSISTOR\Macropads <Kevin M> Co-authored-by: James Young <18669334+noroadsleft@users.noreply.github.com>
3 years ago
[Keyboard] Add mexsistor/ludmila (#10506) * Add files via upload * Update keyboards/mexsistor/ludmila/config.h Co-authored-by: Drashna Jaelre <drashna@live.com> * Update keyboards/mexsistor/ludmila/ludmila.h Co-authored-by: Drashna Jaelre <drashna@live.com> * Update ludmila.h * Update keymap.c Disable unnecessary code * Update rules.mk * Update matrix.c * Update keyboards/mexsistor/ludmila/rules.mk Co-authored-by: Ryan <fauxpark@gmail.com> * Update keymap.c * Update keyboards/mexsistor/ludmila/readme.md Co-authored-by: Ryan <fauxpark@gmail.com> * Update keymap.c * Update keymap.c * Update ludmila.h * Update keyboards/mexsistor/ludmila/readme.md Co-authored-by: Ryan <fauxpark@gmail.com> * Update keyboards/mexsistor/ludmila/rules.mk Co-authored-by: Ryan <fauxpark@gmail.com> * Update keyboards/mexsistor/ludmila/rules.mk Co-authored-by: Ryan <fauxpark@gmail.com> * Update keyboards/mexsistor/ludmila/rules.mk Co-authored-by: Ryan <fauxpark@gmail.com> * Update keyboards/mexsistor/ludmila/keymaps/default/keymap.c Co-authored-by: Ryan <fauxpark@gmail.com> * Update keyboards/mexsistor/ludmila/readme.md Co-authored-by: Ryan <fauxpark@gmail.com> * Add files via upload * Add files via upload * Delete config.h * Delete * Update readme.md * Update readme.md * Delete tapdance timing * Delete matrix.c * Create matrix.c * Deleted ludmila, add ludmila_v1 * Update readme.md * add ludmila * delete ludmila_v1, create ludmila * Create matrix.c * Change in matrix.c code and sustitute yes/lite custom_matrix in rules.mk * Update keymap.c * Add description; Change on RGB PIN * Revert "Add description; Change on RGB PIN" This reverts commit cfbe5349259446f49e8885e995d9cac1b77dac01. * config.h and rules.mk update * Update keyboards/mexsistor/ludmila/info.json Co-authored-by: James Young <18669334+noroadsleft@users.noreply.github.com> * Update keyboards/mexsistor/ludmila/info.json Co-authored-by: James Young <18669334+noroadsleft@users.noreply.github.com> * Update keyboards/mexsistor/ludmila/rules.mk Co-authored-by: James Young <18669334+noroadsleft@users.noreply.github.com> Co-authored-by: Drashna Jaelre <drashna@live.com> Co-authored-by: Ryan <fauxpark@gmail.com> Co-authored-by: U-MEXSISTOR\Macropads <Kevin M> Co-authored-by: James Young <18669334+noroadsleft@users.noreply.github.com>
3 years ago
[Keyboard] Add mexsistor/ludmila (#10506) * Add files via upload * Update keyboards/mexsistor/ludmila/config.h Co-authored-by: Drashna Jaelre <drashna@live.com> * Update keyboards/mexsistor/ludmila/ludmila.h Co-authored-by: Drashna Jaelre <drashna@live.com> * Update ludmila.h * Update keymap.c Disable unnecessary code * Update rules.mk * Update matrix.c * Update keyboards/mexsistor/ludmila/rules.mk Co-authored-by: Ryan <fauxpark@gmail.com> * Update keymap.c * Update keyboards/mexsistor/ludmila/readme.md Co-authored-by: Ryan <fauxpark@gmail.com> * Update keymap.c * Update keymap.c * Update ludmila.h * Update keyboards/mexsistor/ludmila/readme.md Co-authored-by: Ryan <fauxpark@gmail.com> * Update keyboards/mexsistor/ludmila/rules.mk Co-authored-by: Ryan <fauxpark@gmail.com> * Update keyboards/mexsistor/ludmila/rules.mk Co-authored-by: Ryan <fauxpark@gmail.com> * Update keyboards/mexsistor/ludmila/rules.mk Co-authored-by: Ryan <fauxpark@gmail.com> * Update keyboards/mexsistor/ludmila/keymaps/default/keymap.c Co-authored-by: Ryan <fauxpark@gmail.com> * Update keyboards/mexsistor/ludmila/readme.md Co-authored-by: Ryan <fauxpark@gmail.com> * Add files via upload * Add files via upload * Delete config.h * Delete * Update readme.md * Update readme.md * Delete tapdance timing * Delete matrix.c * Create matrix.c * Deleted ludmila, add ludmila_v1 * Update readme.md * add ludmila * delete ludmila_v1, create ludmila * Create matrix.c * Change in matrix.c code and sustitute yes/lite custom_matrix in rules.mk * Update keymap.c * Add description; Change on RGB PIN * Revert "Add description; Change on RGB PIN" This reverts commit cfbe5349259446f49e8885e995d9cac1b77dac01. * config.h and rules.mk update * Update keyboards/mexsistor/ludmila/info.json Co-authored-by: James Young <18669334+noroadsleft@users.noreply.github.com> * Update keyboards/mexsistor/ludmila/info.json Co-authored-by: James Young <18669334+noroadsleft@users.noreply.github.com> * Update keyboards/mexsistor/ludmila/rules.mk Co-authored-by: James Young <18669334+noroadsleft@users.noreply.github.com> Co-authored-by: Drashna Jaelre <drashna@live.com> Co-authored-by: Ryan <fauxpark@gmail.com> Co-authored-by: U-MEXSISTOR\Macropads <Kevin M> Co-authored-by: James Young <18669334+noroadsleft@users.noreply.github.com>
3 years ago
[Keyboard] Add mexsistor/ludmila (#10506) * Add files via upload * Update keyboards/mexsistor/ludmila/config.h Co-authored-by: Drashna Jaelre <drashna@live.com> * Update keyboards/mexsistor/ludmila/ludmila.h Co-authored-by: Drashna Jaelre <drashna@live.com> * Update ludmila.h * Update keymap.c Disable unnecessary code * Update rules.mk * Update matrix.c * Update keyboards/mexsistor/ludmila/rules.mk Co-authored-by: Ryan <fauxpark@gmail.com> * Update keymap.c * Update keyboards/mexsistor/ludmila/readme.md Co-authored-by: Ryan <fauxpark@gmail.com> * Update keymap.c * Update keymap.c * Update ludmila.h * Update keyboards/mexsistor/ludmila/readme.md Co-authored-by: Ryan <fauxpark@gmail.com> * Update keyboards/mexsistor/ludmila/rules.mk Co-authored-by: Ryan <fauxpark@gmail.com> * Update keyboards/mexsistor/ludmila/rules.mk Co-authored-by: Ryan <fauxpark@gmail.com> * Update keyboards/mexsistor/ludmila/rules.mk Co-authored-by: Ryan <fauxpark@gmail.com> * Update keyboards/mexsistor/ludmila/keymaps/default/keymap.c Co-authored-by: Ryan <fauxpark@gmail.com> * Update keyboards/mexsistor/ludmila/readme.md Co-authored-by: Ryan <fauxpark@gmail.com> * Add files via upload * Add files via upload * Delete config.h * Delete * Update readme.md * Update readme.md * Delete tapdance timing * Delete matrix.c * Create matrix.c * Deleted ludmila, add ludmila_v1 * Update readme.md * add ludmila * delete ludmila_v1, create ludmila * Create matrix.c * Change in matrix.c code and sustitute yes/lite custom_matrix in rules.mk * Update keymap.c * Add description; Change on RGB PIN * Revert "Add description; Change on RGB PIN" This reverts commit cfbe5349259446f49e8885e995d9cac1b77dac01. * config.h and rules.mk update * Update keyboards/mexsistor/ludmila/info.json Co-authored-by: James Young <18669334+noroadsleft@users.noreply.github.com> * Update keyboards/mexsistor/ludmila/info.json Co-authored-by: James Young <18669334+noroadsleft@users.noreply.github.com> * Update keyboards/mexsistor/ludmila/rules.mk Co-authored-by: James Young <18669334+noroadsleft@users.noreply.github.com> Co-authored-by: Drashna Jaelre <drashna@live.com> Co-authored-by: Ryan <fauxpark@gmail.com> Co-authored-by: U-MEXSISTOR\Macropads <Kevin M> Co-authored-by: James Young <18669334+noroadsleft@users.noreply.github.com>
3 years ago
[Keyboard] Add mexsistor/ludmila (#10506) * Add files via upload * Update keyboards/mexsistor/ludmila/config.h Co-authored-by: Drashna Jaelre <drashna@live.com> * Update keyboards/mexsistor/ludmila/ludmila.h Co-authored-by: Drashna Jaelre <drashna@live.com> * Update ludmila.h * Update keymap.c Disable unnecessary code * Update rules.mk * Update matrix.c * Update keyboards/mexsistor/ludmila/rules.mk Co-authored-by: Ryan <fauxpark@gmail.com> * Update keymap.c * Update keyboards/mexsistor/ludmila/readme.md Co-authored-by: Ryan <fauxpark@gmail.com> * Update keymap.c * Update keymap.c * Update ludmila.h * Update keyboards/mexsistor/ludmila/readme.md Co-authored-by: Ryan <fauxpark@gmail.com> * Update keyboards/mexsistor/ludmila/rules.mk Co-authored-by: Ryan <fauxpark@gmail.com> * Update keyboards/mexsistor/ludmila/rules.mk Co-authored-by: Ryan <fauxpark@gmail.com> * Update keyboards/mexsistor/ludmila/rules.mk Co-authored-by: Ryan <fauxpark@gmail.com> * Update keyboards/mexsistor/ludmila/keymaps/default/keymap.c Co-authored-by: Ryan <fauxpark@gmail.com> * Update keyboards/mexsistor/ludmila/readme.md Co-authored-by: Ryan <fauxpark@gmail.com> * Add files via upload * Add files via upload * Delete config.h * Delete * Update readme.md * Update readme.md * Delete tapdance timing * Delete matrix.c * Create matrix.c * Deleted ludmila, add ludmila_v1 * Update readme.md * add ludmila * delete ludmila_v1, create ludmila * Create matrix.c * Change in matrix.c code and sustitute yes/lite custom_matrix in rules.mk * Update keymap.c * Add description; Change on RGB PIN * Revert "Add description; Change on RGB PIN" This reverts commit cfbe5349259446f49e8885e995d9cac1b77dac01. * config.h and rules.mk update * Update keyboards/mexsistor/ludmila/info.json Co-authored-by: James Young <18669334+noroadsleft@users.noreply.github.com> * Update keyboards/mexsistor/ludmila/info.json Co-authored-by: James Young <18669334+noroadsleft@users.noreply.github.com> * Update keyboards/mexsistor/ludmila/rules.mk Co-authored-by: James Young <18669334+noroadsleft@users.noreply.github.com> Co-authored-by: Drashna Jaelre <drashna@live.com> Co-authored-by: Ryan <fauxpark@gmail.com> Co-authored-by: U-MEXSISTOR\Macropads <Kevin M> Co-authored-by: James Young <18669334+noroadsleft@users.noreply.github.com>
3 years ago
[Keyboard] Add mexsistor/ludmila (#10506) * Add files via upload * Update keyboards/mexsistor/ludmila/config.h Co-authored-by: Drashna Jaelre <drashna@live.com> * Update keyboards/mexsistor/ludmila/ludmila.h Co-authored-by: Drashna Jaelre <drashna@live.com> * Update ludmila.h * Update keymap.c Disable unnecessary code * Update rules.mk * Update matrix.c * Update keyboards/mexsistor/ludmila/rules.mk Co-authored-by: Ryan <fauxpark@gmail.com> * Update keymap.c * Update keyboards/mexsistor/ludmila/readme.md Co-authored-by: Ryan <fauxpark@gmail.com> * Update keymap.c * Update keymap.c * Update ludmila.h * Update keyboards/mexsistor/ludmila/readme.md Co-authored-by: Ryan <fauxpark@gmail.com> * Update keyboards/mexsistor/ludmila/rules.mk Co-authored-by: Ryan <fauxpark@gmail.com> * Update keyboards/mexsistor/ludmila/rules.mk Co-authored-by: Ryan <fauxpark@gmail.com> * Update keyboards/mexsistor/ludmila/rules.mk Co-authored-by: Ryan <fauxpark@gmail.com> * Update keyboards/mexsistor/ludmila/keymaps/default/keymap.c Co-authored-by: Ryan <fauxpark@gmail.com> * Update keyboards/mexsistor/ludmila/readme.md Co-authored-by: Ryan <fauxpark@gmail.com> * Add files via upload * Add files via upload * Delete config.h * Delete * Update readme.md * Update readme.md * Delete tapdance timing * Delete matrix.c * Create matrix.c * Deleted ludmila, add ludmila_v1 * Update readme.md * add ludmila * delete ludmila_v1, create ludmila * Create matrix.c * Change in matrix.c code and sustitute yes/lite custom_matrix in rules.mk * Update keymap.c * Add description; Change on RGB PIN * Revert "Add description; Change on RGB PIN" This reverts commit cfbe5349259446f49e8885e995d9cac1b77dac01. * config.h and rules.mk update * Update keyboards/mexsistor/ludmila/info.json Co-authored-by: James Young <18669334+noroadsleft@users.noreply.github.com> * Update keyboards/mexsistor/ludmila/info.json Co-authored-by: James Young <18669334+noroadsleft@users.noreply.github.com> * Update keyboards/mexsistor/ludmila/rules.mk Co-authored-by: James Young <18669334+noroadsleft@users.noreply.github.com> Co-authored-by: Drashna Jaelre <drashna@live.com> Co-authored-by: Ryan <fauxpark@gmail.com> Co-authored-by: U-MEXSISTOR\Macropads <Kevin M> Co-authored-by: James Young <18669334+noroadsleft@users.noreply.github.com>
3 years ago
[Keyboard] Add mexsistor/ludmila (#10506) * Add files via upload * Update keyboards/mexsistor/ludmila/config.h Co-authored-by: Drashna Jaelre <drashna@live.com> * Update keyboards/mexsistor/ludmila/ludmila.h Co-authored-by: Drashna Jaelre <drashna@live.com> * Update ludmila.h * Update keymap.c Disable unnecessary code * Update rules.mk * Update matrix.c * Update keyboards/mexsistor/ludmila/rules.mk Co-authored-by: Ryan <fauxpark@gmail.com> * Update keymap.c * Update keyboards/mexsistor/ludmila/readme.md Co-authored-by: Ryan <fauxpark@gmail.com> * Update keymap.c * Update keymap.c * Update ludmila.h * Update keyboards/mexsistor/ludmila/readme.md Co-authored-by: Ryan <fauxpark@gmail.com> * Update keyboards/mexsistor/ludmila/rules.mk Co-authored-by: Ryan <fauxpark@gmail.com> * Update keyboards/mexsistor/ludmila/rules.mk Co-authored-by: Ryan <fauxpark@gmail.com> * Update keyboards/mexsistor/ludmila/rules.mk Co-authored-by: Ryan <fauxpark@gmail.com> * Update keyboards/mexsistor/ludmila/keymaps/default/keymap.c Co-authored-by: Ryan <fauxpark@gmail.com> * Update keyboards/mexsistor/ludmila/readme.md Co-authored-by: Ryan <fauxpark@gmail.com> * Add files via upload * Add files via upload * Delete config.h * Delete * Update readme.md * Update readme.md * Delete tapdance timing * Delete matrix.c * Create matrix.c * Deleted ludmila, add ludmila_v1 * Update readme.md * add ludmila * delete ludmila_v1, create ludmila * Create matrix.c * Change in matrix.c code and sustitute yes/lite custom_matrix in rules.mk * Update keymap.c * Add description; Change on RGB PIN * Revert "Add description; Change on RGB PIN" This reverts commit cfbe5349259446f49e8885e995d9cac1b77dac01. * config.h and rules.mk update * Update keyboards/mexsistor/ludmila/info.json Co-authored-by: James Young <18669334+noroadsleft@users.noreply.github.com> * Update keyboards/mexsistor/ludmila/info.json Co-authored-by: James Young <18669334+noroadsleft@users.noreply.github.com> * Update keyboards/mexsistor/ludmila/rules.mk Co-authored-by: James Young <18669334+noroadsleft@users.noreply.github.com> Co-authored-by: Drashna Jaelre <drashna@live.com> Co-authored-by: Ryan <fauxpark@gmail.com> Co-authored-by: U-MEXSISTOR\Macropads <Kevin M> Co-authored-by: James Young <18669334+noroadsleft@users.noreply.github.com>
3 years ago
  1. /*
  2. Copyright 2012-2018 Jun Wako, Jack Humbert, Yiancar
  3. This program is free software: you can redistribute it and/or modify
  4. it under the terms of the GNU General Public License as published by
  5. the Free Software Foundation, either version 2 of the License, or
  6. (at your option) any later version.
  7. This program is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. GNU General Public License for more details.
  11. You should have received a copy of the GNU General Public License
  12. along with this program. If not, see <http://www.gnu.org/licenses/>.
  13. */
  14. #include <stdint.h>
  15. #include <stdbool.h>
  16. #include "wait.h"
  17. #include "util.h"
  18. #include "matrix.h"
  19. #include "quantum.h"
  20. // Encoder things
  21. #define ENC_SW F7
  22. static bool read_encoder_switches(matrix_row_t current_matrix[], uint8_t current_row);
  23. static const pin_t row_pins[MATRIX_ROWS] = MATRIX_ROW_PINS;
  24. static const pin_t col_pins[MATRIX_COLS] = MATRIX_COL_PINS;
  25. /* matrix state(1:on, 0:off) */
  26. extern matrix_row_t raw_matrix[MATRIX_ROWS]; // raw values
  27. extern matrix_row_t matrix[MATRIX_ROWS]; // debounced values
  28. static void select_row(uint8_t row) {
  29. gpio_set_pin_output(row_pins[row]);
  30. gpio_write_pin_low(row_pins[row]);
  31. }
  32. static void unselect_row(uint8_t row) { gpio_set_pin_input_high(row_pins[row]); }
  33. static void unselect_rows(void) {
  34. for (uint8_t x = 0; x < MATRIX_ROWS; x++) {
  35. gpio_set_pin_input_high(row_pins[x]);
  36. }
  37. }
  38. static void init_pins(void) {
  39. unselect_rows();
  40. for (uint8_t x = 0; x < MATRIX_COLS; x++) {
  41. gpio_set_pin_input_high(col_pins[x]);
  42. }
  43. }
  44. static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row) {
  45. // Store last value of row prior to reading
  46. matrix_row_t last_row_value = current_matrix[current_row];
  47. // Clear data in matrix row
  48. current_matrix[current_row] = 0;
  49. // Select row and wait for row selecton to stabilize
  50. select_row(current_row);
  51. wait_us(30);
  52. // For each col...
  53. for (uint8_t col_index = 0; col_index < MATRIX_COLS; col_index++) {
  54. // Select the col pin to read (active low)
  55. uint8_t pin_state = gpio_read_pin(col_pins[col_index]);
  56. // Populate the matrix row with the state of the col pin
  57. current_matrix[current_row] |= pin_state ? 0 : (MATRIX_ROW_SHIFTER << col_index);
  58. }
  59. // Unselect row
  60. unselect_row(current_row);
  61. return (last_row_value != current_matrix[current_row]);
  62. }
  63. void matrix_init_custom(void) {
  64. // initialize key pins
  65. setPinInput(ENC_SW);
  66. init_pins();
  67. }
  68. bool matrix_scan_custom(void) {
  69. bool changed = false;
  70. // Set row, read cols
  71. for (uint8_t current_row = 0; current_row < MATRIX_ROWS; current_row++) {
  72. changed |= read_cols_on_row(raw_matrix, current_row);
  73. }
  74. // Read encoder switches, already debounced
  75. changed |= read_encoder_switches(matrix, 2);
  76. return changed;
  77. }
  78. static bool read_encoder_switches(matrix_row_t current_matrix[], uint8_t current_row) {
  79. // Store last value of row prior to reading
  80. matrix_row_t last_row_value = current_matrix[current_row];
  81. // Clear data in matrix row
  82. current_matrix[current_row] = 0;
  83. // Debounce the encoder buttons using a shift register
  84. static uint8_t btn_1_array;
  85. bool btn_1_pressed = 0;
  86. btn_1_array <<= 1;
  87. btn_1_array |= gpio_read_pin(ENC_SW);
  88. (btn_1_array == 0b11111111) ? (btn_1_pressed = 1) : (btn_1_pressed = 0);
  89. // Populate the matrix row with the state of the encoder
  90. current_matrix[current_row] |= btn_1_pressed ? (1 << 0) : 0;
  91. return (last_row_value != current_matrix[current_row]);
  92. }