From dc92892c28a32bfc5c331637f62d8c17e534b926 Mon Sep 17 00:00:00 2001 From: Adam Engstrom Date: Fri, 6 Jan 2017 12:26:55 +0100 Subject: [PATCH] fn + F1 AND F4 for BSL entry, not F1 OR F4 Check for F keys was only requiring one of F1 or F4 to be pressed.. --- README.org | 2 +- patch.py | 4 ++-- shellcode/enter_bsl.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.org b/README.org index 8341243..4f9ce0e 100644 --- a/README.org +++ b/README.org @@ -84,7 +84,7 @@ patching, and then flash the patched firmware back to the Novatouch. The patches done by default are: - Replace caps-lock with ctrl - Switch place of the 'backspace' and \ keys -- Add hook function for entering BSL (bootloader) mode with fn + F1 + F2 +- Add hook function for entering BSL (bootloader) mode with fn + F1 + F4 Edit the patch.py file to do other key mappings, hopefully it's understandable with the overly commented code. diff --git a/patch.py b/patch.py index 2a1fe15..eb5b121 100644 --- a/patch.py +++ b/patch.py @@ -99,9 +99,9 @@ def original_fw_valid(path): return m.hexdigest() == orig_fw_md5 def write_jump_to_bsl(): - '''Make fn + F1 + F2 jump to BSL (firmware update mode)''' + '''Make fn + F1 + F4 jump to BSL (firmware update mode)''' # Replace mov instruction with a call to our own code for checking - # which F keys are currently pressed. If fn + F1 + F2 is pressed + # which F keys are currently pressed. If fn + F1 + F4 is pressed # jump to 0x1000 (BSL entry addr). # bytecode for asm 'call 0xa780; nop' diff --git a/shellcode/enter_bsl.c b/shellcode/enter_bsl.c index f1b53aa..0290627 100644 --- a/shellcode/enter_bsl.c +++ b/shellcode/enter_bsl.c @@ -13,7 +13,7 @@ void check_bsl_enter() { *num_for_7x_c1 = *repeat_rate; // Enter BSL if fn + f1 + f4 is pressed - if (*repeat_flags & 0x9) { + if ((*repeat_flags & 0x9) == 0x09) { __dint(); // Maybe need to slow down clock to 8 MHz also, not sure what // is configured by Novatouch fw