Remove some configbit math

This commit is contained in:
Aurora Wright 2017-06-22 15:49:23 +02:00
parent 9b8e2b933d
commit 786ecf4fe4
2 changed files with 3 additions and 5 deletions

View File

@ -59,10 +59,9 @@ bool readConfig(void)
void writeConfig(bool isConfigOptions) void writeConfig(bool isConfigOptions)
{ {
/* If the configuration is different from previously, overwrite it. //If the configuration is different from previously, overwrite it.
Just the no-forcing flag being set is not enough */
if(needConfig != CREATE_CONFIGURATION && ((isConfigOptions && configData.config == oldConfig.config && configData.multiConfig == oldConfig.multiConfig) || if(needConfig != CREATE_CONFIGURATION && ((isConfigOptions && configData.config == oldConfig.config && configData.multiConfig == oldConfig.multiConfig) ||
(!isConfigOptions && (configData.bootConfig & ~0x40) == oldConfig.bootConfig))) return; (!isConfigOptions && configData.bootConfig == oldConfig.bootConfig))) return;
if(needConfig == CREATE_CONFIGURATION) if(needConfig == CREATE_CONFIGURATION)
{ {
@ -383,7 +382,6 @@ void configMenu(bool oldPinStatus, u32 oldPinMode)
else if(singleOptions[singleSelected].enabled) drawCharacter(true, 10 + SPACING_X, singleOptions[singleSelected].posY, COLOR_RED, selected); else if(singleOptions[singleSelected].enabled) drawCharacter(true, 10 + SPACING_X, singleOptions[singleSelected].posY, COLOR_RED, selected);
} }
//Preserve the last-used boot options
//Parse and write the new configuration //Parse and write the new configuration
configData.multiConfig = 0; configData.multiConfig = 0;
for(u32 i = 0; i < multiOptionsAmount; i++) for(u32 i = 0; i < multiOptionsAmount; i++)

View File

@ -154,7 +154,7 @@ void main(int argc, char **argv, u32 magicWord)
firmSource = (BOOTCFG_NAND != 0) == (BOOTCFG_FIRM != 0) ? FIRMWARE_SYSNAND : (FirmwareSource)BOOTCFG_FIRM; firmSource = (BOOTCFG_NAND != 0) == (BOOTCFG_FIRM != 0) ? FIRMWARE_SYSNAND : (FirmwareSource)BOOTCFG_FIRM;
//Prevent multiple boot options-forcing //Prevent multiple boot options-forcing
isNoForceFlagSet = true; if(nandType != BOOTCFG_NAND || firmSource != BOOTCFG_FIRM) isNoForceFlagSet = true;
goto boot; goto boot;
} }