mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-12-16 11:28:14 +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();
|
||||
|
||||
#ifndef APPVER
|
||||
// at least one button is unpressed
|
||||
uint16_t state = gpio_port_read(BTN_PORT);
|
||||
int unpressed = ((state & BTN_PIN_YES) == BTN_PIN_YES || (state & BTN_PIN_NO) == BTN_PIN_NO);
|
||||
bool left_pressed = (buttonRead() & BTN_PIN_NO) == 0;
|
||||
|
||||
if (firmware_present_new() && unpressed) {
|
||||
if (firmware_present_new() && !left_pressed) {
|
||||
|
||||
oledClear();
|
||||
oledDrawBitmap(40, 0, &bmp_logo64_empty);
|
||||
|
@ -29,10 +29,9 @@ uint16_t buttonRead(void) {
|
||||
|
||||
void buttonUpdate()
|
||||
{
|
||||
uint16_t state;
|
||||
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 ((last_state & BTN_PIN_YES) == 0) { // last Yes was down
|
||||
|
Loading…
Reference in New Issue
Block a user