diff --git a/source/firm.c b/source/firm.c index 97faef9..ef35cc7 100755 --- a/source/firm.c +++ b/source/firm.c @@ -135,7 +135,7 @@ void main(void) bool pinExists = CONFIG(7) && readPin(&pin); //If we get here we should check the PIN (if it exists) in all cases - if(pinExists) verifyPin(&pin, true); + if(pinExists) verifyPin(&pin); //If no configuration file exists or SELECT is held, load configuration menu bool shouldLoadConfigurationMenu = needConfig == CREATE_CONFIGURATION || ((pressed & BUTTON_SELECT) && !(pressed & BUTTON_L1)); diff --git a/source/pin.c b/source/pin.c index ff3fe08..6d69e68 100644 --- a/source/pin.c +++ b/source/pin.c @@ -108,7 +108,7 @@ void newPin(void) while(HID_PAD & PIN_BUTTONS); } -void verifyPin(PINData *in, bool allowQuit) +void verifyPin(PINData *in) { initScreens(); @@ -131,8 +131,8 @@ void verifyPin(PINData *in, bool allowQuit) } while(!(pressed & PIN_BUTTONS)); - pressed &= PIN_BUTTONS;// & ~BUTTON_START; - if(!allowQuit) pressed &= ~BUTTON_START; + pressed &= PIN_BUTTONS & ~BUTTON_START; + if(!pressed) continue; if(pressed & BUTTON_START) mcuPowerOff(); diff --git a/source/pin.h b/source/pin.h index c89fbb2..c75ba00 100644 --- a/source/pin.h +++ b/source/pin.h @@ -43,4 +43,4 @@ typedef struct __attribute__((packed)) bool readPin(PINData* out); void newPin(void); -void verifyPin(PINData *in, bool allowQuit); \ No newline at end of file +void verifyPin(PINData *in); \ No newline at end of file