diff options
Diffstat (limited to 'quantum')
| -rw-r--r-- | quantum/config_common.h | 6 | ||||
| -rw-r--r-- | quantum/keymap_common.c | 7 | ||||
| -rw-r--r-- | quantum/keymap_extras/keymap_br_abnt2.h | 16 | ||||
| -rwxr-xr-x | quantum/light_ws2812.c | 6 | ||||
| -rw-r--r-- | quantum/matrix.c | 14 | ||||
| -rw-r--r-- | quantum/process_keycode/process_combo.c | 134 | ||||
| -rw-r--r-- | quantum/process_keycode/process_combo.h | 43 | ||||
| -rw-r--r-- | quantum/process_keycode/process_tap_dance.c | 7 | ||||
| -rw-r--r-- | quantum/process_keycode/process_tap_dance.h | 1 | ||||
| -rw-r--r-- | quantum/process_keycode/process_unicode.c | 13 | ||||
| -rw-r--r-- | quantum/quantum.c | 167 | ||||
| -rw-r--r-- | quantum/quantum.h | 5 | ||||
| -rw-r--r-- | quantum/quantum_keycodes.h | 43 | ||||
| -rw-r--r-- | quantum/rgblight.c | 35 | ||||
| -rw-r--r-- | quantum/rgblight.h | 11 | ||||
| -rw-r--r-- | quantum/template/config.h | 2 | ||||
| -rw-r--r-- | quantum/visualizer/visualizer.c | 58 | ||||
| -rw-r--r-- | quantum/visualizer/visualizer.h | 9 |
18 files changed, 509 insertions, 68 deletions
diff --git a/quantum/config_common.h b/quantum/config_common.h index 4bdb2065d..28f68b9c7 100644 --- a/quantum/config_common.h +++ b/quantum/config_common.h | |||
| @@ -2,8 +2,10 @@ | |||
| 2 | #define CONFIG_DEFINITIONS_H | 2 | #define CONFIG_DEFINITIONS_H |
| 3 | 3 | ||
| 4 | /* diode directions */ | 4 | /* diode directions */ |
| 5 | #define COL2ROW 0 | 5 | #define COL2ROW 0 |
| 6 | #define ROW2COL 1 | 6 | #define ROW2COL 1 |
| 7 | #define CUSTOM_MATRIX 2 /* Disables built-in matrix scanning code */ | ||
| 8 | |||
| 7 | /* I/O pins */ | 9 | /* I/O pins */ |
| 8 | #ifndef F0 | 10 | #ifndef F0 |
| 9 | #define B0 0x30 | 11 | #define B0 0x30 |
diff --git a/quantum/keymap_common.c b/quantum/keymap_common.c index eced3d2bb..54b872d49 100644 --- a/quantum/keymap_common.c +++ b/quantum/keymap_common.c | |||
| @@ -80,7 +80,10 @@ action_t action_for_key(uint8_t layer, keypos_t key) | |||
| 80 | action.code = keymap_function_id_to_action( (int)keycode & 0xFFF ); | 80 | action.code = keymap_function_id_to_action( (int)keycode & 0xFFF ); |
| 81 | break; | 81 | break; |
| 82 | case QK_MACRO ... QK_MACRO_MAX: | 82 | case QK_MACRO ... QK_MACRO_MAX: |
| 83 | action.code = ACTION_MACRO(keycode & 0xFF); | 83 | if (keycode & 0x800) // tap macros have upper bit set |
| 84 | action.code = ACTION_MACRO_TAP(keycode & 0xFF); | ||
| 85 | else | ||
| 86 | action.code = ACTION_MACRO(keycode & 0xFF); | ||
| 84 | break; | 87 | break; |
| 85 | case QK_LAYER_TAP ... QK_LAYER_TAP_MAX: | 88 | case QK_LAYER_TAP ... QK_LAYER_TAP_MAX: |
| 86 | action.code = ACTION_LAYER_TAP_KEY((keycode >> 0x8) & 0xF, keycode & 0xFF); | 89 | action.code = ACTION_LAYER_TAP_KEY((keycode >> 0x8) & 0xF, keycode & 0xFF); |
| @@ -117,7 +120,7 @@ action_t action_for_key(uint8_t layer, keypos_t key) | |||
| 117 | action.code = ACTION_MODS_ONESHOT(mod); | 120 | action.code = ACTION_MODS_ONESHOT(mod); |
| 118 | break; | 121 | break; |
| 119 | case QK_MOD_TAP ... QK_MOD_TAP_MAX: | 122 | case QK_MOD_TAP ... QK_MOD_TAP_MAX: |
| 120 | action.code = ACTION_MODS_TAP_KEY((keycode >> 0x8) & 0xF, keycode & 0xFF); | 123 | action.code = ACTION_MODS_TAP_KEY((keycode >> 0x8) & 0x1F, keycode & 0xFF); |
| 121 | break; | 124 | break; |
| 122 | #ifdef BACKLIGHT_ENABLE | 125 | #ifdef BACKLIGHT_ENABLE |
| 123 | case BL_0 ... BL_15: | 126 | case BL_0 ... BL_15: |
diff --git a/quantum/keymap_extras/keymap_br_abnt2.h b/quantum/keymap_extras/keymap_br_abnt2.h index 0df177721..b001139dd 100644 --- a/quantum/keymap_extras/keymap_br_abnt2.h +++ b/quantum/keymap_extras/keymap_br_abnt2.h | |||
| @@ -1,3 +1,19 @@ | |||
| 1 | /* Copyright 2017 Potiguar Faga | ||
| 2 | * | ||
| 3 | * This program is free software: you can redistribute it and/or modify | ||
| 4 | * it under the terms of the GNU General Public License as published by | ||
| 5 | * the Free Software Foundation, either version 2 of the License, or | ||
| 6 | * (at your option) any later version. | ||
| 7 | * | ||
| 8 | * This program is distributed in the hope that it will be useful, | ||
| 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 11 | * GNU General Public License for more details. | ||
| 12 | * | ||
| 13 | * You should have received a copy of the GNU General Public License | ||
| 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
| 15 | */ | ||
| 16 | |||
| 1 | #ifndef KEYMAP_BR_ABNT2_H | 17 | #ifndef KEYMAP_BR_ABNT2_H |
| 2 | #define KEYMAP_BR_ABNT2_H | 18 | #define KEYMAP_BR_ABNT2_H |
| 3 | 19 | ||
diff --git a/quantum/light_ws2812.c b/quantum/light_ws2812.c index a883b1388..55bdd9cd8 100755 --- a/quantum/light_ws2812.c +++ b/quantum/light_ws2812.c | |||
| @@ -70,7 +70,7 @@ void I2C_WriteBit(unsigned char c) | |||
| 70 | 70 | ||
| 71 | // Inits bitbanging port, must be called before using the functions below | 71 | // Inits bitbanging port, must be called before using the functions below |
| 72 | // | 72 | // |
| 73 | void I2C_Init() | 73 | void I2C_Init(void) |
| 74 | { | 74 | { |
| 75 | I2C_PORT &= ~ ((1 << I2C_DAT) | (1 << I2C_CLK)); | 75 | I2C_PORT &= ~ ((1 << I2C_DAT) | (1 << I2C_CLK)); |
| 76 | 76 | ||
| @@ -82,7 +82,7 @@ void I2C_Init() | |||
| 82 | 82 | ||
| 83 | // Send a START Condition | 83 | // Send a START Condition |
| 84 | // | 84 | // |
| 85 | void I2C_Start() | 85 | void I2C_Start(void) |
| 86 | { | 86 | { |
| 87 | // set both to high at the same time | 87 | // set both to high at the same time |
| 88 | I2C_DDR &= ~ ((1 << I2C_DAT) | (1 << I2C_CLK)); | 88 | I2C_DDR &= ~ ((1 << I2C_DAT) | (1 << I2C_CLK)); |
| @@ -97,7 +97,7 @@ void I2C_Start() | |||
| 97 | 97 | ||
| 98 | // Send a STOP Condition | 98 | // Send a STOP Condition |
| 99 | // | 99 | // |
| 100 | void I2C_Stop() | 100 | void I2C_Stop(void) |
| 101 | { | 101 | { |
| 102 | I2C_CLOCK_HI(); | 102 | I2C_CLOCK_HI(); |
| 103 | _delay_us(I2C_DELAY); | 103 | _delay_us(I2C_DELAY); |
diff --git a/quantum/matrix.c b/quantum/matrix.c index 07eb87bc3..ac523482a 100644 --- a/quantum/matrix.c +++ b/quantum/matrix.c | |||
| @@ -60,13 +60,14 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. | |||
| 60 | extern const matrix_row_t matrix_mask[]; | 60 | extern const matrix_row_t matrix_mask[]; |
| 61 | #endif | 61 | #endif |
| 62 | 62 | ||
| 63 | #if (DIODE_DIRECTION == ROW2COL) || (DIODE_DIRECTION == COL2ROW) | ||
| 63 | static const uint8_t row_pins[MATRIX_ROWS] = MATRIX_ROW_PINS; | 64 | static const uint8_t row_pins[MATRIX_ROWS] = MATRIX_ROW_PINS; |
| 64 | static const uint8_t col_pins[MATRIX_COLS] = MATRIX_COL_PINS; | 65 | static const uint8_t col_pins[MATRIX_COLS] = MATRIX_COL_PINS; |
| 66 | #endif | ||
| 65 | 67 | ||
| 66 | /* matrix state(1:on, 0:off) */ | 68 | /* matrix state(1:on, 0:off) */ |
| 67 | static matrix_row_t matrix[MATRIX_ROWS]; | 69 | static matrix_row_t matrix[MATRIX_ROWS]; |
| 68 | 70 | ||
| 69 | static matrix_row_t matrix_raw[MATRIX_ROWS]; | ||
| 70 | static matrix_row_t matrix_debouncing[MATRIX_ROWS]; | 71 | static matrix_row_t matrix_debouncing[MATRIX_ROWS]; |
| 71 | 72 | ||
| 72 | 73 | ||
| @@ -76,7 +77,7 @@ static matrix_row_t matrix_debouncing[MATRIX_ROWS]; | |||
| 76 | static void unselect_rows(void); | 77 | static void unselect_rows(void); |
| 77 | static void select_row(uint8_t row); | 78 | static void select_row(uint8_t row); |
| 78 | static void unselect_row(uint8_t row); | 79 | static void unselect_row(uint8_t row); |
| 79 | #else // ROW2COL | 80 | #elif (DIODE_DIRECTION == ROW2COL) |
| 80 | static void init_rows(void); | 81 | static void init_rows(void); |
| 81 | static bool read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col); | 82 | static bool read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col); |
| 82 | static void unselect_cols(void); | 83 | static void unselect_cols(void); |
| @@ -133,7 +134,7 @@ uint8_t matrix_cols(void) { | |||
| 133 | // /* PORTxn */ | 134 | // /* PORTxn */ |
| 134 | // _SFR_IO8((col_pins[c] >> 4) + 2) |= _BV(col_pins[c] & 0xF); | 135 | // _SFR_IO8((col_pins[c] >> 4) + 2) |= _BV(col_pins[c] & 0xF); |
| 135 | // } | 136 | // } |
| 136 | // #else | 137 | // #elif (DIODE_DIRECTION == ROW2COL) |
| 137 | // for (int8_t c = MATRIX_COLS - 1; c >= 0; --c) { | 138 | // for (int8_t c = MATRIX_COLS - 1; c >= 0; --c) { |
| 138 | // /* DDRxn */ | 139 | // /* DDRxn */ |
| 139 | // _SFR_IO8((col_pins[c] >> 4) + 1) |= _BV(col_pins[c] & 0xF); | 140 | // _SFR_IO8((col_pins[c] >> 4) + 1) |= _BV(col_pins[c] & 0xF); |
| @@ -158,7 +159,7 @@ void matrix_init(void) { | |||
| 158 | #if (DIODE_DIRECTION == COL2ROW) | 159 | #if (DIODE_DIRECTION == COL2ROW) |
| 159 | unselect_rows(); | 160 | unselect_rows(); |
| 160 | init_cols(); | 161 | init_cols(); |
| 161 | #else // ROW2COL | 162 | #elif (DIODE_DIRECTION == ROW2COL) |
| 162 | unselect_cols(); | 163 | unselect_cols(); |
| 163 | init_rows(); | 164 | init_rows(); |
| 164 | #endif | 165 | #endif |
| @@ -166,7 +167,6 @@ void matrix_init(void) { | |||
| 166 | // initialize matrix state: all keys off | 167 | // initialize matrix state: all keys off |
| 167 | for (uint8_t i=0; i < MATRIX_ROWS; i++) { | 168 | for (uint8_t i=0; i < MATRIX_ROWS; i++) { |
| 168 | matrix[i] = 0; | 169 | matrix[i] = 0; |
| 169 | matrix_raw[i] = 0; | ||
| 170 | matrix_debouncing[i] = 0; | 170 | matrix_debouncing[i] = 0; |
| 171 | } | 171 | } |
| 172 | 172 | ||
| @@ -194,7 +194,7 @@ uint8_t matrix_scan(void) | |||
| 194 | 194 | ||
| 195 | } | 195 | } |
| 196 | 196 | ||
| 197 | #else // ROW2COL | 197 | #elif (DIODE_DIRECTION == ROW2COL) |
| 198 | 198 | ||
| 199 | // Set col, read rows | 199 | // Set col, read rows |
| 200 | for (uint8_t current_col = 0; current_col < MATRIX_COLS; current_col++) { | 200 | for (uint8_t current_col = 0; current_col < MATRIX_COLS; current_col++) { |
| @@ -336,7 +336,7 @@ static void unselect_rows(void) | |||
| 336 | } | 336 | } |
| 337 | } | 337 | } |
| 338 | 338 | ||
| 339 | #else // ROW2COL | 339 | #elif (DIODE_DIRECTION == ROW2COL) |
| 340 | 340 | ||
| 341 | static void init_rows(void) | 341 | static void init_rows(void) |
| 342 | { | 342 | { |
diff --git a/quantum/process_keycode/process_combo.c b/quantum/process_keycode/process_combo.c new file mode 100644 index 000000000..e2189ad98 --- /dev/null +++ b/quantum/process_keycode/process_combo.c | |||
| @@ -0,0 +1,134 @@ | |||
| 1 | #include "process_combo.h" | ||
| 2 | #include "print.h" | ||
| 3 | |||
| 4 | |||
| 5 | #define COMBO_TIMER_ELAPSED -1 | ||
| 6 | |||
| 7 | |||
| 8 | __attribute__ ((weak)) | ||
| 9 | combo_t key_combos[] = { | ||
| 10 | |||
| 11 | }; | ||
| 12 | |||
| 13 | __attribute__ ((weak)) | ||
| 14 | void process_combo_event(uint8_t combo_index, bool pressed) { | ||
| 15 | |||
| 16 | } | ||
| 17 | |||
| 18 | static uint8_t current_combo_index = 0; | ||
| 19 | |||
| 20 | static inline void send_combo(uint16_t action, bool pressed) | ||
| 21 | { | ||
| 22 | if (action) { | ||
| 23 | if (pressed) { | ||
| 24 | register_code16(action); | ||
| 25 | } else { | ||
| 26 | unregister_code16(action); | ||
| 27 | } | ||
| 28 | } else { | ||
| 29 | process_combo_event(current_combo_index, pressed); | ||
| 30 | } | ||
| 31 | } | ||
| 32 | |||
| 33 | #define ALL_COMBO_KEYS_ARE_DOWN (((1<<count)-1) == combo->state) | ||
| 34 | #define NO_COMBO_KEYS_ARE_DOWN (0 == combo->state) | ||
| 35 | #define KEY_STATE_DOWN(key) do{ combo->state |= (1<<key); } while(0) | ||
| 36 | #define KEY_STATE_UP(key) do{ combo->state &= ~(1<<key); } while(0) | ||
| 37 | static bool process_single_combo(combo_t *combo, uint16_t keycode, keyrecord_t *record) | ||
| 38 | { | ||
| 39 | uint8_t count = 0; | ||
| 40 | uint8_t index = -1; | ||
| 41 | /* Find index of keycode and number of combo keys */ | ||
| 42 | for (const uint16_t *keys = combo->keys; ;++count) { | ||
| 43 | uint16_t key = pgm_read_word(&keys[count]); | ||
| 44 | if (keycode == key) index = count; | ||
| 45 | if (COMBO_END == key) break; | ||
| 46 | } | ||
| 47 | |||
| 48 | /* Return if not a combo key */ | ||
| 49 | if (-1 == (int8_t)index) return false; | ||
| 50 | |||
| 51 | /* The combos timer is used to signal whether the combo is active */ | ||
| 52 | bool is_combo_active = COMBO_TIMER_ELAPSED == combo->timer ? false : true; | ||
| 53 | |||
| 54 | if (record->event.pressed) { | ||
| 55 | KEY_STATE_DOWN(index); | ||
| 56 | |||
| 57 | if (is_combo_active) { | ||
| 58 | if (ALL_COMBO_KEYS_ARE_DOWN) { /* Combo was pressed */ | ||
| 59 | send_combo(combo->keycode, true); | ||
| 60 | combo->timer = COMBO_TIMER_ELAPSED; | ||
| 61 | } else { /* Combo key was pressed */ | ||
| 62 | combo->timer = timer_read(); | ||
| 63 | #ifdef COMBO_ALLOW_ACTION_KEYS | ||
| 64 | combo->prev_record = *record; | ||
| 65 | #else | ||
| 66 | combo->prev_key = keycode; | ||
| 67 | #endif | ||
| 68 | } | ||
| 69 | } | ||
| 70 | } else { | ||
| 71 | if (ALL_COMBO_KEYS_ARE_DOWN) { /* Combo was released */ | ||
| 72 | send_combo(combo->keycode, false); | ||
| 73 | } | ||
| 74 | |||
| 75 | if (is_combo_active) { /* Combo key was tapped */ | ||
| 76 | #ifdef COMBO_ALLOW_ACTION_KEYS | ||
| 77 | record->event.pressed = true; | ||
| 78 | process_action(record, store_or_get_action(record->event.pressed, record->event.key)); | ||
| 79 | record->event.pressed = false; | ||
| 80 | process_action(record, store_or_get_action(record->event.pressed, record->event.key)); | ||
| 81 | #else | ||
| 82 | register_code16(keycode); | ||
| 83 | send_keyboard_report(); | ||
| 84 | unregister_code16(keycode); | ||
| 85 | #endif | ||
| 86 | combo->timer = 0; | ||
| 87 | } | ||
| 88 | |||
| 89 | KEY_STATE_UP(index); | ||
| 90 | } | ||
| 91 | |||
| 92 | if (NO_COMBO_KEYS_ARE_DOWN) { | ||
| 93 | combo->timer = 0; | ||
| 94 | } | ||
| 95 | |||
| 96 | return is_combo_active; | ||
| 97 | } | ||
| 98 | |||
| 99 | bool process_combo(uint16_t keycode, keyrecord_t *record) | ||
| 100 | { | ||
| 101 | bool is_combo_key = false; | ||
| 102 | |||
| 103 | for (current_combo_index = 0; current_combo_index < COMBO_COUNT; ++current_combo_index) { | ||
| 104 | combo_t *combo = &key_combos[current_combo_index]; | ||
| 105 | is_combo_key |= process_single_combo(combo, keycode, record); | ||
| 106 | } | ||
| 107 | |||
| 108 | return !is_combo_key; | ||
| 109 | } | ||
| 110 | |||
| 111 | void matrix_scan_combo(void) | ||
| 112 | { | ||
| 113 | for (int i = 0; i < COMBO_COUNT; ++i) { | ||
| 114 | combo_t *combo = &key_combos[i]; | ||
| 115 | if (combo->timer && | ||
| 116 | combo->timer != COMBO_TIMER_ELAPSED && | ||
| 117 | timer_elapsed(combo->timer) > COMBO_TERM) { | ||
| 118 | |||
| 119 | /* This disables the combo, meaning key events for this | ||
| 120 | * combo will be handled by the next processors in the chain | ||
| 121 | */ | ||
| 122 | combo->timer = COMBO_TIMER_ELAPSED; | ||
| 123 | |||
| 124 | #ifdef COMBO_ALLOW_ACTION_KEYS | ||
| 125 | process_action(&combo->prev_record, | ||
| 126 | store_or_get_action(combo->prev_record.event.pressed, | ||
| 127 | combo->prev_record.event.key)); | ||
| 128 | #else | ||
| 129 | unregister_code16(combo->prev_key); | ||
| 130 | register_code16(combo->prev_key); | ||
| 131 | #endif | ||
| 132 | } | ||
| 133 | } | ||
| 134 | } | ||
diff --git a/quantum/process_keycode/process_combo.h b/quantum/process_keycode/process_combo.h new file mode 100644 index 000000000..847f2b737 --- /dev/null +++ b/quantum/process_keycode/process_combo.h | |||
| @@ -0,0 +1,43 @@ | |||
| 1 | #ifndef PROCESS_COMBO_H | ||
| 2 | #define PROCESS_COMBO_H | ||
| 3 | |||
| 4 | #include <stdint.h> | ||
| 5 | #include "progmem.h" | ||
| 6 | #include "quantum.h" | ||
| 7 | |||
| 8 | typedef struct | ||
| 9 | { | ||
| 10 | const uint16_t *keys; | ||
| 11 | uint16_t keycode; | ||
| 12 | #ifdef EXTRA_EXTRA_LONG_COMBOS | ||
| 13 | uint32_t state; | ||
| 14 | #elif EXTRA_LONG_COMBOS | ||
| 15 | uint16_t state; | ||
| 16 | #else | ||
| 17 | uint8_t state; | ||
| 18 | #endif | ||
| 19 | uint16_t timer; | ||
| 20 | #ifdef COMBO_ALLOW_ACTION_KEYS | ||
| 21 | keyrecord_t prev_record; | ||
| 22 | #else | ||
| 23 | uint16_t prev_key; | ||
| 24 | #endif | ||
| 25 | } combo_t; | ||
| 26 | |||
| 27 | |||
| 28 | #define COMBO(ck, ca) {.keys = &(ck)[0], .keycode = (ca)} | ||
| 29 | #define COMBO_ACTION(ck) {.keys = &(ck)[0]} | ||
| 30 | |||
| 31 | #define COMBO_END 0 | ||
| 32 | #ifndef COMBO_COUNT | ||
| 33 | #define COMBO_COUNT 0 | ||
| 34 | #endif | ||
| 35 | #ifndef COMBO_TERM | ||
| 36 | #define COMBO_TERM TAPPING_TERM | ||
| 37 | #endif | ||
| 38 | |||
| 39 | bool process_combo(uint16_t keycode, keyrecord_t *record); | ||
| 40 | void matrix_scan_combo(void); | ||
| 41 | void process_combo_event(uint8_t combo_index, bool pressed); | ||
| 42 | |||
| 43 | #endif | ||
diff --git a/quantum/process_keycode/process_tap_dance.c b/quantum/process_keycode/process_tap_dance.c index 6ae362c4c..403dca538 100644 --- a/quantum/process_keycode/process_tap_dance.c +++ b/quantum/process_keycode/process_tap_dance.c | |||
| @@ -43,12 +43,16 @@ static inline void process_tap_dance_action_on_dance_finished (qk_tap_dance_acti | |||
| 43 | if (action->state.finished) | 43 | if (action->state.finished) |
| 44 | return; | 44 | return; |
| 45 | action->state.finished = true; | 45 | action->state.finished = true; |
| 46 | add_mods(action->state.oneshot_mods); | ||
| 47 | send_keyboard_report(); | ||
| 46 | _process_tap_dance_action_fn (&action->state, action->user_data, action->fn.on_dance_finished); | 48 | _process_tap_dance_action_fn (&action->state, action->user_data, action->fn.on_dance_finished); |
| 47 | } | 49 | } |
| 48 | 50 | ||
| 49 | static inline void process_tap_dance_action_on_reset (qk_tap_dance_action_t *action) | 51 | static inline void process_tap_dance_action_on_reset (qk_tap_dance_action_t *action) |
| 50 | { | 52 | { |
| 51 | _process_tap_dance_action_fn (&action->state, action->user_data, action->fn.on_reset); | 53 | _process_tap_dance_action_fn (&action->state, action->user_data, action->fn.on_reset); |
| 54 | del_mods(action->state.oneshot_mods); | ||
| 55 | send_keyboard_report(); | ||
| 52 | } | 56 | } |
| 53 | 57 | ||
| 54 | bool process_tap_dance(uint16_t keycode, keyrecord_t *record) { | 58 | bool process_tap_dance(uint16_t keycode, keyrecord_t *record) { |
| @@ -70,6 +74,7 @@ bool process_tap_dance(uint16_t keycode, keyrecord_t *record) { | |||
| 70 | action->state.keycode = keycode; | 74 | action->state.keycode = keycode; |
| 71 | action->state.count++; | 75 | action->state.count++; |
| 72 | action->state.timer = timer_read(); | 76 | action->state.timer = timer_read(); |
| 77 | action->state.oneshot_mods = get_oneshot_mods(); | ||
| 73 | process_tap_dance_action_on_each_tap (action); | 78 | process_tap_dance_action_on_each_tap (action); |
| 74 | 79 | ||
| 75 | if (last_td && last_td != keycode) { | 80 | if (last_td && last_td != keycode) { |
| @@ -109,7 +114,7 @@ void matrix_scan_tap_dance () { | |||
| 109 | if (highest_td == -1) | 114 | if (highest_td == -1) |
| 110 | return; | 115 | return; |
| 111 | 116 | ||
| 112 | for (int i = 0; i <= highest_td; i++) { | 117 | for (int i = 0; i <= highest_td; i++) { |
| 113 | qk_tap_dance_action_t *action = &tap_dance_actions[i]; | 118 | qk_tap_dance_action_t *action = &tap_dance_actions[i]; |
| 114 | 119 | ||
| 115 | if (action->state.count && timer_elapsed (action->state.timer) > TAPPING_TERM) { | 120 | if (action->state.count && timer_elapsed (action->state.timer) > TAPPING_TERM) { |
diff --git a/quantum/process_keycode/process_tap_dance.h b/quantum/process_keycode/process_tap_dance.h index f753cbba6..726752ecc 100644 --- a/quantum/process_keycode/process_tap_dance.h +++ b/quantum/process_keycode/process_tap_dance.h | |||
| @@ -9,6 +9,7 @@ | |||
| 9 | typedef struct | 9 | typedef struct |
| 10 | { | 10 | { |
| 11 | uint8_t count; | 11 | uint8_t count; |
| 12 | uint8_t oneshot_mods; | ||
| 12 | uint16_t keycode; | 13 | uint16_t keycode; |
| 13 | uint16_t timer; | 14 | uint16_t timer; |
| 14 | bool interrupted; | 15 | bool interrupted; |
diff --git a/quantum/process_keycode/process_unicode.c b/quantum/process_keycode/process_unicode.c index a30e93ae3..9d01a592d 100644 --- a/quantum/process_keycode/process_unicode.c +++ b/quantum/process_keycode/process_unicode.c | |||
| @@ -139,9 +139,18 @@ void unicode_map_input_error() {} | |||
| 139 | bool process_unicode_map(uint16_t keycode, keyrecord_t *record) { | 139 | bool process_unicode_map(uint16_t keycode, keyrecord_t *record) { |
| 140 | if ((keycode & QK_UNICODE_MAP) == QK_UNICODE_MAP && record->event.pressed) { | 140 | if ((keycode & QK_UNICODE_MAP) == QK_UNICODE_MAP && record->event.pressed) { |
| 141 | const uint32_t* map = unicode_map; | 141 | const uint32_t* map = unicode_map; |
| 142 | uint16_t index = keycode & 0x7FF; | 142 | uint16_t index = keycode - QK_UNICODE_MAP; |
| 143 | uint32_t code = pgm_read_dword_far(&map[index]); | 143 | uint32_t code = pgm_read_dword_far(&map[index]); |
| 144 | if ((code > 0xFFFF && input_mode == UC_OSX) || (code > 0xFFFFF && input_mode == UC_LNX)) { | 144 | if (code > 0xFFFF && code <= 0x10ffff && input_mode == UC_OSX) { |
| 145 | // Convert to UTF-16 surrogate pair | ||
| 146 | code -= 0x10000; | ||
| 147 | uint32_t lo = code & 0x3ff; | ||
| 148 | uint32_t hi = (code & 0xffc00) >> 10; | ||
| 149 | unicode_input_start(); | ||
| 150 | register_hex32(hi + 0xd800); | ||
| 151 | register_hex32(lo + 0xdc00); | ||
| 152 | unicode_input_finish(); | ||
| 153 | } else if ((code > 0x10ffff && input_mode == UC_OSX) || (code > 0xFFFFF && input_mode == UC_LNX)) { | ||
| 145 | // when character is out of range supported by the OS | 154 | // when character is out of range supported by the OS |
| 146 | unicode_map_input_error(); | 155 | unicode_map_input_error(); |
| 147 | } else { | 156 | } else { |
diff --git a/quantum/quantum.c b/quantum/quantum.c index 63ffe2074..45ea8cb73 100644 --- a/quantum/quantum.c +++ b/quantum/quantum.c | |||
| @@ -1,4 +1,7 @@ | |||
| 1 | #include "quantum.h" | 1 | #include "quantum.h" |
| 2 | #ifdef PROTOCOL_LUFA | ||
| 3 | #include "outputselect.h" | ||
| 4 | #endif | ||
| 2 | 5 | ||
| 3 | #ifndef TAPPING_TERM | 6 | #ifndef TAPPING_TERM |
| 4 | #define TAPPING_TERM 200 | 7 | #define TAPPING_TERM 200 |
| @@ -33,14 +36,42 @@ static void do_code16 (uint16_t code, void (*f) (uint8_t)) { | |||
| 33 | f(KC_RGUI); | 36 | f(KC_RGUI); |
| 34 | } | 37 | } |
| 35 | 38 | ||
| 39 | static inline void qk_register_weak_mods(uint8_t kc) { | ||
| 40 | add_weak_mods(MOD_BIT(kc)); | ||
| 41 | send_keyboard_report(); | ||
| 42 | } | ||
| 43 | |||
| 44 | static inline void qk_unregister_weak_mods(uint8_t kc) { | ||
| 45 | del_weak_mods(MOD_BIT(kc)); | ||
| 46 | send_keyboard_report(); | ||
| 47 | } | ||
| 48 | |||
| 49 | static inline void qk_register_mods(uint8_t kc) { | ||
| 50 | add_weak_mods(MOD_BIT(kc)); | ||
| 51 | send_keyboard_report(); | ||
| 52 | } | ||
| 53 | |||
| 54 | static inline void qk_unregister_mods(uint8_t kc) { | ||
| 55 | del_weak_mods(MOD_BIT(kc)); | ||
| 56 | send_keyboard_report(); | ||
| 57 | } | ||
| 58 | |||
| 36 | void register_code16 (uint16_t code) { | 59 | void register_code16 (uint16_t code) { |
| 37 | do_code16 (code, register_code); | 60 | if (IS_MOD(code) || code == KC_NO) { |
| 61 | do_code16 (code, qk_register_mods); | ||
| 62 | } else { | ||
| 63 | do_code16 (code, qk_register_weak_mods); | ||
| 64 | } | ||
| 38 | register_code (code); | 65 | register_code (code); |
| 39 | } | 66 | } |
| 40 | 67 | ||
| 41 | void unregister_code16 (uint16_t code) { | 68 | void unregister_code16 (uint16_t code) { |
| 42 | unregister_code (code); | 69 | unregister_code (code); |
| 43 | do_code16 (code, unregister_code); | 70 | if (IS_MOD(code) || code == KC_NO) { |
| 71 | do_code16 (code, qk_unregister_mods); | ||
| 72 | } else { | ||
| 73 | do_code16 (code, qk_unregister_weak_mods); | ||
| 74 | } | ||
| 44 | } | 75 | } |
| 45 | 76 | ||
| 46 | __attribute__ ((weak)) | 77 | __attribute__ ((weak)) |
| @@ -130,6 +161,9 @@ bool process_record_quantum(keyrecord_t *record) { | |||
| 130 | #ifndef DISABLE_CHORDING | 161 | #ifndef DISABLE_CHORDING |
| 131 | process_chording(keycode, record) && | 162 | process_chording(keycode, record) && |
| 132 | #endif | 163 | #endif |
| 164 | #ifdef COMBO_ENABLE | ||
| 165 | process_combo(keycode, record) && | ||
| 166 | #endif | ||
| 133 | #ifdef UNICODE_ENABLE | 167 | #ifdef UNICODE_ENABLE |
| 134 | process_unicode(keycode, record) && | 168 | process_unicode(keycode, record) && |
| 135 | #endif | 169 | #endif |
| @@ -212,6 +246,36 @@ bool process_record_quantum(keyrecord_t *record) { | |||
| 212 | return false; | 246 | return false; |
| 213 | break; | 247 | break; |
| 214 | #endif | 248 | #endif |
| 249 | #ifdef PROTOCOL_LUFA | ||
| 250 | case OUT_AUTO: | ||
| 251 | if (record->event.pressed) { | ||
| 252 | set_output(OUTPUT_AUTO); | ||
| 253 | } | ||
| 254 | return false; | ||
| 255 | break; | ||
| 256 | case OUT_USB: | ||
| 257 | if (record->event.pressed) { | ||
| 258 | set_output(OUTPUT_USB); | ||
| 259 | } | ||
| 260 | return false; | ||
| 261 | break; | ||
| 262 | #ifdef BLUETOOTH_ENABLE | ||
| 263 | case OUT_BT: | ||
| 264 | if (record->event.pressed) { | ||
| 265 | set_output(OUTPUT_BLUETOOTH); | ||
| 266 | } | ||
| 267 | return false; | ||
| 268 | break; | ||
| 269 | #endif | ||
| 270 | #ifdef ADAFRUIT_BLE_ENABLE | ||
| 271 | case OUT_BLE: | ||
| 272 | if (record->event.pressed) { | ||
| 273 | set_output(OUTPUT_ADAFRUIT_BLE); | ||
| 274 | } | ||
| 275 | return false; | ||
| 276 | break; | ||
| 277 | #endif | ||
| 278 | #endif | ||
| 215 | case MAGIC_SWAP_CONTROL_CAPSLOCK ... MAGIC_TOGGLE_NKRO: | 279 | case MAGIC_SWAP_CONTROL_CAPSLOCK ... MAGIC_TOGGLE_NKRO: |
| 216 | if (record->event.pressed) { | 280 | if (record->event.pressed) { |
| 217 | // MAGIC actions (BOOTMAGIC without the boot) | 281 | // MAGIC actions (BOOTMAGIC without the boot) |
| @@ -508,6 +572,11 @@ void matrix_scan_quantum() { | |||
| 508 | #ifdef TAP_DANCE_ENABLE | 572 | #ifdef TAP_DANCE_ENABLE |
| 509 | matrix_scan_tap_dance(); | 573 | matrix_scan_tap_dance(); |
| 510 | #endif | 574 | #endif |
| 575 | |||
| 576 | #ifdef COMBO_ENABLE | ||
| 577 | matrix_scan_combo(); | ||
| 578 | #endif | ||
| 579 | |||
| 511 | matrix_scan_kb(); | 580 | matrix_scan_kb(); |
| 512 | } | 581 | } |
| 513 | 582 | ||
| @@ -525,34 +594,45 @@ static const uint8_t backlight_pin = BACKLIGHT_PIN; | |||
| 525 | # define COM1x1 COM1A1 | 594 | # define COM1x1 COM1A1 |
| 526 | # define OCR1x OCR1A | 595 | # define OCR1x OCR1A |
| 527 | #else | 596 | #else |
| 528 | # error "Backlight pin not supported - use B5, B6, or B7" | 597 | # define NO_BACKLIGHT_CLOCK |
| 598 | #endif | ||
| 599 | |||
| 600 | #ifndef BACKLIGHT_ON_STATE | ||
| 601 | #define BACKLIGHT_ON_STATE 0 | ||
| 529 | #endif | 602 | #endif |
| 530 | 603 | ||
| 531 | __attribute__ ((weak)) | 604 | __attribute__ ((weak)) |
| 532 | void backlight_init_ports(void) | 605 | void backlight_init_ports(void) |
| 533 | { | 606 | { |
| 534 | 607 | ||
| 535 | // Setup backlight pin as output and output low. | 608 | // Setup backlight pin as output and output to on state. |
| 536 | // DDRx |= n | 609 | // DDRx |= n |
| 537 | _SFR_IO8((backlight_pin >> 4) + 1) |= _BV(backlight_pin & 0xF); | 610 | _SFR_IO8((backlight_pin >> 4) + 1) |= _BV(backlight_pin & 0xF); |
| 538 | // PORTx &= ~n | 611 | #if BACKLIGHT_ON_STATE == 0 |
| 539 | _SFR_IO8((backlight_pin >> 4) + 2) &= ~_BV(backlight_pin & 0xF); | 612 | // PORTx &= ~n |
| 613 | _SFR_IO8((backlight_pin >> 4) + 2) &= ~_BV(backlight_pin & 0xF); | ||
| 614 | #else | ||
| 615 | // PORTx |= n | ||
| 616 | _SFR_IO8((backlight_pin >> 4) + 2) |= _BV(backlight_pin & 0xF); | ||
| 617 | #endif | ||
| 540 | 618 | ||
| 541 | // Use full 16-bit resolution. | 619 | #ifndef NO_BACKLIGHT_CLOCK |
| 542 | ICR1 = 0xFFFF; | 620 | // Use full 16-bit resolution. |
| 621 | ICR1 = 0xFFFF; | ||
| 543 | 622 | ||
| 544 | // I could write a wall of text here to explain... but TL;DW | 623 | // I could write a wall of text here to explain... but TL;DW |
| 545 | // Go read the ATmega32u4 datasheet. | 624 | // Go read the ATmega32u4 datasheet. |
| 546 | // And this: http://blog.saikoled.com/post/43165849837/secret-konami-cheat-code-to-high-resolution-pwm-on | 625 | // And this: http://blog.saikoled.com/post/43165849837/secret-konami-cheat-code-to-high-resolution-pwm-on |
| 547 | 626 | ||
| 548 | // Pin PB7 = OCR1C (Timer 1, Channel C) | 627 | // Pin PB7 = OCR1C (Timer 1, Channel C) |
| 549 | // Compare Output Mode = Clear on compare match, Channel C = COM1C1=1 COM1C0=0 | 628 | // Compare Output Mode = Clear on compare match, Channel C = COM1C1=1 COM1C0=0 |
| 550 | // (i.e. start high, go low when counter matches.) | 629 | // (i.e. start high, go low when counter matches.) |
| 551 | // WGM Mode 14 (Fast PWM) = WGM13=1 WGM12=1 WGM11=1 WGM10=0 | 630 | // WGM Mode 14 (Fast PWM) = WGM13=1 WGM12=1 WGM11=1 WGM10=0 |
| 552 | // Clock Select = clk/1 (no prescaling) = CS12=0 CS11=0 CS10=1 | 631 | // Clock Select = clk/1 (no prescaling) = CS12=0 CS11=0 CS10=1 |
| 553 | 632 | ||
| 554 | TCCR1A = _BV(COM1x1) | _BV(WGM11); // = 0b00001010; | 633 | TCCR1A = _BV(COM1x1) | _BV(WGM11); // = 0b00001010; |
| 555 | TCCR1B = _BV(WGM13) | _BV(WGM12) | _BV(CS10); // = 0b00011001; | 634 | TCCR1B = _BV(WGM13) | _BV(WGM12) | _BV(CS10); // = 0b00011001; |
| 635 | #endif | ||
| 556 | 636 | ||
| 557 | backlight_init(); | 637 | backlight_init(); |
| 558 | #ifdef BACKLIGHT_BREATHING | 638 | #ifdef BACKLIGHT_BREATHING |
| @@ -564,24 +644,43 @@ __attribute__ ((weak)) | |||
| 564 | void backlight_set(uint8_t level) | 644 | void backlight_set(uint8_t level) |
| 565 | { | 645 | { |
| 566 | // Prevent backlight blink on lowest level | 646 | // Prevent backlight blink on lowest level |
| 567 | // PORTx &= ~n | 647 | #if BACKLIGHT_ON_STATE == 0 |
| 568 | _SFR_IO8((backlight_pin >> 4) + 2) &= ~_BV(backlight_pin & 0xF); | 648 | // PORTx &= ~n |
| 649 | _SFR_IO8((backlight_pin >> 4) + 2) &= ~_BV(backlight_pin & 0xF); | ||
| 650 | #else | ||
| 651 | // PORTx |= n | ||
| 652 | _SFR_IO8((backlight_pin >> 4) + 2) |= _BV(backlight_pin & 0xF); | ||
| 653 | #endif | ||
| 569 | 654 | ||
| 570 | if ( level == 0 ) { | 655 | if ( level == 0 ) { |
| 571 | // Turn off PWM control on backlight pin, revert to output low. | 656 | #ifndef NO_BACKLIGHT_CLOCK |
| 572 | TCCR1A &= ~(_BV(COM1x1)); | 657 | // Turn off PWM control on backlight pin, revert to output low. |
| 573 | OCR1x = 0x0; | 658 | TCCR1A &= ~(_BV(COM1x1)); |
| 574 | } else if ( level == BACKLIGHT_LEVELS ) { | 659 | OCR1x = 0x0; |
| 575 | // Turn on PWM control of backlight pin | 660 | #else |
| 576 | TCCR1A |= _BV(COM1x1); | 661 | #if BACKLIGHT_ON_STATE == 0 |
| 577 | // Set the brightness | 662 | // PORTx |= n |
| 578 | OCR1x = 0xFFFF; | 663 | _SFR_IO8((backlight_pin >> 4) + 2) |= _BV(backlight_pin & 0xF); |
| 579 | } else { | 664 | #else |
| 580 | // Turn on PWM control of backlight pin | 665 | // PORTx &= ~n |
| 581 | TCCR1A |= _BV(COM1x1); | 666 | _SFR_IO8((backlight_pin >> 4) + 2) &= ~_BV(backlight_pin & 0xF); |
| 582 | // Set the brightness | 667 | #endif |
| 583 | OCR1x = 0xFFFF >> ((BACKLIGHT_LEVELS - level) * ((BACKLIGHT_LEVELS + 1) / 2)); | 668 | #endif |
| 584 | } | 669 | } |
| 670 | #ifndef NO_BACKLIGHT_CLOCK | ||
| 671 | else if ( level == BACKLIGHT_LEVELS ) { | ||
| 672 | // Turn on PWM control of backlight pin | ||
| 673 | TCCR1A |= _BV(COM1x1); | ||
| 674 | // Set the brightness | ||
| 675 | OCR1x = 0xFFFF; | ||
| 676 | } | ||
| 677 | else { | ||
| 678 | // Turn on PWM control of backlight pin | ||
| 679 | TCCR1A |= _BV(COM1x1); | ||
| 680 | // Set the brightness | ||
| 681 | OCR1x = 0xFFFF >> ((BACKLIGHT_LEVELS - level) * ((BACKLIGHT_LEVELS + 1) / 2)); | ||
| 682 | } | ||
| 683 | #endif | ||
| 585 | 684 | ||
| 586 | #ifdef BACKLIGHT_BREATHING | 685 | #ifdef BACKLIGHT_BREATHING |
| 587 | breathing_intensity_default(); | 686 | breathing_intensity_default(); |
diff --git a/quantum/quantum.h b/quantum/quantum.h index e6adf974a..18f072189 100644 --- a/quantum/quantum.h +++ b/quantum/quantum.h | |||
| @@ -15,7 +15,6 @@ | |||
| 15 | #ifdef RGBLIGHT_ENABLE | 15 | #ifdef RGBLIGHT_ENABLE |
| 16 | #include "rgblight.h" | 16 | #include "rgblight.h" |
| 17 | #endif | 17 | #endif |
| 18 | |||
| 19 | #include "action_layer.h" | 18 | #include "action_layer.h" |
| 20 | #include "eeconfig.h" | 19 | #include "eeconfig.h" |
| 21 | #include <stddef.h> | 20 | #include <stddef.h> |
| @@ -63,6 +62,10 @@ extern uint32_t default_layer_state; | |||
| 63 | #include "process_printer.h" | 62 | #include "process_printer.h" |
| 64 | #endif | 63 | #endif |
| 65 | 64 | ||
| 65 | #ifdef COMBO_ENABLE | ||
| 66 | #include "process_combo.h" | ||
| 67 | #endif | ||
| 68 | |||
| 66 | #define SEND_STRING(str) send_string(PSTR(str)) | 69 | #define SEND_STRING(str) send_string(PSTR(str)) |
| 67 | void send_string(const char *str); | 70 | void send_string(const char *str); |
| 68 | 71 | ||
diff --git a/quantum/quantum_keycodes.h b/quantum/quantum_keycodes.h index 4853655f9..ab2e79026 100644 --- a/quantum/quantum_keycodes.h +++ b/quantum/quantum_keycodes.h | |||
| @@ -39,14 +39,14 @@ enum quantum_keycodes { | |||
| 39 | QK_CHORDING = 0x5600, | 39 | QK_CHORDING = 0x5600, |
| 40 | QK_CHORDING_MAX = 0x56FF, | 40 | QK_CHORDING_MAX = 0x56FF, |
| 41 | #endif | 41 | #endif |
| 42 | QK_MOD_TAP = 0x6000, | 42 | QK_TAP_DANCE = 0x5700, |
| 43 | QK_MOD_TAP_MAX = 0x6FFF, | 43 | QK_TAP_DANCE_MAX = 0x57FF, |
| 44 | QK_TAP_DANCE = 0x7100, | ||
| 45 | QK_TAP_DANCE_MAX = 0x71FF, | ||
| 46 | #ifdef UNICODEMAP_ENABLE | 44 | #ifdef UNICODEMAP_ENABLE |
| 47 | QK_UNICODE_MAP = 0x7800, | 45 | QK_UNICODE_MAP = 0x5800, |
| 48 | QK_UNICODE_MAP_MAX = 0x7FFF, | 46 | QK_UNICODE_MAP_MAX = 0x5BFF, |
| 49 | #endif | 47 | #endif |
| 48 | QK_MOD_TAP = 0x6000, | ||
| 49 | QK_MOD_TAP_MAX = 0x7FFF, | ||
| 50 | #ifdef UNICODE_ENABLE | 50 | #ifdef UNICODE_ENABLE |
| 51 | QK_UNICODE = 0x8000, | 51 | QK_UNICODE = 0x8000, |
| 52 | QK_UNICODE_MAX = 0xFFFF, | 52 | QK_UNICODE_MAX = 0xFFFF, |
| @@ -54,7 +54,7 @@ enum quantum_keycodes { | |||
| 54 | 54 | ||
| 55 | // Loose keycodes - to be used directly | 55 | // Loose keycodes - to be used directly |
| 56 | 56 | ||
| 57 | RESET = 0x7000, | 57 | RESET = 0x5C00, |
| 58 | DEBUG, | 58 | DEBUG, |
| 59 | MAGIC_SWAP_CONTROL_CAPSLOCK, | 59 | MAGIC_SWAP_CONTROL_CAPSLOCK, |
| 60 | MAGIC_CAPSLOCK_TO_CONTROL, | 60 | MAGIC_CAPSLOCK_TO_CONTROL, |
| @@ -141,6 +141,16 @@ enum quantum_keycodes { | |||
| 141 | PRINT_ON, | 141 | PRINT_ON, |
| 142 | PRINT_OFF, | 142 | PRINT_OFF, |
| 143 | 143 | ||
| 144 | // output selection | ||
| 145 | OUT_AUTO, | ||
| 146 | OUT_USB, | ||
| 147 | #ifdef BLUETOOTH_ENABLE | ||
| 148 | OUT_BT, | ||
| 149 | #endif | ||
| 150 | #ifdef ADAFRUIT_BLE_ENABLE | ||
| 151 | OUT_BLE, | ||
| 152 | #endif | ||
| 153 | |||
| 144 | // always leave at the end | 154 | // always leave at the end |
| 145 | SAFE_RANGE | 155 | SAFE_RANGE |
| 146 | }; | 156 | }; |
| @@ -246,8 +256,10 @@ enum quantum_keycodes { | |||
| 246 | 256 | ||
| 247 | #define M(kc) (kc | QK_MACRO) | 257 | #define M(kc) (kc | QK_MACRO) |
| 248 | 258 | ||
| 259 | #define MACROTAP(kc) (kc | QK_MACRO | FUNC_TAP<<8) | ||
| 249 | #define MACRODOWN(...) (record->event.pressed ? MACRO(__VA_ARGS__) : MACRO_NONE) | 260 | #define MACRODOWN(...) (record->event.pressed ? MACRO(__VA_ARGS__) : MACRO_NONE) |
| 250 | 261 | ||
| 262 | |||
| 251 | // L-ayer, T-ap - 256 keycode max, 16 layer max | 263 | // L-ayer, T-ap - 256 keycode max, 16 layer max |
| 252 | #define LT(layer, kc) (kc | QK_LAYER_TAP | ((layer & 0xF) << 8)) | 264 | #define LT(layer, kc) (kc | QK_LAYER_TAP | ((layer & 0xF) << 8)) |
| 253 | 265 | ||
| @@ -286,14 +298,29 @@ enum quantum_keycodes { | |||
| 286 | #define OSM(mod) (mod | QK_ONE_SHOT_MOD) | 298 | #define OSM(mod) (mod | QK_ONE_SHOT_MOD) |
| 287 | 299 | ||
| 288 | // M-od, T-ap - 256 keycode max | 300 | // M-od, T-ap - 256 keycode max |
| 289 | #define MT(mod, kc) (kc | QK_MOD_TAP | ((mod & 0xF) << 8)) | 301 | #define MT(mod, kc) (kc | QK_MOD_TAP | ((mod & 0x1F) << 8)) |
| 302 | |||
| 290 | #define CTL_T(kc) MT(MOD_LCTL, kc) | 303 | #define CTL_T(kc) MT(MOD_LCTL, kc) |
| 304 | #define LCTL_T(kc) MT(MOD_LCTL, kc) | ||
| 305 | #define RCTL_T(kc) MT(MOD_RCTL, kc) | ||
| 306 | |||
| 291 | #define SFT_T(kc) MT(MOD_LSFT, kc) | 307 | #define SFT_T(kc) MT(MOD_LSFT, kc) |
| 308 | #define LSFT_T(kc) MT(MOD_LSFT, kc) | ||
| 309 | #define RSFT_T(kc) MT(MOD_RSFT, kc) | ||
| 310 | |||
| 292 | #define ALT_T(kc) MT(MOD_LALT, kc) | 311 | #define ALT_T(kc) MT(MOD_LALT, kc) |
| 312 | #define LALT_T(kc) MT(MOD_LALT, kc) | ||
| 313 | #define RALT_T(kc) MT(MOD_RALT, kc) | ||
| 314 | #define ALGR_T(kc) MT(MOD_RALT, kc) // dual-function AltGR | ||
| 315 | |||
| 293 | #define GUI_T(kc) MT(MOD_LGUI, kc) | 316 | #define GUI_T(kc) MT(MOD_LGUI, kc) |
| 317 | #define LGUI_T(kc) MT(MOD_LGUI, kc) | ||
| 318 | #define RGUI_T(kc) MT(MOD_RGUI, kc) | ||
| 319 | |||
| 294 | #define C_S_T(kc) MT((MOD_LCTL | MOD_LSFT), kc) // Control + Shift e.g. for gnome-terminal | 320 | #define C_S_T(kc) MT((MOD_LCTL | MOD_LSFT), kc) // Control + Shift e.g. for gnome-terminal |
| 295 | #define MEH_T(kc) MT((MOD_LCTL | MOD_LSFT | MOD_LALT), kc) // Meh is a less hyper version of the Hyper key -- doesn't include Win or Cmd, so just alt+shift+ctrl | 321 | #define MEH_T(kc) MT((MOD_LCTL | MOD_LSFT | MOD_LALT), kc) // Meh is a less hyper version of the Hyper key -- doesn't include Win or Cmd, so just alt+shift+ctrl |
| 296 | #define LCAG_T(kc) MT((MOD_LCTL | MOD_LALT | MOD_LGUI), kc) // Left control alt and gui | 322 | #define LCAG_T(kc) MT((MOD_LCTL | MOD_LALT | MOD_LGUI), kc) // Left control alt and gui |
| 323 | #define RCAG_T(kc) MT((MOD_RCTL | MOD_RALT | MOD_RGUI), kc) // Right control alt and gui | ||
| 297 | #define ALL_T(kc) MT((MOD_LCTL | MOD_LSFT | MOD_LALT | MOD_LGUI), kc) // see http://brettterpstra.com/2012/12/08/a-useful-caps-lock-key/ | 324 | #define ALL_T(kc) MT((MOD_LCTL | MOD_LSFT | MOD_LALT | MOD_LGUI), kc) // see http://brettterpstra.com/2012/12/08/a-useful-caps-lock-key/ |
| 298 | #define SCMD_T(kc) MT((MOD_LGUI | MOD_LSFT), kc) | 325 | #define SCMD_T(kc) MT((MOD_LGUI | MOD_LSFT), kc) |
| 299 | #define SWIN_T(kc) SCMD_T(kc) | 326 | #define SWIN_T(kc) SCMD_T(kc) |
diff --git a/quantum/rgblight.c b/quantum/rgblight.c index 52a09817a..dd1b91c63 100644 --- a/quantum/rgblight.c +++ b/quantum/rgblight.c | |||
| @@ -66,6 +66,8 @@ __attribute__ ((weak)) | |||
| 66 | const uint8_t RGBLED_SNAKE_INTERVALS[] PROGMEM = {100, 50, 20}; | 66 | const uint8_t RGBLED_SNAKE_INTERVALS[] PROGMEM = {100, 50, 20}; |
| 67 | __attribute__ ((weak)) | 67 | __attribute__ ((weak)) |
| 68 | const uint8_t RGBLED_KNIGHT_INTERVALS[] PROGMEM = {100, 50, 20}; | 68 | const uint8_t RGBLED_KNIGHT_INTERVALS[] PROGMEM = {100, 50, 20}; |
| 69 | __attribute__ ((weak)) | ||
| 70 | const uint16_t RGBLED_GRADIENT_RANGES[] PROGMEM = {360, 240, 180, 120, 90}; | ||
| 69 | 71 | ||
| 70 | rgblight_config_t rgblight_config; | 72 | rgblight_config_t rgblight_config; |
| 71 | rgblight_config_t inmem_config; | 73 | rgblight_config_t inmem_config; |
| @@ -219,6 +221,14 @@ void rgblight_step(void) { | |||
| 219 | } | 221 | } |
| 220 | rgblight_mode(mode); | 222 | rgblight_mode(mode); |
| 221 | } | 223 | } |
| 224 | void rgblight_step_reverse(void) { | ||
| 225 | uint8_t mode = 0; | ||
| 226 | mode = rgblight_config.mode - 1; | ||
| 227 | if (mode < 1) { | ||
| 228 | mode = RGBLIGHT_MODES; | ||
| 229 | } | ||
| 230 | rgblight_mode(mode); | ||
| 231 | } | ||
| 222 | 232 | ||
| 223 | void rgblight_mode(uint8_t mode) { | 233 | void rgblight_mode(uint8_t mode) { |
| 224 | if (!rgblight_config.enable) { | 234 | if (!rgblight_config.enable) { |
| @@ -237,7 +247,7 @@ void rgblight_mode(uint8_t mode) { | |||
| 237 | #ifdef RGBLIGHT_ANIMATIONS | 247 | #ifdef RGBLIGHT_ANIMATIONS |
| 238 | rgblight_timer_disable(); | 248 | rgblight_timer_disable(); |
| 239 | #endif | 249 | #endif |
| 240 | } else if (rgblight_config.mode >= 2 && rgblight_config.mode <= 23) { | 250 | } else if (rgblight_config.mode >= 2 && rgblight_config.mode <= 24) { |
| 241 | // MODE 2-5, breathing | 251 | // MODE 2-5, breathing |
| 242 | // MODE 6-8, rainbow mood | 252 | // MODE 6-8, rainbow mood |
| 243 | // MODE 9-14, rainbow swirl | 253 | // MODE 9-14, rainbow swirl |
| @@ -247,6 +257,12 @@ void rgblight_mode(uint8_t mode) { | |||
| 247 | #ifdef RGBLIGHT_ANIMATIONS | 257 | #ifdef RGBLIGHT_ANIMATIONS |
| 248 | rgblight_timer_enable(); | 258 | rgblight_timer_enable(); |
| 249 | #endif | 259 | #endif |
| 260 | } else if (rgblight_config.mode >= 25 && rgblight_config.mode <= 34) { | ||
| 261 | // MODE 25-34, static gradient | ||
| 262 | |||
| 263 | #ifdef RGBLIGHT_ANIMATIONS | ||
| 264 | rgblight_timer_disable(); | ||
| 265 | #endif | ||
| 250 | } | 266 | } |
| 251 | rgblight_sethsv(rgblight_config.hue, rgblight_config.sat, rgblight_config.val); | 267 | rgblight_sethsv(rgblight_config.hue, rgblight_config.sat, rgblight_config.val); |
| 252 | } | 268 | } |
| @@ -350,6 +366,17 @@ void rgblight_sethsv(uint16_t hue, uint8_t sat, uint8_t val) { | |||
| 350 | } else if (rgblight_config.mode >= 6 && rgblight_config.mode <= 14) { | 366 | } else if (rgblight_config.mode >= 6 && rgblight_config.mode <= 14) { |
| 351 | // rainbow mood and rainbow swirl, ignore the change of hue | 367 | // rainbow mood and rainbow swirl, ignore the change of hue |
| 352 | hue = rgblight_config.hue; | 368 | hue = rgblight_config.hue; |
| 369 | } else if (rgblight_config.mode >= 25 && rgblight_config.mode <= 34) { | ||
| 370 | // static gradient | ||
| 371 | uint16_t _hue; | ||
| 372 | int8_t direction = ((rgblight_config.mode - 25) % 2) ? -1 : 1; | ||
| 373 | uint16_t range = pgm_read_word(&RGBLED_GRADIENT_RANGES[(rgblight_config.mode - 25) / 2]); | ||
| 374 | for (uint8_t i = 0; i < RGBLED_NUM; i++) { | ||
| 375 | _hue = (range / RGBLED_NUM * i * direction + hue + 360) % 360; | ||
| 376 | dprintf("rgblight rainbow set hsv: %u,%u,%d,%u\n", i, _hue, direction, range); | ||
| 377 | sethsv(_hue, sat, val, (LED_TYPE *)&led[i]); | ||
| 378 | } | ||
| 379 | rgblight_set(); | ||
| 353 | } | 380 | } |
| 354 | } | 381 | } |
| 355 | rgblight_config.hue = hue; | 382 | rgblight_config.hue = hue; |
| @@ -450,7 +477,7 @@ void rgblight_task(void) { | |||
| 450 | } else if (rgblight_config.mode >= 21 && rgblight_config.mode <= 23) { | 477 | } else if (rgblight_config.mode >= 21 && rgblight_config.mode <= 23) { |
| 451 | // mode = 21 to 23, knight mode | 478 | // mode = 21 to 23, knight mode |
| 452 | rgblight_effect_knight(rgblight_config.mode - 21); | 479 | rgblight_effect_knight(rgblight_config.mode - 21); |
| 453 | } else { | 480 | } else if (rgblight_config.mode == 24) { |
| 454 | // mode = 24, christmas mode | 481 | // mode = 24, christmas mode |
| 455 | rgblight_effect_christmas(); | 482 | rgblight_effect_christmas(); |
| 456 | } | 483 | } |
| @@ -604,13 +631,13 @@ void rgblight_effect_christmas(void) { | |||
| 604 | static uint16_t last_timer = 0; | 631 | static uint16_t last_timer = 0; |
| 605 | uint16_t hue; | 632 | uint16_t hue; |
| 606 | uint8_t i; | 633 | uint8_t i; |
| 607 | if (timer_elapsed(last_timer) < 1000) { | 634 | if (timer_elapsed(last_timer) < RGBLIGHT_EFFECT_CHRISTMAS_INTERVAL) { |
| 608 | return; | 635 | return; |
| 609 | } | 636 | } |
| 610 | last_timer = timer_read(); | 637 | last_timer = timer_read(); |
| 611 | current_offset = (current_offset + 1) % 2; | 638 | current_offset = (current_offset + 1) % 2; |
| 612 | for (i = 0; i < RGBLED_NUM; i++) { | 639 | for (i = 0; i < RGBLED_NUM; i++) { |
| 613 | hue = 0 + ((RGBLED_NUM * (i + current_offset)) % 2) * 80; | 640 | hue = 0 + ((i/RGBLIGHT_EFFECT_CHRISTMAS_STEP + current_offset) % 2) * 120; |
| 614 | sethsv(hue, rgblight_config.sat, rgblight_config.val, (LED_TYPE *)&led[i]); | 641 | sethsv(hue, rgblight_config.sat, rgblight_config.val, (LED_TYPE *)&led[i]); |
| 615 | } | 642 | } |
| 616 | rgblight_set(); | 643 | rgblight_set(); |
diff --git a/quantum/rgblight.h b/quantum/rgblight.h index 726b8de72..2b3e791bf 100644 --- a/quantum/rgblight.h +++ b/quantum/rgblight.h | |||
| @@ -2,7 +2,7 @@ | |||
| 2 | #define RGBLIGHT_H | 2 | #define RGBLIGHT_H |
| 3 | 3 | ||
| 4 | #ifdef RGBLIGHT_ANIMATIONS | 4 | #ifdef RGBLIGHT_ANIMATIONS |
| 5 | #define RGBLIGHT_MODES 24 | 5 | #define RGBLIGHT_MODES 34 |
| 6 | #else | 6 | #else |
| 7 | #define RGBLIGHT_MODES 1 | 7 | #define RGBLIGHT_MODES 1 |
| 8 | #endif | 8 | #endif |
| @@ -22,6 +22,14 @@ | |||
| 22 | #define RGBLIGHT_EFFECT_DUALKNIGHT_LENGTH 4 | 22 | #define RGBLIGHT_EFFECT_DUALKNIGHT_LENGTH 4 |
| 23 | #endif | 23 | #endif |
| 24 | 24 | ||
| 25 | #ifndef RGBLIGHT_EFFECT_CHRISTMAS_INTERVAL | ||
| 26 | #define RGBLIGHT_EFFECT_CHRISTMAS_INTERVAL 1000 | ||
| 27 | #endif | ||
| 28 | |||
| 29 | #ifndef RGBLIGHT_EFFECT_CHRISTMAS_STEP | ||
| 30 | #define RGBLIGHT_EFFECT_CHRISTMAS_STEP 2 | ||
| 31 | #endif | ||
| 32 | |||
| 25 | #ifndef RGBLIGHT_HUE_STEP | 33 | #ifndef RGBLIGHT_HUE_STEP |
| 26 | #define RGBLIGHT_HUE_STEP 10 | 34 | #define RGBLIGHT_HUE_STEP 10 |
| 27 | #endif | 35 | #endif |
| @@ -65,6 +73,7 @@ void rgblight_decrease(void); | |||
| 65 | void rgblight_toggle(void); | 73 | void rgblight_toggle(void); |
| 66 | void rgblight_enable(void); | 74 | void rgblight_enable(void); |
| 67 | void rgblight_step(void); | 75 | void rgblight_step(void); |
| 76 | void rgblight_step_reverse(void); | ||
| 68 | void rgblight_mode(uint8_t mode); | 77 | void rgblight_mode(uint8_t mode); |
| 69 | void rgblight_set(void); | 78 | void rgblight_set(void); |
| 70 | void rgblight_update_dword(uint32_t dword); | 79 | void rgblight_update_dword(uint32_t dword); |
diff --git a/quantum/template/config.h b/quantum/template/config.h index b02f0c7eb..c61c4a618 100644 --- a/quantum/template/config.h +++ b/quantum/template/config.h | |||
| @@ -46,7 +46,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. | |||
| 46 | #define MATRIX_COL_PINS { F1, F0, B0 } | 46 | #define MATRIX_COL_PINS { F1, F0, B0 } |
| 47 | #define UNUSED_PINS | 47 | #define UNUSED_PINS |
| 48 | 48 | ||
| 49 | /* COL2ROW or ROW2COL */ | 49 | /* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ |
| 50 | #define DIODE_DIRECTION COL2ROW | 50 | #define DIODE_DIRECTION COL2ROW |
| 51 | 51 | ||
| 52 | // #define BACKLIGHT_PIN B7 | 52 | // #define BACKLIGHT_PIN B7 |
diff --git a/quantum/visualizer/visualizer.c b/quantum/visualizer/visualizer.c index 54f6faaa4..5826d909e 100644 --- a/quantum/visualizer/visualizer.c +++ b/quantum/visualizer/visualizer.c | |||
| @@ -53,10 +53,13 @@ SOFTWARE. | |||
| 53 | #define "Visualizer thread priority not defined" | 53 | #define "Visualizer thread priority not defined" |
| 54 | #endif | 54 | #endif |
| 55 | 55 | ||
| 56 | // mods status | ||
| 57 | #include "action_util.h" | ||
| 56 | 58 | ||
| 57 | static visualizer_keyboard_status_t current_status = { | 59 | static visualizer_keyboard_status_t current_status = { |
| 58 | .layer = 0xFFFFFFFF, | 60 | .layer = 0xFFFFFFFF, |
| 59 | .default_layer = 0xFFFFFFFF, | 61 | .default_layer = 0xFFFFFFFF, |
| 62 | .mods = 0xFF, | ||
| 60 | .leds = 0xFFFFFFFF, | 63 | .leds = 0xFFFFFFFF, |
| 61 | .suspended = false, | 64 | .suspended = false, |
| 62 | }; | 65 | }; |
| @@ -64,6 +67,7 @@ static visualizer_keyboard_status_t current_status = { | |||
| 64 | static bool same_status(visualizer_keyboard_status_t* status1, visualizer_keyboard_status_t* status2) { | 67 | static bool same_status(visualizer_keyboard_status_t* status1, visualizer_keyboard_status_t* status2) { |
| 65 | return status1->layer == status2->layer && | 68 | return status1->layer == status2->layer && |
| 66 | status1->default_layer == status2->default_layer && | 69 | status1->default_layer == status2->default_layer && |
| 70 | status1->mods == status2->mods && | ||
| 67 | status1->leds == status2->leds && | 71 | status1->leds == status2->leds && |
| 68 | status1->suspended == status2->suspended; | 72 | status1->suspended == status2->suspended; |
| 69 | } | 73 | } |
| @@ -307,6 +311,45 @@ bool keyframe_display_layer_bitmap(keyframe_animation_t* animation, visualizer_s | |||
| 307 | gdispFlush(); | 311 | gdispFlush(); |
| 308 | return false; | 312 | return false; |
| 309 | } | 313 | } |
| 314 | |||
| 315 | static void format_mods_bitmap_string(uint8_t mods, char* buffer) { | ||
| 316 | *buffer = ' '; | ||
| 317 | ++buffer; | ||
| 318 | |||
| 319 | for (int i = 0; i<8; i++) | ||
| 320 | { | ||
| 321 | uint32_t mask = (1u << i); | ||
| 322 | if (mods & mask) { | ||
| 323 | *buffer = '1'; | ||
| 324 | } else { | ||
| 325 | *buffer = '0'; | ||
| 326 | } | ||
| 327 | ++buffer; | ||
| 328 | |||
| 329 | if (i==3) { | ||
| 330 | *buffer = ' '; | ||
| 331 | ++buffer; | ||
| 332 | } | ||
| 333 | } | ||
| 334 | *buffer = 0; | ||
| 335 | } | ||
| 336 | |||
| 337 | bool keyframe_display_mods_bitmap(keyframe_animation_t* animation, visualizer_state_t* state) { | ||
| 338 | (void)animation; | ||
| 339 | |||
| 340 | const char* title = "Modifier states"; | ||
| 341 | const char* mods_header = " CSAG CSAG "; | ||
| 342 | char status_buffer[12]; | ||
| 343 | |||
| 344 | gdispClear(White); | ||
| 345 | gdispDrawString(0, 0, title, state->font_fixed5x8, Black); | ||
| 346 | gdispDrawString(0, 10, mods_header, state->font_fixed5x8, Black); | ||
| 347 | format_mods_bitmap_string(state->status.mods, status_buffer); | ||
| 348 | gdispDrawString(0, 20, status_buffer, state->font_fixed5x8, Black); | ||
| 349 | |||
| 350 | gdispFlush(); | ||
| 351 | return false; | ||
| 352 | } | ||
| 310 | #endif // LCD_ENABLE | 353 | #endif // LCD_ENABLE |
| 311 | 354 | ||
| 312 | bool keyframe_disable_lcd_and_backlight(keyframe_animation_t* animation, visualizer_state_t* state) { | 355 | bool keyframe_disable_lcd_and_backlight(keyframe_animation_t* animation, visualizer_state_t* state) { |
| @@ -350,6 +393,7 @@ static DECLARE_THREAD_FUNCTION(visualizerThread, arg) { | |||
| 350 | visualizer_keyboard_status_t initial_status = { | 393 | visualizer_keyboard_status_t initial_status = { |
| 351 | .default_layer = 0xFFFFFFFF, | 394 | .default_layer = 0xFFFFFFFF, |
| 352 | .layer = 0xFFFFFFFF, | 395 | .layer = 0xFFFFFFFF, |
| 396 | .mods = 0xFF, | ||
| 353 | .leds = 0xFFFFFFFF, | 397 | .leds = 0xFFFFFFFF, |
| 354 | .suspended = false, | 398 | .suspended = false, |
| 355 | }; | 399 | }; |
| @@ -499,7 +543,18 @@ void update_status(bool changed) { | |||
| 499 | #endif | 543 | #endif |
| 500 | } | 544 | } |
| 501 | 545 | ||
| 502 | void visualizer_update(uint32_t default_state, uint32_t state, uint32_t leds) { | 546 | uint8_t visualizer_get_mods() { |
| 547 | uint8_t mods = get_mods(); | ||
| 548 | |||
| 549 | #ifndef NO_ACTION_ONESHOT | ||
| 550 | if (!has_oneshot_mods_timed_out()) { | ||
| 551 | mods |= get_oneshot_mods(); | ||
| 552 | } | ||
| 553 | #endif | ||
| 554 | return mods; | ||
| 555 | } | ||
| 556 | |||
| 557 | void visualizer_update(uint32_t default_state, uint32_t state, uint8_t mods, uint32_t leds) { | ||
| 503 | // Note that there's a small race condition here, the thread could read | 558 | // Note that there's a small race condition here, the thread could read |
| 504 | // a state where one of these are set but not the other. But this should | 559 | // a state where one of these are set but not the other. But this should |
| 505 | // not really matter as it will be fixed during the next loop step. | 560 | // not really matter as it will be fixed during the next loop step. |
| @@ -523,6 +578,7 @@ void visualizer_update(uint32_t default_state, uint32_t state, uint32_t leds) { | |||
| 523 | visualizer_keyboard_status_t new_status = { | 578 | visualizer_keyboard_status_t new_status = { |
| 524 | .layer = state, | 579 | .layer = state, |
| 525 | .default_layer = default_state, | 580 | .default_layer = default_state, |
| 581 | .mods = mods, | ||
| 526 | .leds = leds, | 582 | .leds = leds, |
| 527 | .suspended = current_status.suspended, | 583 | .suspended = current_status.suspended, |
| 528 | }; | 584 | }; |
diff --git a/quantum/visualizer/visualizer.h b/quantum/visualizer/visualizer.h index 53e250725..315af5022 100644 --- a/quantum/visualizer/visualizer.h +++ b/quantum/visualizer/visualizer.h | |||
| @@ -34,10 +34,14 @@ SOFTWARE. | |||
| 34 | #include "lcd_backlight.h" | 34 | #include "lcd_backlight.h" |
| 35 | #endif | 35 | #endif |
| 36 | 36 | ||
| 37 | // use this function to merget both real_mods and oneshot_mods in a uint16_t | ||
| 38 | uint8_t visualizer_get_mods(void); | ||
| 39 | |||
| 37 | // This need to be called once at the start | 40 | // This need to be called once at the start |
| 38 | void visualizer_init(void); | 41 | void visualizer_init(void); |
| 39 | // This should be called at every matrix scan | 42 | // This should be called at every matrix scan |
| 40 | void visualizer_update(uint32_t default_state, uint32_t state, uint32_t leds); | 43 | void visualizer_update(uint32_t default_state, uint32_t state, uint8_t mods, uint32_t leds); |
| 44 | |||
| 41 | // This should be called when the keyboard goes to suspend state | 45 | // This should be called when the keyboard goes to suspend state |
| 42 | void visualizer_suspend(void); | 46 | void visualizer_suspend(void); |
| 43 | // This should be called when the keyboard wakes up from suspend state | 47 | // This should be called when the keyboard wakes up from suspend state |
| @@ -61,6 +65,7 @@ struct keyframe_animation_t; | |||
| 61 | typedef struct { | 65 | typedef struct { |
| 62 | uint32_t layer; | 66 | uint32_t layer; |
| 63 | uint32_t default_layer; | 67 | uint32_t default_layer; |
| 68 | uint8_t mods; | ||
| 64 | uint32_t leds; // See led.h for available statuses | 69 | uint32_t leds; // See led.h for available statuses |
| 65 | bool suspended; | 70 | bool suspended; |
| 66 | } visualizer_keyboard_status_t; | 71 | } visualizer_keyboard_status_t; |
| @@ -129,6 +134,8 @@ bool keyframe_set_backlight_color(keyframe_animation_t* animation, visualizer_st | |||
| 129 | bool keyframe_display_layer_text(keyframe_animation_t* animation, visualizer_state_t* state); | 134 | bool keyframe_display_layer_text(keyframe_animation_t* animation, visualizer_state_t* state); |
| 130 | // Displays a bitmap (0/1) of all the currently active layers | 135 | // Displays a bitmap (0/1) of all the currently active layers |
| 131 | bool keyframe_display_layer_bitmap(keyframe_animation_t* animation, visualizer_state_t* state); | 136 | bool keyframe_display_layer_bitmap(keyframe_animation_t* animation, visualizer_state_t* state); |
| 137 | // Displays a bitmap (0/1) of all the currently active mods | ||
| 138 | bool keyframe_display_mods_bitmap(keyframe_animation_t* animation, visualizer_state_t* state); | ||
| 132 | 139 | ||
| 133 | bool keyframe_disable_lcd_and_backlight(keyframe_animation_t* animation, visualizer_state_t* state); | 140 | bool keyframe_disable_lcd_and_backlight(keyframe_animation_t* animation, visualizer_state_t* state); |
| 134 | bool keyframe_enable_lcd_and_backlight(keyframe_animation_t* animation, visualizer_state_t* state); | 141 | bool keyframe_enable_lcd_and_backlight(keyframe_animation_t* animation, visualizer_state_t* state); |
