aboutsummaryrefslogtreecommitdiff
path: root/keyboards/handwired/evk/v1_3/v1_3.c
diff options
context:
space:
mode:
Diffstat (limited to 'keyboards/handwired/evk/v1_3/v1_3.c')
-rw-r--r--keyboards/handwired/evk/v1_3/v1_3.c58
1 files changed, 58 insertions, 0 deletions
diff --git a/keyboards/handwired/evk/v1_3/v1_3.c b/keyboards/handwired/evk/v1_3/v1_3.c
new file mode 100644
index 000000000..62800bc88
--- /dev/null
+++ b/keyboards/handwired/evk/v1_3/v1_3.c
@@ -0,0 +1,58 @@
1/*
2This program is free software: you can redistribute it and/or modify
3it under the terms of the GNU General Public License as published by
4the Free Software Foundation, either version 2 of the License, or
5(at your option) any later version.
6
7This program is distributed in the hope that it will be useful,
8but WITHOUT ANY WARRANTY; without even the implied warranty of
9MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10GNU General Public License for more details.
11
12You should have received a copy of the GNU General Public License
13along with this program. If not, see <http://www.gnu.org/licenses/>.
14 */
15#include "v1_3.h"
16
17// Optional override functions below.
18// You can leave any or all of these undefined.
19// These are only required if you want to perform custom actions.
20// For reference, visit https://docs.qmk.fm/#/custom_quantum_functions?id=layer-change-code
21
22// keyboard start-up codes
23// runs once when the firmware starts up
24void matrix_init_kb(void) {
25 // Set the LEDs pins
26 setPinOutput(D5); // Layer 1 Status LED
27
28 matrix_init_user();
29}
30
31// looping keyboard codes
32// runs every cycle (a lot)
33/*void matrix_scan_kb(void) {
34
35 matrix_scan_user();
36}*/
37
38// per-action keyboard codes
39// runs for every key-press action, just before processing by the firmware
40/*bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
41
42 return process_record_user(keycode, record);
43}*/
44
45// Set LED based on layer
46__attribute__((weak)) layer_state_t layer_state_set_user(layer_state_t state) {
47 writePin(D5, layer_state_cmp(state, 1));
48 return state;
49}
50
51bool led_update_kb(led_t led_state) {
52 bool res = led_update_user(led_state);
53 if (res) {
54 // writePin sets the pin high for 1 and low for 0.
55 writePin(D4, led_state.caps_lock);
56 }
57 return res;
58}