diff options
Diffstat (limited to 'keyboards/mechlovin/infinity87/rev2/rev2.c')
| -rw-r--r-- | keyboards/mechlovin/infinity87/rev2/rev2.c | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/keyboards/mechlovin/infinity87/rev2/rev2.c b/keyboards/mechlovin/infinity87/rev2/rev2.c new file mode 100644 index 000000000..5a92f8bec --- /dev/null +++ b/keyboards/mechlovin/infinity87/rev2/rev2.c | |||
| @@ -0,0 +1,57 @@ | |||
| 1 | /* Copyright 2020 Team Mechlovin' | ||
| 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 "rev2.h" | ||
| 18 | |||
| 19 | void matrix_init_kb(void) { | ||
| 20 | matrix_init_user(); | ||
| 21 | led_init_ports(); | ||
| 22 | }; | ||
| 23 | void led_init_ports(void) { | ||
| 24 | setPinOutput(A5); | ||
| 25 | setPinOutput(A6); | ||
| 26 | setPinOutput(A7); | ||
| 27 | setPinOutput(C7); | ||
| 28 | setPinOutput(C6); | ||
| 29 | |||
| 30 | } | ||
| 31 | |||
| 32 | layer_state_t layer_state_set_kb(layer_state_t state) { | ||
| 33 | state = layer_state_set_user(state); | ||
| 34 | writePinHigh(C6); | ||
| 35 | writePinHigh(C7); | ||
| 36 | writePinHigh(A7); | ||
| 37 | writePinHigh(A6); | ||
| 38 | writePinHigh(A5); | ||
| 39 | switch (get_highest_layer(state)) { | ||
| 40 | case 0: | ||
| 41 | writePinLow(C6); | ||
| 42 | break; | ||
| 43 | case 1: | ||
| 44 | writePinLow(C7); | ||
| 45 | break; | ||
| 46 | case 2: | ||
| 47 | writePinLow(A7); | ||
| 48 | break; | ||
| 49 | case 3: | ||
| 50 | writePinLow(A6); | ||
| 51 | break; | ||
| 52 | case 4: | ||
| 53 | writePinLow(A5); | ||
| 54 | break; | ||
| 55 | } | ||
| 56 | return state; | ||
| 57 | } | ||
