/* Copyright 2017 Zach White * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #include "2021.h" #include "max7219.h" #include "font.h" #ifndef DRAWING_TOY_MODE static uint16_t led_frame_timer = 0; void matrix_scan_kb(void) { if (timer_elapsed(led_frame_timer) > 100) { max7219_message_sign_task(true); led_frame_timer = timer_read(); } } #endif void matrix_init_kb(void) { max7219_init(); #if defined(MAX7219_LED_TEST) while(1) { for (int i=0; i 0) { // turned left led_position[0]--; } else { led_position[0]=NUM_COLUMNS-1; } } // Encoder 2, right else if (index == 1 && clockwise) { if (led_position[1] < 7) { // turned right led_position[1]++; } else { led_position[1]=0; } } else if (index == 1) { if (led_position[1] > 0) { // turned left led_position[1]--; } else { led_position[1]=7; } } max7219_set_led(led_position[1], led_position[0], true); #else // Encoder 1, left if (index == 0 && clockwise) { tap_code(KC_MS_R); // turned right } else if (index == 0) { tap_code(KC_MS_L); // turned left } // Encoder 2, right else if (index == 1 && clockwise) { tap_code(KC_MS_U); // turned right } else if (index == 1) { tap_code(KC_MS_D); // turned left } #endif } return true; }