mirror of
https://github.com/andreili/katapult.git
synced 2025-08-23 19:34:06 +02:00
canboot_main: Make entry via double reset a config option
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
parent
807c1ef0bd
commit
ce580fa8c6
@ -16,6 +16,10 @@ config CANBUS_FREQUENCY
|
||||
int "CAN bus speed"
|
||||
default 500000
|
||||
|
||||
config ENABLE_DOUBLE_RESET
|
||||
bool "Support bootloader entry on rapid double click of reset button"
|
||||
default y
|
||||
|
||||
config ENABLE_LED
|
||||
bool "Enable Status LED"
|
||||
default n
|
||||
|
@ -219,6 +219,20 @@ check_application_code(void)
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Check for a bootloader request via double tap of reset button
|
||||
static void
|
||||
check_double_reset(void)
|
||||
{
|
||||
if (!CONFIG_ENABLE_DOUBLE_RESET)
|
||||
return;
|
||||
// set request signature and delay for two seconds. This enters the bootloader if
|
||||
// the reset button is double clicked
|
||||
set_bootup_code(REQUEST_SIG);
|
||||
udelay(2000000);
|
||||
set_bootup_code(0);
|
||||
// No reset, read the key back out to clear it
|
||||
}
|
||||
|
||||
|
||||
/****************************************************************
|
||||
* Startup
|
||||
@ -255,13 +269,7 @@ canboot_main(void)
|
||||
set_bootup_code(0);
|
||||
enter_bootloader();
|
||||
}
|
||||
|
||||
// set request signature and delay for two seconds. This enters the bootloader if
|
||||
// the reset button is double clicked
|
||||
set_bootup_code(REQUEST_SIG);
|
||||
udelay(2000000);
|
||||
set_bootup_code(0);
|
||||
// No reset, read the key back out to clear it
|
||||
check_double_reset();
|
||||
|
||||
// jump to app
|
||||
jump_to_application();
|
||||
|
Loading…
x
Reference in New Issue
Block a user