Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for Teensy RESET key. #160

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions keyboard/ergodox_ez/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define LOCKING_SUPPORT_ENABLE
/* Locking resynchronize hack */
#define LOCKING_RESYNC_ENABLE
/* Must declare the TEENSY chip to have RESET key available. */
#define TEENSY

/* key combination for command */
#define IS_COMMAND() ( \
Expand Down
14 changes: 14 additions & 0 deletions quantum/keymap_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,21 @@ action_t action_for_key(uint8_t layer, keypos_t key)
} else if (keycode == RESET) { // RESET is 0x5000, which is why this is here
clear_keyboard();
_delay_ms(250);
// bootloader_jump doesn't work for the Teensy
#ifdef TEENSY
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I found this code to be a straight copy of the ´#ifdef __AVR_ATmega32U4__´ in ´bootloader_jump()´ in tmk_core/common/avr/bootloader.c. As of such these changes can be reduced to what's defined in PR #162.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe the line you're referring to is commented out via the #if 0 here.

cli();
UDCON = 1;
USBCON = (1<<FRZCLK); // disable USB
UCSR1B = 0;
_delay_ms(5);
EIMSK = 0; PCICR = 0; SPCR = 0; ACSR = 0; EECR = 0; ADCSRA = 0;
TIMSK0 = 0; TIMSK1 = 0; TIMSK3 = 0; TIMSK4 = 0; UCSR1B = 0; TWCR = 0;
DDRB = 0; DDRC = 0; DDRD = 0; DDRE = 0; DDRF = 0; TWCR = 0;
PORTB = 0; PORTC = 0; PORTD = 0; PORTE = 0; PORTF = 0;
asm volatile("jmp 0x7E00");
#else
bootloader_jump();
#endif
return;
} else if (keycode == DEBUG) { // DEBUG is 0x5001
// TODO: Does this actually work?
Expand Down