diff --git a/Configuration.h b/Configuration.h index be5abd8..cad754b 100644 --- a/Configuration.h +++ b/Configuration.h @@ -24,8 +24,8 @@ Licence: GPL #define CONFIGURATION_H #define NAME "RepRapFirmware" -#define VERSION "0.57" -#define DATE "2014-01-13" +#define VERSION "0.57a" +#define DATE "2014-01-16" #define LAST_AUTHOR "reprappro.com" // Other firmware that we might switch to be compatible with. diff --git a/Platform.cpp b/Platform.cpp index e4012d5..07c9418 100644 --- a/Platform.cpp +++ b/Platform.cpp @@ -317,15 +317,24 @@ void Platform::ClassReport(char* className, float &lastTime) // Result is in degrees celsius + float Platform::GetTemperature(int8_t heater) { - // If the ADC reading is N then for an ideal ADC, the input voltage is at least N/(ADC_RANGE + 1) and less than (N + 1)/(ADC_RANGE + 1), times the analog reference. - // So we add 0.5 to to the reading to get a better estimate of the input. We don't care whether or not we get exactly zero with the thermistor disconnected. - float r = (float)GetRawTemperature(heater) + 0.5; + // If the ADC reading is N then for an ideal ADC, the input voltage is at least N/(AD_RANGE + 1) and less than (N + 1)/(AD_RANGE + 1), times the analog reference. + // So we add 0.5 to to the reading to get a better estimate of the input. But first, recognise the special case of thermistor disconnected. + int rawTemp = GetRawTemperature(heater); + if (rawTemp == AD_RANGE) + { + // Thermistor is disconnected + return ABS_ZERO; + } + float r = (float)rawTemp + 0.5; return ABS_ZERO + thermistorBetas[heater]/log( (r*thermistorSeriesRs[heater]/((AD_RANGE + 1) - r))/thermistorInfRs[heater] ); } + + // power is a fraction in [0,1] void Platform::SetHeater(int8_t heater, const float& power) @@ -386,7 +395,7 @@ void MassStorage::Init() hsmciPinsinit(); // Initialize SD MMC stack sd_mmc_init(); - delay(20); + delay(7); int sdPresentCount = 0; while ((CTRL_NO_PRESENT == sd_mmc_check(0)) && (sdPresentCount < 5)) { diff --git a/Release/RepRapFirmware-057-13-01-2014.bin b/Release/RepRapFirmware-057a-16-01-2014.bin similarity index 75% rename from Release/RepRapFirmware-057-13-01-2014.bin rename to Release/RepRapFirmware-057a-16-01-2014.bin index 86d17b5..bf1351d 100755 Binary files a/Release/RepRapFirmware-057-13-01-2014.bin and b/Release/RepRapFirmware-057a-16-01-2014.bin differ