diff options
Diffstat (limited to 'keyboards')
| -rw-r--r-- | keyboards/tetris/config.h | 12 | ||||
| -rw-r--r-- | keyboards/tetris/keymaps/default/keymap.c | 42 | ||||
| -rw-r--r-- | keyboards/tetris/rules.mk | 21 |
3 files changed, 31 insertions, 44 deletions
diff --git a/keyboards/tetris/config.h b/keyboards/tetris/config.h index 7e7dac7cf..c2e552449 100644 --- a/keyboards/tetris/config.h +++ b/keyboards/tetris/config.h | |||
| @@ -1,5 +1,4 @@ | |||
| 1 | #ifndef CONFIG_H | 1 | #pragma once |
| 2 | #define CONFIG_H | ||
| 3 | 2 | ||
| 4 | #include "config_common.h" | 3 | #include "config_common.h" |
| 5 | 4 | ||
| @@ -10,6 +9,7 @@ | |||
| 10 | #define MANUFACTURER Fengz | 9 | #define MANUFACTURER Fengz |
| 11 | #define PRODUCT Tetris | 10 | #define PRODUCT Tetris |
| 12 | #define DESCRIPTION Planck mit | 11 | #define DESCRIPTION Planck mit |
| 12 | |||
| 13 | #define QMK_ESC_OUTPUT B0 | 13 | #define QMK_ESC_OUTPUT B0 |
| 14 | #define QMK_ESC_INPUT D7 | 14 | #define QMK_ESC_INPUT D7 |
| 15 | #define QMK_LED B7 | 15 | #define QMK_LED B7 |
| @@ -41,8 +41,10 @@ | |||
| 41 | keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ | 41 | keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ |
| 42 | ) | 42 | ) |
| 43 | 43 | ||
| 44 | #define NO_ACTION_MACRO | ||
| 45 | #define NO_ACTION_FUNCTION | ||
| 46 | |||
| 44 | #define TAPPING_TERM 200 | 47 | #define TAPPING_TERM 200 |
| 45 | #define PERMISSIVE_HOLD | ||
| 46 | 48 | ||
| 47 | #ifdef AUDIO_ENABLE | 49 | #ifdef AUDIO_ENABLE |
| 48 | #define B5_AUDIO | 50 | #define B5_AUDIO |
| @@ -50,13 +52,11 @@ | |||
| 50 | #define NO_MUSIC_MODE | 52 | #define NO_MUSIC_MODE |
| 51 | #endif | 53 | #endif |
| 52 | 54 | ||
| 55 | #if RGBLIGHT_ENABLE | ||
| 53 | #define RGB_DI_PIN F5 | 56 | #define RGB_DI_PIN F5 |
| 54 | #ifdef RGB_DI_PIN | ||
| 55 | #define RGBLIGHT_ANIMATIONS | 57 | #define RGBLIGHT_ANIMATIONS |
| 56 | #define RGBLIGHT_SLEEP | 58 | #define RGBLIGHT_SLEEP |
| 57 | #define RGBLED_NUM 47 | 59 | #define RGBLED_NUM 47 |
| 58 | #define RGBLIGHT_EFFECT_KNIGHT_LED_NUM 12 | 60 | #define RGBLIGHT_EFFECT_KNIGHT_LED_NUM 12 |
| 59 | //#define RGBLIGHT_LIMIT_VAL 128 | 61 | //#define RGBLIGHT_LIMIT_VAL 128 |
| 60 | #endif | 62 | #endif |
| 61 | |||
| 62 | #endif | ||
diff --git a/keyboards/tetris/keymaps/default/keymap.c b/keyboards/tetris/keymaps/default/keymap.c index 61f2961b4..5f48bd07a 100644 --- a/keyboards/tetris/keymaps/default/keymap.c +++ b/keyboards/tetris/keymaps/default/keymap.c | |||
| @@ -286,7 +286,7 @@ static uint16_t Type_Hue=270; | |||
| 286 | 286 | ||
| 287 | void matrix_init_user( void ) | 287 | void matrix_init_user( void ) |
| 288 | { | 288 | { |
| 289 | _delay_ms( 200 ); | 289 | wait_ms( 200 ); |
| 290 | 290 | ||
| 291 | /* Encoder init */ | 291 | /* Encoder init */ |
| 292 | encoder_state = PIND & 0x3; | 292 | encoder_state = PIND & 0x3; |
| @@ -368,27 +368,22 @@ void matrix_scan_user( void ) | |||
| 368 | switch ( layer ) | 368 | switch ( layer ) |
| 369 | { | 369 | { |
| 370 | case 0: | 370 | case 0: |
| 371 | register_code( KC_VOLD ); | 371 | tap_code( KC_VOLD ); |
| 372 | unregister_code( KC_VOLD ); | ||
| 373 | break; | 372 | break; |
| 374 | case _CODE: | 373 | case _CODE: |
| 375 | register_code( KC_LEFT ); | 374 | tap_code( KC_LEFT ); |
| 376 | unregister_code( KC_LEFT ); | ||
| 377 | break; | 375 | break; |
| 378 | case _RGB: | 376 | case _RGB: |
| 379 | rgblight_decrease_val(); | 377 | rgblight_decrease_val(); |
| 380 | break; | 378 | break; |
| 381 | case _NUMB: | 379 | case _NUMB: |
| 382 | register_code( KC_LEFT ); | 380 | tap_code( KC_LEFT ); |
| 383 | unregister_code( KC_LEFT ); | ||
| 384 | break; | 381 | break; |
| 385 | case _MARO: | 382 | case _MARO: |
| 386 | register_code( KC_UP ); | 383 | tap_code( KC_UP ); |
| 387 | unregister_code( KC_UP ); | ||
| 388 | break; | 384 | break; |
| 389 | default: | 385 | default: |
| 390 | register_code( KC_VOLD ); | 386 | tap_code( KC_VOLD ); |
| 391 | unregister_code( KC_VOLD ); | ||
| 392 | } | 387 | } |
| 393 | /* End of Set Encoder Keycode */ | 388 | /* End of Set Encoder Keycode */ |
| 394 | 389 | ||
| @@ -441,27 +436,22 @@ void matrix_scan_user( void ) | |||
| 441 | switch ( layer ) | 436 | switch ( layer ) |
| 442 | { | 437 | { |
| 443 | case 0: | 438 | case 0: |
| 444 | register_code( KC_VOLU ); | 439 | tap_code( KC_VOLU ); |
| 445 | unregister_code( KC_VOLU ); | ||
| 446 | break; | 440 | break; |
| 447 | case _CODE: | 441 | case _CODE: |
| 448 | register_code( KC_RGHT ); | 442 | tap_code( KC_RGHT ); |
| 449 | unregister_code( KC_RGHT ); | ||
| 450 | break; | 443 | break; |
| 451 | case _RGB: | 444 | case _RGB: |
| 452 | rgblight_increase_val(); | 445 | rgblight_increase_val(); |
| 453 | break; | 446 | break; |
| 454 | case _NUMB: | 447 | case _NUMB: |
| 455 | register_code( KC_RGHT ); | 448 | tap_code( KC_RGHT ); |
| 456 | unregister_code( KC_RGHT ); | ||
| 457 | break; | 449 | break; |
| 458 | case _MARO: | 450 | case _MARO: |
| 459 | register_code( KC_DOWN ); | 451 | tap_code( KC_DOWN ); |
| 460 | unregister_code( KC_DOWN ); | ||
| 461 | break; | 452 | break; |
| 462 | default: | 453 | default: |
| 463 | register_code( KC_VOLU ); | 454 | tap_code( KC_VOLU ); |
| 464 | unregister_code( KC_VOLU ); | ||
| 465 | } | 455 | } |
| 466 | /* End of Set Encoder Keycode */ | 456 | /* End of Set Encoder Keycode */ |
| 467 | 457 | ||
| @@ -739,11 +729,8 @@ bool process_record_user( uint16_t keycode, keyrecord_t *record ){ | |||
| 739 | if (record->event.pressed) { | 729 | if (record->event.pressed) { |
| 740 | // Do something when pressed | 730 | // Do something when pressed |
| 741 | } else { | 731 | } else { |
| 742 | register_code( KC_0 ); // send 0 | 732 | tap_code( KC_0 ); // send 0 |
| 743 | unregister_code( KC_0 ); | 733 | tap_code( KC_0 ); // send 0 twice without macro |
| 744 | |||
| 745 | register_code( KC_0 ); // send 0 twice without macro | ||
| 746 | unregister_code( KC_0 ); | ||
| 747 | } | 734 | } |
| 748 | return false; // Skip all further processing of this key | 735 | return false; // Skip all further processing of this key |
| 749 | 736 | ||
| @@ -818,7 +805,7 @@ bool process_record_user( uint16_t keycode, keyrecord_t *record ){ | |||
| 818 | void led_set_user( uint8_t usb_led ) | 805 | void led_set_user( uint8_t usb_led ) |
| 819 | { | 806 | { |
| 820 | static uint8_t old_usb_led = 0; | 807 | static uint8_t old_usb_led = 0; |
| 821 | _delay_ms( 10 ); /* gets rid of tick */ | 808 | wait_ms( 10 ); /* gets rid of tick */ |
| 822 | 809 | ||
| 823 | if ( (usb_led & (1 << USB_LED_CAPS_LOCK) ) && !(old_usb_led & (1 << USB_LED_CAPS_LOCK) ) ) { | 810 | if ( (usb_led & (1 << USB_LED_CAPS_LOCK) ) && !(old_usb_led & (1 << USB_LED_CAPS_LOCK) ) ) { |
| 824 | /* CAPS on */ | 811 | /* CAPS on */ |
| @@ -844,4 +831,3 @@ void led_set_user( uint8_t usb_led ) | |||
| 844 | } | 831 | } |
| 845 | old_usb_led = usb_led; | 832 | old_usb_led = usb_led; |
| 846 | } // End of led_set_user | 833 | } // End of led_set_user |
| 847 | |||
diff --git a/keyboards/tetris/rules.mk b/keyboards/tetris/rules.mk index 784f6e462..4741c162b 100644 --- a/keyboards/tetris/rules.mk +++ b/keyboards/tetris/rules.mk | |||
| @@ -44,17 +44,18 @@ BOOTLOADER =qmk-dfu | |||
| 44 | # Build Options | 44 | # Build Options |
| 45 | # comment out to disable the options. | 45 | # comment out to disable the options. |
| 46 | # | 46 | # |
| 47 | BOOTMAGIC_ENABLE ?= no # Virtual DIP switch configuration(+1000) | 47 | BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) |
| 48 | MOUSEKEY_ENABLE ?= no # Mouse keys(+4700) | 48 | MOUSEKEY_ENABLE = no # Mouse keys(+4700) |
| 49 | EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450) | 49 | EXTRAKEY_ENABLE = yes # Audio control and System control(+450) |
| 50 | CONSOLE_ENABLE ?= no # Console for debug(+400) | 50 | CONSOLE_ENABLE = no # Console for debug(+400) |
| 51 | COMMAND_ENABLE ?= no # Commands for debug and configuration | 51 | COMMAND_ENABLE = no # Commands for debug and configuration |
| 52 | SLEEP_LED_ENABLE ?= no # Breathing sleep LED during USB suspend | 52 | SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend |
| 53 | NKRO_ENABLE ?= yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work | 53 | NKRO_ENABLE = yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work |
| 54 | BACKLIGHT_ENABLE ?= no # Enable keyboard backlight functionality | 54 | BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality |
| 55 | AUDIO_ENABLE ?= yes | 55 | AUDIO_ENABLE = yes |
| 56 | RGBLIGHT_ENABLE ?= yes | 56 | RGBLIGHT_ENABLE = yes |
| 57 | TAP_DANCE_ENABLE = no | 57 | TAP_DANCE_ENABLE = no |
| 58 | |||
| 58 | EXTRAFLAGS += -flto # Make the hex smaller | 59 | EXTRAFLAGS += -flto # Make the hex smaller |
| 59 | 60 | ||
| 60 | LAYOUTS = planck_mit | 61 | LAYOUTS = planck_mit |
