diff --git a/Configuration.h b/Configuration.h index 24f2bd8..f57bf2d 100644 --- a/Configuration.h +++ b/Configuration.h @@ -24,8 +24,8 @@ Licence: GPL #define CONFIGURATION_H #define NAME "RepRapFirmware" -#define VERSION "0.35" -#define DATE "2013-12-06" +#define VERSION "0.36" +#define DATE "2013-12-11" #define LAST_AUTHOR "reprappro.com" // Other firmware that we might switch to be compatible with. @@ -56,7 +56,7 @@ enum Compatibility #define BAD_LOW_TEMPERATURE -30.0 #define BAD_HIGH_TEMPERATURE 300.0 -#define MAX_BAD_TEMPERATURE_COUNT 3 +#define MAX_BAD_TEMPERATURE_COUNT 6 #define STANDBY_INTERRUPT_RATE 2.0e-4 // Seconds diff --git a/GCodes.cpp b/GCodes.cpp index ef8427e..f3a9932 100644 --- a/GCodes.cpp +++ b/GCodes.cpp @@ -1558,6 +1558,14 @@ bool GCodes::ActOnGcode(GCodeBuffer *gb) reprap.GetMove()->SetIdentityTransform(); break; + case 562: // Reset temperature fault - use with great caution + if(gb->Seen('P')) + { + iValue = gb->GetIValue(); + reprap.GetHeat()->ResetFault(iValue); + } + break; + case 876: // TEMPORARY - this will go away... if(gb->Seen('P')) { diff --git a/Heat.cpp b/Heat.cpp index 0533960..1fc3658 100644 --- a/Heat.cpp +++ b/Heat.cpp @@ -114,7 +114,10 @@ void PID::Init() void PID::Spin() { if(temperatureFault) + { + platform->SetHeater(heater, 0.0); // Make sure... return; + } temperature = platform->GetTemperature(heater); diff --git a/Heat.h b/Heat.h index b9438c4..5d7cb34 100644 --- a/Heat.h +++ b/Heat.h @@ -35,6 +35,7 @@ class PID void Activate(); void Standby(); bool Active(); + void ResetFault(); float GetTemperature(); private: @@ -68,6 +69,7 @@ class Heat void Activate(int8_t heater); void Standby(int8_t heater); float GetTemperature(int8_t heater); + void ResetFault(int8_t heater); bool AllHeatersAtSetTemperatures(); void Diagnostics(); @@ -124,6 +126,12 @@ inline void PID::Standby() active = false; } +inline void PID::ResetFault() +{ + temperatureFault = false; + badTemperatureCount = 0; +} + inline void Heat::SetActiveTemperature(int8_t heater, const float& t) { @@ -160,5 +168,11 @@ inline void Heat::Standby(int8_t heater) pids[heater]->Standby(); } +inline void Heat::ResetFault(int8_t heater) +{ + pids[heater]->ResetFault(); +} + + #endif diff --git a/Release/RepRapFirmware.bin b/Release/RepRapFirmware.bin index 87cc7b4..ae42fae 100755 Binary files a/Release/RepRapFirmware.bin and b/Release/RepRapFirmware.bin differ