osav2_numpad_topre.c (1401B)
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 17 #include "quantum.h" 18 #include "ec.h" 19 #include "matrix.h" 20 //#include "debug.h" // needed for debugging 21 22 #define RESET_PT 55 23 #define ACTUATION_PT 65 24 25 // console debugging for pad values 26 void keyboard_post_init_kb() { 27 debug_enable = true; 28 debug_matrix = true; 29 } 30 31 void matrix_init_custom(void) { 32 ec_config_t ec_config = {.reset_pt = RESET_PT, .actuation_pt = ACTUATION_PT}; 33 34 ec_init(&ec_config); 35 } 36 37 bool matrix_scan_custom(matrix_row_t current_matrix[]) { 38 bool updated = ec_matrix_scan(current_matrix); 39 40 // console debugging for pad values 41 /*static int cnt = 0; 42 if (cnt++ == 1000) { 43 cnt = 0; 44 ec_dprint_matrix(); 45 dprintf("\n"); 46 }*/ 47 48 return updated; 49 }