diff options
author | Christopher Browne <cbbrowne@ca.afilias.info> | 2016-07-25 12:55:46 -0400 |
---|---|---|
committer | Christopher Browne <cbbrowne@ca.afilias.info> | 2016-07-25 12:55:46 -0400 |
commit | 17a7570e081a92e9a975ed86f94b9c0bbfc158f4 (patch) | |
tree | 51a8dd3596314dec1d87c9f35b3fa9069166960d /keyboards/kinesis/kinesis.c | |
parent | 82f768e6c04c57fa44d6020e3d57a6b3de211ddc (diff) | |
parent | f9aadd17e8fce17fe1e135cf8022e71a35ae5adf (diff) | |
download | qmk_firmware-17a7570e081a92e9a975ed86f94b9c0bbfc158f4.tar.gz qmk_firmware-17a7570e081a92e9a975ed86f94b9c0bbfc158f4.zip |
Merge branch 'master' of https://github.com/jackhumbert/qmk_firmware
Diffstat (limited to 'keyboards/kinesis/kinesis.c')
-rw-r--r-- | keyboards/kinesis/kinesis.c | 106 |
1 files changed, 106 insertions, 0 deletions
diff --git a/keyboards/kinesis/kinesis.c b/keyboards/kinesis/kinesis.c new file mode 100644 index 0000000000..1fee90e6f9 --- /dev/null +++ b/keyboards/kinesis/kinesis.c @@ -0,0 +1,106 @@ +#include "kinesis.h" + +// begin section origin https://github.com/alvicstep/tmk_keyboard + + +void all_led_off(void) +{ + PORTD = 0b11111111; +} + +void all_led_on(void) +{ + PORTD = 0b00000000; +} +void num_lock_led_on(void) +{ + PORTD = 0b11101111; +} + +void caps_lock_led_on(void) +{ + PORTD = 0b01111111; +} + +void scroll_lock_led_on(void) +{ + PORTD = 0b11011111; +} +void keypad_led_on(void) +{ + PORTD = 0b10111111; +} +void blink_all_leds(void) +{ + all_led_on(); + _delay_ms(500); + + all_led_off(); + _delay_ms(100); + + caps_lock_led_on(); + _delay_ms(100); + + num_lock_led_on(); + _delay_ms(100); + + scroll_lock_led_on(); + _delay_ms(100); + + keypad_led_on(); + _delay_ms(100); + + //back + + scroll_lock_led_on(); + _delay_ms(100); + + num_lock_led_on(); + _delay_ms(100); + + caps_lock_led_on(); + _delay_ms(100); + + all_led_off(); +} + +// End section origin https://github.com/alvicstep/tmk_keyboard + + void matrix_init_kb(void) { + blink_all_leds(); + 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); +} + +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + +//Copyright 2014 Warren Janssens <warren.janssens@gmail.com> + uint8_t leds = 0xF0; + if (usb_led & 1 << USB_LED_NUM_LOCK) + leds &= ~0x10; + if (usb_led & 1 << USB_LED_CAPS_LOCK) + leds &= ~0x80; + if (usb_led & 1 << USB_LED_SCROLL_LOCK) + leds &= ~0x20; + PORTD = (PORTD & 0x0F) | leds; + + led_set_user(usb_led); + +} + + |