1
0
Fork 0

board: fix failing to detect failsafe key press

optimizations
Martin T. H. Sandsmark 2017-02-10 16:10:19 +01:00
parent ff69e58e1f
commit 09627d5f52
1 changed files with 7 additions and 1 deletions

View File

@ -881,7 +881,13 @@ static int check_gpio_keypress(void)
home = gpio_get_value(GPIO_KEY_HOME);
right = gpio_get_value(GPIO_KEY_RIGHT);
return !left && home && !right;
gpio_free(GPIO_KEY_LEFT);
gpio_free(GPIO_KEY_HOME);
gpio_free(GPIO_KEY_RIGHT);
/* It is supposed to be just the home button, but sometimes the values
* are inverted */
return (left == right && left != home);
}
/*