diff options
author | Ryan <[email protected]> | 2020-11-02 20:23:54 +1100 |
---|---|---|
committer | GitHub <[email protected]> | 2020-11-02 20:23:54 +1100 |
commit | 8e71d3d053949593d02a3c1852fd1993d2e3f573 (patch) | |
tree | a17bc585db080b0845ef67d8986165cf09cd027e /keyboards/phantom/phantom.c | |
parent | e69da2db2c59a8017f0c9dee9933dd508d22b356 (diff) | |
download | qmk_firmware-8e71d3d053949593d02a3c1852fd1993d2e3f573.tar.gz qmk_firmware-8e71d3d053949593d02a3c1852fd1993d2e3f573.zip |
Phantom refactor (#10805)
Diffstat (limited to 'keyboards/phantom/phantom.c')
-rw-r--r-- | keyboards/phantom/phantom.c | 46 |
1 files changed, 10 insertions, 36 deletions
diff --git a/keyboards/phantom/phantom.c b/keyboards/phantom/phantom.c index 2bf1631b9c..1017de0093 100644 --- a/keyboards/phantom/phantom.c +++ b/keyboards/phantom/phantom.c @@ -13,51 +13,25 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ + #include "phantom.h" -void matrix_init_kb(void) { - // put your keyboard start-up code here - // runs once when the firmware starts up +void keyboard_pre_init_kb(void) { led_init_ports(); - matrix_init_user(); -} - -void matrix_scan_kb(void) { - // put your looping keyboard code here - // runs every cycle (a lot) - - matrix_scan_user(); -} -bool process_record_kb(uint16_t keycode, keyrecord_t *record) { - // put your per-action keyboard code here - // runs for every action, just before processing by the firmware - - return process_record_user(keycode, record); + keyboard_pre_init_user(); } void led_init_ports(void) { - DDRB |= (1<<6) | (1<<7); // OUT + setPinOutput(B6); + setPinOutput(B7); } -void led_set_kb(uint8_t usb_led) { - if (usb_led & (1<<USB_LED_CAPS_LOCK)) - { - PORTB |= (1<<6); // HI - } - else - { - PORTB &= ~(1<<6); // LO - } - - if (usb_led & (1<<USB_LED_SCROLL_LOCK)) - { - PORTB |= (1<<7); // HI - } - else - { - PORTB &= ~(1<<7); // LO +bool led_update_kb(led_t led_state) { + if (led_update_user(led_state)) { + writePin(B6, led_state.caps_lock); + writePin(B7, led_state.scroll_lock); } - led_set_user(usb_led); + return true; } |