Remove unused code, fix bug

This commit is contained in:
Aurora Wright 2017-04-15 15:58:07 +02:00
parent e04cb28711
commit 36e54642d2
3 changed files with 6 additions and 6 deletions

View File

@ -123,7 +123,7 @@ void main(void)
} }
u32 pinMode = MULTICONFIG(PIN); u32 pinMode = MULTICONFIG(PIN);
bool pinExists = pinMode != 0 && verifyPin(pinMode, true); bool pinExists = pinMode != 0 && verifyPin(pinMode);
//If no configuration file exists or SELECT is held, load configuration menu //If no configuration file exists or SELECT is held, load configuration menu
bool shouldLoadConfigMenu = needConfig == CREATE_CONFIGURATION || ((pressed & (BUTTON_SELECT | BUTTON_L1)) == BUTTON_SELECT); bool shouldLoadConfigMenu = needConfig == CREATE_CONFIGURATION || ((pressed & (BUTTON_SELECT | BUTTON_L1)) == BUTTON_SELECT);

View File

@ -122,7 +122,7 @@ void newPin(bool allowSkipping, u32 pinMode)
error("Error writing the PIN file"); error("Error writing the PIN file");
} }
bool verifyPin(u32 pinMode, bool hidePin) bool verifyPin(u32 pinMode)
{ {
PinData pin; PinData pin;
@ -172,7 +172,7 @@ bool verifyPin(u32 pinMode, bool hidePin)
if(reset) if(reset)
{ {
for(u32 i = 0; i < cnt; i++) for(u32 i = 0; i < cnt; i++)
drawCharacter((char)enteredPassword[i], true, 10 + (16 + 2 * i) * SPACING_X, 10 + 3 * SPACING_Y, COLOR_BLACK); drawCharacter('*', true, 10 + (16 + 2 * i) * SPACING_X, 10 + 3 * SPACING_Y, COLOR_BLACK);
cnt = 0; cnt = 0;
reset = false; reset = false;
@ -199,9 +199,9 @@ bool verifyPin(u32 pinMode, bool hidePin)
//Add character to password //Add character to password
enteredPassword[cnt] = (u8)pinKeyToLetter(pressed); enteredPassword[cnt] = (u8)pinKeyToLetter(pressed);
//Visualize character on screen //Visualize character on screen
char display = hidePin ? '*' : (char)enteredPassword[cnt]; drawCharacter('*', true, 10 + (16 + 2 * cnt) * SPACING_X, 10 + 3 * SPACING_Y, COLOR_WHITE);
drawCharacter(display, true, 10 + (16 + 2 * cnt) * SPACING_X, 10 + 3 * SPACING_Y, COLOR_WHITE);
if(++cnt < lengthBlock[0]) continue; if(++cnt < lengthBlock[0]) continue;

View File

@ -33,4 +33,4 @@
#define PIN_VERSIONMINOR 3 #define PIN_VERSIONMINOR 3
void newPin(bool allowSkipping, u32 pinMode); void newPin(bool allowSkipping, u32 pinMode);
bool verifyPin(u32 pinMode, bool hidePin); bool verifyPin(u32 pinMode);