Skip to content

Commit

Permalink
Drop FW Fixes for massdrop alt, ctrl, rocketeer & shift keyboards (#8)
Browse files Browse the repository at this point in the history
- In config.h of each, added '#define BOOTKEY_HOLD_MS  2000' to define hold time required to active Boot key (was 500ms hardcode)
- Updated all active keymap.c files to use this define
- Added line in quantum.c in MAGIC_TOGGLE_NKRO case to clear_keyboard() before toggling nkro state to fix stuck key issues when switching NKRO.
  • Loading branch information
just-another-jxliu authored Aug 15, 2019
1 parent 8b5e495 commit 99d89b1
Show file tree
Hide file tree
Showing 17 changed files with 25 additions and 12 deletions.
3 changes: 3 additions & 0 deletions keyboards/massdrop/alt/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */
#define DEBOUNCE 5

// Required BOOT key hold time (in ms) for restarting to bootloader -PS081419
#define BOOTKEY_HOLD_MS 2000

/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
//#define LOCKING_SUPPORT_ENABLE
/* Locking resynchronize hack */
Expand Down
2 changes: 1 addition & 1 deletion keyboards/massdrop/alt/keymaps/default/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
if (record->event.pressed) {
key_timer = timer_read32();
} else {
if (timer_elapsed32(key_timer) >= 500) {
if (timer_elapsed32(key_timer) >= BOOTKEY_HOLD_MS) {
reset_keyboard();
}
}
Expand Down
2 changes: 1 addition & 1 deletion keyboards/massdrop/alt/keymaps/default_md/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
if (record->event.pressed) {
key_timer = timer_read32();
} else {
if (timer_elapsed32(key_timer) >= 500) {
if (timer_elapsed32(key_timer) >= BOOTKEY_HOLD_MS) {
reset_keyboard();
}
}
Expand Down
2 changes: 1 addition & 1 deletion keyboards/massdrop/alt/keymaps/mac/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
if (record->event.pressed) {
key_timer = timer_read32();
} else {
if (timer_elapsed32(key_timer) >= 500) {
if (timer_elapsed32(key_timer) >= BOOTKEY_HOLD_MS) {
reset_keyboard();
}
}
Expand Down
2 changes: 1 addition & 1 deletion keyboards/massdrop/alt/keymaps/mac_md/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
if (record->event.pressed) {
key_timer = timer_read32();
} else {
if (timer_elapsed32(key_timer) >= 500) {
if (timer_elapsed32(key_timer) >= BOOTKEY_HOLD_MS) {
reset_keyboard();
}
}
Expand Down
3 changes: 3 additions & 0 deletions keyboards/massdrop/ctrl/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */
#define DEBOUNCE 5

// Required BOOT key hold time (in ms) for restarting to bootloader -PS081419
#define BOOTKEY_HOLD_MS 2000

/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
//#define LOCKING_SUPPORT_ENABLE
/* Locking resynchronize hack */
Expand Down
2 changes: 1 addition & 1 deletion keyboards/massdrop/ctrl/keymaps/default/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
if (record->event.pressed) {
key_timer = timer_read32();
} else {
if (timer_elapsed32(key_timer) >= 500) {
if (timer_elapsed32(key_timer) >= BOOTKEY_HOLD_MS) {
reset_keyboard();
}
}
Expand Down
2 changes: 1 addition & 1 deletion keyboards/massdrop/ctrl/keymaps/default_md/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
if (record->event.pressed) {
key_timer = timer_read32();
} else {
if (timer_elapsed32(key_timer) >= 500) {
if (timer_elapsed32(key_timer) >= BOOTKEY_HOLD_MS) {
reset_keyboard();
}
}
Expand Down
2 changes: 1 addition & 1 deletion keyboards/massdrop/ctrl/keymaps/mac/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
if (record->event.pressed) {
key_timer = timer_read32();
} else {
if (timer_elapsed32(key_timer) >= 500) {
if (timer_elapsed32(key_timer) >= BOOTKEY_HOLD_MS) {
reset_keyboard();
}
}
Expand Down
2 changes: 1 addition & 1 deletion keyboards/massdrop/ctrl/keymaps/mac_md/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
if (record->event.pressed) {
key_timer = timer_read32();
} else {
if (timer_elapsed32(key_timer) >= 500) {
if (timer_elapsed32(key_timer) >= BOOTKEY_HOLD_MS) {
reset_keyboard();
}
}
Expand Down
3 changes: 3 additions & 0 deletions keyboards/massdrop/rocketeer/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */
#define DEBOUNCE 5

// Required BOOT key hold time (in ms) for restarting to bootloader -PS081419
#define BOOTKEY_HOLD_MS 2000

/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
//#define LOCKING_SUPPORT_ENABLE
/* Locking resynchronize hack */
Expand Down
2 changes: 1 addition & 1 deletion keyboards/massdrop/rocketeer/keymaps/default_md/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
if (record->event.pressed) {
key_timer = timer_read32();
} else {
if (timer_elapsed32(key_timer) >= 500) {
if (timer_elapsed32(key_timer) >= BOOTKEY_HOLD_MS) {
reset_keyboard();
}
}
Expand Down
2 changes: 1 addition & 1 deletion keyboards/massdrop/rocketeer/keymaps/mac_md/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
if (record->event.pressed) {
key_timer = timer_read32();
} else {
if (timer_elapsed32(key_timer) >= 500) {
if (timer_elapsed32(key_timer) >= BOOTKEY_HOLD_MS) {
reset_keyboard();
}
}
Expand Down
3 changes: 3 additions & 0 deletions keyboards/massdrop/shift/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */
#define DEBOUNCE 5

// Required BOOT key hold time (in ms) for restarting to bootloader -PS081419
#define BOOTKEY_HOLD_MS 2000

/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
//#define LOCKING_SUPPORT_ENABLE
/* Locking resynchronize hack */
Expand Down
2 changes: 1 addition & 1 deletion keyboards/massdrop/shift/keymaps/default_md/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
if (record->event.pressed) {
key_timer = timer_read32();
} else {
if (timer_elapsed32(key_timer) >= 500) {
if (timer_elapsed32(key_timer) >= BOOTKEY_HOLD_MS) {
reset_keyboard();
}
}
Expand Down
2 changes: 1 addition & 1 deletion keyboards/massdrop/shift/keymaps/mac_md/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
if (record->event.pressed) {
key_timer = timer_read32();
} else {
if (timer_elapsed32(key_timer) >= 500) {
if (timer_elapsed32(key_timer) >= BOOTKEY_HOLD_MS) {
reset_keyboard();
}
}
Expand Down
1 change: 1 addition & 0 deletions quantum/quantum.c
Original file line number Diff line number Diff line change
Expand Up @@ -647,6 +647,7 @@ bool process_record_quantum(keyrecord_t *record) {
#endif
break;
case MAGIC_TOGGLE_NKRO:
clear_keyboard(); // clear first buffer to prevent stuck keys -PS080919
keymap_config.nkro = !keymap_config.nkro;
break;
default:
Expand Down

0 comments on commit 99d89b1

Please sign in to comment.