Fix #1737 (screen filters CCT was OOB)
This commit is contained in:
parent
90d6420f38
commit
c71474a668
@ -488,6 +488,7 @@ static bool readConfigMcu(void)
|
|||||||
if (checksum != configDataMcu.checksum || configDataMcu.lumaVersion < MAKE_LUMA_VERSION_MCU(10, 3, 0))
|
if (checksum != configDataMcu.checksum || configDataMcu.lumaVersion < MAKE_LUMA_VERSION_MCU(10, 3, 0))
|
||||||
{
|
{
|
||||||
// Invalid data stored in MCU...
|
// Invalid data stored in MCU...
|
||||||
|
memset(&configDataMcu, 0, sizeof(CfgDataMcu));
|
||||||
configData.bootConfig = 0;
|
configData.bootConfig = 0;
|
||||||
// Perform upgrade process (ignoring failures)
|
// Perform upgrade process (ignoring failures)
|
||||||
doLumaUpgradeProcess();
|
doLumaUpgradeProcess();
|
||||||
@ -508,14 +509,11 @@ static bool readConfigMcu(void)
|
|||||||
|
|
||||||
bool readConfig(void)
|
bool readConfig(void)
|
||||||
{
|
{
|
||||||
bool ret;
|
bool retMcu, ret;
|
||||||
|
|
||||||
ret = readConfigMcu();
|
|
||||||
if (!ret)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
|
retMcu = readConfigMcu();
|
||||||
ret = readLumaIniConfig();
|
ret = readLumaIniConfig();
|
||||||
if(!ret ||
|
if(!retMcu || !ret ||
|
||||||
configData.formatVersionMajor != CONFIG_VERSIONMAJOR ||
|
configData.formatVersionMajor != CONFIG_VERSIONMAJOR ||
|
||||||
configData.formatVersionMinor != CONFIG_VERSIONMINOR)
|
configData.formatVersionMinor != CONFIG_VERSIONMINOR)
|
||||||
{
|
{
|
||||||
@ -540,16 +538,24 @@ bool readConfig(void)
|
|||||||
|
|
||||||
void writeConfig(bool isConfigOptions)
|
void writeConfig(bool isConfigOptions)
|
||||||
{
|
{
|
||||||
//If the configuration is different from previously, overwrite it.
|
bool updateMcu, updateIni;
|
||||||
if(needConfig != CREATE_CONFIGURATION && ((isConfigOptions && configData.config == oldConfig.config && configData.multiConfig == oldConfig.multiConfig) ||
|
|
||||||
(!isConfigOptions && configData.bootConfig == oldConfig.bootConfig))) return;
|
|
||||||
|
|
||||||
if(needConfig == CREATE_CONFIGURATION)
|
if (needConfig == CREATE_CONFIGURATION)
|
||||||
|
{
|
||||||
|
updateMcu = !isConfigOptions; // We've already committed it once (if it wasn't initialized)
|
||||||
|
updateIni = isConfigOptions;
|
||||||
needConfig = MODIFY_CONFIGURATION;
|
needConfig = MODIFY_CONFIGURATION;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
updateMcu = !isConfigOptions && configData.bootConfig != oldConfig.bootConfig;
|
||||||
|
updateIni = isConfigOptions && (configData.config != oldConfig.config || configData.multiConfig != oldConfig.multiConfig);
|
||||||
|
}
|
||||||
|
|
||||||
if (!isConfigOptions)
|
if (updateMcu)
|
||||||
writeConfigMcu();
|
writeConfigMcu();
|
||||||
else if(!writeLumaIniConfig())
|
|
||||||
|
if(updateIni && !writeLumaIniConfig())
|
||||||
error("Error writing the configuration file");
|
error("Error writing the configuration file");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -234,6 +234,8 @@ void menuThreadMain(void)
|
|||||||
s64 out;
|
s64 out;
|
||||||
svcGetSystemInfo(&out, 0x10000, 0x102);
|
svcGetSystemInfo(&out, 0x10000, 0x102);
|
||||||
screenFiltersCurrentTemperature = (int)(u32)out;
|
screenFiltersCurrentTemperature = (int)(u32)out;
|
||||||
|
if (screenFiltersCurrentTemperature < 1000 || screenFiltersCurrentTemperature > 25100)
|
||||||
|
screenFiltersCurrentTemperature = 6500;
|
||||||
|
|
||||||
// Careful about race conditions here
|
// Careful about race conditions here
|
||||||
if (screenFiltersCurrentTemperature != 6500)
|
if (screenFiltersCurrentTemperature != 6500)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user