summaryrefslogtreecommitdiff
path: root/keyboards/tetris
diff options
context:
space:
mode:
authorAlex Ong <the.onga@gmail.com>2019-01-04 19:43:45 +1100
committerAlex Ong <the.onga@gmail.com>2019-01-04 19:43:45 +1100
commit2bb2977c133646c4e056960e72029270d77cc1eb (patch)
tree235d491f992121ac1716c5bf2fafb80983748576 /keyboards/tetris
parenta55c838961c89097ab849ed6cb1f261791e6b9b4 (diff)
parent47c91fc7f75ae0a477e55b687aa0fc30da0a283c (diff)
Merge branch 'master' into debounce_refactor
# Conflicts: # tmk_core/common/keyboard.c
Diffstat (limited to 'keyboards/tetris')
-rw-r--r--keyboards/tetris/config.h13
-rw-r--r--keyboards/tetris/keymaps/default/keymap.c42
-rw-r--r--keyboards/tetris/rules.mk21
3 files changed, 30 insertions, 46 deletions
diff --git a/keyboards/tetris/config.h b/keyboards/tetris/config.h
index 9c7f525a71..c2e5524490 100644
--- a/keyboards/tetris/config.h
+++ b/keyboards/tetris/config.h
@@ -1,5 +1,4 @@
-#ifndef CONFIG_H
-#define CONFIG_H
+#pragma once
#include "config_common.h"
@@ -10,6 +9,7 @@
#define MANUFACTURER Fengz
#define PRODUCT Tetris
#define DESCRIPTION Planck mit
+
#define QMK_ESC_OUTPUT B0
#define QMK_ESC_INPUT D7
#define QMK_LED B7
@@ -41,11 +41,10 @@
keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \
)
-/* prevent stuck modifiers */
-#define PREVENT_STUCK_MODIFIERS
+#define NO_ACTION_MACRO
+#define NO_ACTION_FUNCTION
#define TAPPING_TERM 200
-#define PERMISSIVE_HOLD
#ifdef AUDIO_ENABLE
#define B5_AUDIO
@@ -53,13 +52,11 @@
#define NO_MUSIC_MODE
#endif
+#if RGBLIGHT_ENABLE
#define RGB_DI_PIN F5
-#ifdef RGB_DI_PIN
#define RGBLIGHT_ANIMATIONS
#define RGBLIGHT_SLEEP
#define RGBLED_NUM 47
#define RGBLIGHT_EFFECT_KNIGHT_LED_NUM 12
//#define RGBLIGHT_LIMIT_VAL 128
#endif
-
-#endif \ No newline at end of file
diff --git a/keyboards/tetris/keymaps/default/keymap.c b/keyboards/tetris/keymaps/default/keymap.c
index 61f2961b42..5f48bd07ab 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;
void matrix_init_user( void )
{
- _delay_ms( 200 );
+ wait_ms( 200 );
/* Encoder init */
encoder_state = PIND & 0x3;
@@ -368,27 +368,22 @@ void matrix_scan_user( void )
switch ( layer )
{
case 0:
- register_code( KC_VOLD );
- unregister_code( KC_VOLD );
+ tap_code( KC_VOLD );
break;
case _CODE:
- register_code( KC_LEFT );
- unregister_code( KC_LEFT );
+ tap_code( KC_LEFT );
break;
case _RGB:
rgblight_decrease_val();
break;
case _NUMB:
- register_code( KC_LEFT );
- unregister_code( KC_LEFT );
+ tap_code( KC_LEFT );
break;
case _MARO:
- register_code( KC_UP );
- unregister_code( KC_UP );
+ tap_code( KC_UP );
break;
default:
- register_code( KC_VOLD );
- unregister_code( KC_VOLD );
+ tap_code( KC_VOLD );
}
/* End of Set Encoder Keycode */
@@ -441,27 +436,22 @@ void matrix_scan_user( void )
switch ( layer )
{
case 0:
- register_code( KC_VOLU );
- unregister_code( KC_VOLU );
+ tap_code( KC_VOLU );
break;
case _CODE:
- register_code( KC_RGHT );
- unregister_code( KC_RGHT );
+ tap_code( KC_RGHT );
break;
case _RGB:
rgblight_increase_val();
break;
case _NUMB:
- register_code( KC_RGHT );
- unregister_code( KC_RGHT );
+ tap_code( KC_RGHT );
break;
case _MARO:
- register_code( KC_DOWN );
- unregister_code( KC_DOWN );
+ tap_code( KC_DOWN );
break;
default:
- register_code( KC_VOLU );
- unregister_code( KC_VOLU );
+ tap_code( KC_VOLU );
}
/* End of Set Encoder Keycode */
@@ -739,11 +729,8 @@ bool process_record_user( uint16_t keycode, keyrecord_t *record ){
if (record->event.pressed) {
// Do something when pressed
} else {
- register_code( KC_0 ); // send 0
- unregister_code( KC_0 );
-
- register_code( KC_0 ); // send 0 twice without macro
- unregister_code( KC_0 );
+ tap_code( KC_0 ); // send 0
+ tap_code( KC_0 ); // send 0 twice without macro
}
return false; // Skip all further processing of this key
@@ -818,7 +805,7 @@ bool process_record_user( uint16_t keycode, keyrecord_t *record ){
void led_set_user( uint8_t usb_led )
{
static uint8_t old_usb_led = 0;
- _delay_ms( 10 ); /* gets rid of tick */
+ wait_ms( 10 ); /* gets rid of tick */
if ( (usb_led & (1 << USB_LED_CAPS_LOCK) ) && !(old_usb_led & (1 << USB_LED_CAPS_LOCK) ) ) {
/* CAPS on */
@@ -844,4 +831,3 @@ void led_set_user( uint8_t usb_led )
}
old_usb_led = usb_led;
} // End of led_set_user
-
diff --git a/keyboards/tetris/rules.mk b/keyboards/tetris/rules.mk
index 784f6e4623..4741c162bd 100644
--- a/keyboards/tetris/rules.mk
+++ b/keyboards/tetris/rules.mk
@@ -44,17 +44,18 @@ BOOTLOADER =qmk-dfu
# Build Options
# comment out to disable the options.
#
-BOOTMAGIC_ENABLE ?= no # Virtual DIP switch configuration(+1000)
-MOUSEKEY_ENABLE ?= no # Mouse keys(+4700)
-EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450)
-CONSOLE_ENABLE ?= no # Console for debug(+400)
-COMMAND_ENABLE ?= no # Commands for debug and configuration
-SLEEP_LED_ENABLE ?= no # Breathing sleep LED during USB suspend
-NKRO_ENABLE ?= yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
-BACKLIGHT_ENABLE ?= no # Enable keyboard backlight functionality
-AUDIO_ENABLE ?= yes
-RGBLIGHT_ENABLE ?= yes
+BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000)
+MOUSEKEY_ENABLE = no # Mouse keys(+4700)
+EXTRAKEY_ENABLE = yes # Audio control and System control(+450)
+CONSOLE_ENABLE = no # Console for debug(+400)
+COMMAND_ENABLE = no # Commands for debug and configuration
+SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
+NKRO_ENABLE = yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
+BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
+AUDIO_ENABLE = yes
+RGBLIGHT_ENABLE = yes
TAP_DANCE_ENABLE = no
+
EXTRAFLAGS += -flto # Make the hex smaller
LAYOUTS = planck_mit