Final minor cleanup

This commit is contained in:
Josh Stewart 2020-05-24 21:36:28 +10:00
parent 4fb28a9521
commit 7d28b454c3
2 changed files with 14 additions and 8 deletions

View File

@ -541,7 +541,7 @@ uint16_t getSpeed()
pulseTime = temp_vssLastPulseTime - temp_vssLastMinusOnePulseTime; pulseTime = temp_vssLastPulseTime - temp_vssLastMinusOnePulseTime;
tempSpeed = 3600000000UL / (pulseTime * configPage2.vssPulsesPerKm); //Convert the pulse gap into km/h tempSpeed = 3600000000UL / (pulseTime * configPage2.vssPulsesPerKm); //Convert the pulse gap into km/h
tempSpeed = ADC_FILTER(tempSpeed, configPage2.vssSmoothing, currentStatus.vss); //Apply speed smoothing factor tempSpeed = ADC_FILTER(tempSpeed, configPage2.vssSmoothing, currentStatus.vss); //Apply speed smoothing factor
if(tempSpeed > 1000) { tempSpeed = 0; } //Safety check. This usually occurs when there is a hardware issue if(tempSpeed > 1000) { tempSpeed = currentStatus.vss; } //Safety check. This usually occurs when there is a hardware issue
} }
} }
} }

View File

@ -301,7 +301,7 @@ void doUpdates()
if(EEPROM.read(EEPROM_DATA_VERSION) == 13) if(EEPROM.read(EEPROM_DATA_VERSION) == 13)
{ {
//202003-dev //202005
//Cranking enrichment range 0..1275% instead of older 0.255, so need to divide old values by 5 //Cranking enrichment range 0..1275% instead of older 0.255, so need to divide old values by 5
configPage10.crankingEnrichValues[0] = configPage10.crankingEnrichValues[0] / 5; configPage10.crankingEnrichValues[0] = configPage10.crankingEnrichValues[0] / 5;
configPage10.crankingEnrichValues[1] = configPage10.crankingEnrichValues[1] / 5; configPage10.crankingEnrichValues[1] = configPage10.crankingEnrichValues[1] / 5;
@ -336,12 +336,18 @@ void doUpdates()
configPage2.aeColdTaperMax = 100; configPage2.aeColdTaperMax = 100;
//New PID resolution, old resolution was 100% for each increase, 100% now is stored as 32 //New PID resolution, old resolution was 100% for each increase, 100% now is stored as 32
configPage6.idleKP = configPage6.idleKP<<5; if(configPage6.idleKP >= 8) { configPage6.idleKP = 255; }
configPage6.idleKI = configPage6.idleKI<<5; else { configPage6.idleKP = configPage6.idleKP<<5; }
configPage6.idleKD = configPage6.idleKD<<5; if(configPage6.idleKI >= 8) { configPage6.idleKI = 255; }
configPage10.vvtCLKP = configPage10.vvtCLKP<<5; else { configPage6.idleKI = configPage6.idleKI<<5; }
configPage10.vvtCLKI = configPage10.vvtCLKI<<5; if(configPage6.idleKD >= 8) { configPage6.idleKD = 255; }
configPage10.vvtCLKD = configPage10.vvtCLKD<<5; else { configPage6.idleKD = configPage6.idleKD<<5; }
if(configPage10.vvtCLKP >= 8) { configPage10.vvtCLKP = 255; }
else { configPage10.vvtCLKP = configPage10.vvtCLKP<<5; }
if(configPage10.vvtCLKI >= 8) { configPage10.vvtCLKI = 255; }
else { configPage10.vvtCLKI = configPage10.vvtCLKI<<5; }
if(configPage10.vvtCLKD >= 8) { configPage10.vvtCLKD = 255; }
else { configPage10.vvtCLKD = configPage10.vvtCLKD<<5; }
//Cranking enrichment to run taper added. Default it to 0,1 secs //Cranking enrichment to run taper added. Default it to 0,1 secs
configPage10.crankingEnrichTaper = 1; configPage10.crankingEnrichTaper = 1;