mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-12-16 03:18:09 +00:00
bootloader: require only left button to start the bootloader
This commit is contained in:
parent
99c6777c7c
commit
806f943116
@ -119,11 +119,9 @@ int main(void)
|
|||||||
mpu_config_bootloader();
|
mpu_config_bootloader();
|
||||||
|
|
||||||
#ifndef APPVER
|
#ifndef APPVER
|
||||||
// at least one button is unpressed
|
bool left_pressed = (buttonRead() & BTN_PIN_NO) == 0;
|
||||||
uint16_t state = gpio_port_read(BTN_PORT);
|
|
||||||
int unpressed = ((state & BTN_PIN_YES) == BTN_PIN_YES || (state & BTN_PIN_NO) == BTN_PIN_NO);
|
|
||||||
|
|
||||||
if (firmware_present_new() && unpressed) {
|
if (firmware_present_new() && !left_pressed) {
|
||||||
|
|
||||||
oledClear();
|
oledClear();
|
||||||
oledDrawBitmap(40, 0, &bmp_logo64_empty);
|
oledDrawBitmap(40, 0, &bmp_logo64_empty);
|
||||||
|
@ -29,10 +29,9 @@ uint16_t buttonRead(void) {
|
|||||||
|
|
||||||
void buttonUpdate()
|
void buttonUpdate()
|
||||||
{
|
{
|
||||||
uint16_t state;
|
|
||||||
static uint16_t last_state = BTN_PIN_YES | BTN_PIN_NO;
|
static uint16_t last_state = BTN_PIN_YES | BTN_PIN_NO;
|
||||||
|
|
||||||
state = buttonRead();
|
uint16_t state = buttonRead();
|
||||||
|
|
||||||
if ((state & BTN_PIN_YES) == 0) { // Yes button is down
|
if ((state & BTN_PIN_YES) == 0) { // Yes button is down
|
||||||
if ((last_state & BTN_PIN_YES) == 0) { // last Yes was down
|
if ((last_state & BTN_PIN_YES) == 0) { // last Yes was down
|
||||||
|
Loading…
Reference in New Issue
Block a user