logo

qmk_firmware

custom branch of QMK firmware git clone https://anongit.hacktivis.me/git/qmk_firmware.git

styrka_topre.c (1404B)


  1. /* Copyright 2023 Viktus Design LLC
  2. *
  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. *
  8. * This program is distributed in the hope that it will be useful,
  9. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. * GNU General Public License for more details.
  12. *
  13. * You should have received a copy of the GNU General Public License
  14. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  15. */
  16. #include "quantum.h"
  17. #include "ec.h"
  18. #include "matrix.h"
  19. //#include "debug.h" // needed for debugging
  20. #define RESET_PT 55
  21. #define ACTUATION_PT 65
  22. // console debugging for pad values
  23. /*void keyboard_post_init_kb() {
  24. debug_enable = true;
  25. debug_matrix = true;
  26. }*/
  27. void matrix_init_custom(void) {
  28. ec_config_t ec_config = {.reset_pt = RESET_PT, .actuation_pt = ACTUATION_PT};
  29. ec_init(&ec_config);
  30. }
  31. bool matrix_scan_custom(matrix_row_t current_matrix[]) {
  32. bool updated = ec_matrix_scan(current_matrix);
  33. // console debugging for pad values
  34. /*static int cnt = 0;
  35. if (cnt++ == 300) {
  36. cnt = 0;
  37. ec_dprint_matrix();
  38. dprintf("\n");
  39. }*/
  40. return updated;
  41. }