Skip to content

Commit

Permalink
Merge branch 'heat_hold_fix' into 7.5
Browse files Browse the repository at this point in the history
Conflicts:
	firmware/current_version.txt
  • Loading branch information
wdcrith committed Sep 5, 2013
2 parents f96d154 + 4bae930 commit 85c35db
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 8 deletions.
1 change: 1 addition & 0 deletions firmware/current_version.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
7.5.1.1.0
* Removal of dual filament loading for Rep2X startup script
* Fix for Heat Hold not being handled properly
7.4.1.1.0
* Fix for build time rollover bug,
* Added fix for the button array setup
Expand Down
2 changes: 1 addition & 1 deletion firmware/src/MightyBoard/Motherboard/Host.cc
Original file line number Diff line number Diff line change
Expand Up @@ -680,7 +680,7 @@ sdcard::SdErrorCode startBuildFromSD() {
command::reset();
steppers::abort();
steppers::reset();
Motherboard::getBoard().state_reset();
Motherboard::getBoard().state_reset(false);

currentState = HOST_STATE_BUILDING_FROM_SD;
return e;
Expand Down
26 changes: 20 additions & 6 deletions firmware/src/MightyBoard/Motherboard/Motherboard.cc
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ void Motherboard::reset(bool hard_reset) {



state_reset();
state_reset(hard_reset);


// pop the splash screen unless we are showing the welcome script
Expand All @@ -253,7 +253,7 @@ void Motherboard::reset(bool hard_reset) {


/// State reset, used to reset variables needed for printing
void Motherboard::state_reset() {
void Motherboard::state_reset(bool hard_reset) {


board_status = STATUS_NONE;
Expand All @@ -272,7 +272,11 @@ void Motherboard::state_reset() {
// disable platform heater if no HBP
platform_heater.disable(!eeprom::hasHBP());

user_input_timeout.start(restart_timeout);
resetUserInputTimeout();
//Don't start the heat hold timeout on a hard reset(power on)
if(!hard_reset){
resetHeatHoldTimeout();
}

RGB_LED::setDefaultColor();
buttonWait = false;
Expand Down Expand Up @@ -552,7 +556,7 @@ void Motherboard::runMotherboardSlice() {

// if no user input for USER_INPUT_TIMEOUT, shutdown heaters and warn user
// don't do this if a heat failure has occured ( in this case heaters are already shutdown and separate error messaging used)
if(user_input_timeout.hasElapsed() && !heatShutdown && (host::getHostState() != host::HOST_STATE_BUILDING_FROM_SD) && (host::getHostState() != host::HOST_STATE_BUILDING))
if((heat_hold_timeout.hasElapsed() || user_input_timeout.hasElapsed()) && !heatShutdown && (host::getHostState() != host::HOST_STATE_BUILDING_FROM_SD) && (host::getHostState() != host::HOST_STATE_BUILDING))
{

board_status |= STATUS_HEAT_INACTIVE_SHUTDOWN;
Expand All @@ -574,8 +578,15 @@ void Motherboard::runMotherboardSlice() {
Extruder_Two.getExtruderHeater().set_target_temperature(0);
platform_heater.set_target_temperature(0);

// clear timeout
user_input_timeout.clear();
// clear timeouts
if(user_input_timeout.hasElapsed()){
user_input_timeout.clear();
}
if(heat_hold_timeout.hasElapsed()){
//clear and abort so the heat doesn't hold till the next print
heat_hold_timeout.clear();
heat_hold_timeout.abort();
}
}

// respond to heatshutdown. response only needs to be called once
Expand Down Expand Up @@ -669,6 +680,9 @@ void Motherboard::runMotherboardSlice() {
void Motherboard::resetUserInputTimeout(){
user_input_timeout.start(USER_INPUT_TIMEOUT);
}
void Motherboard::resetHeatHoldTimeout(){
heat_hold_timeout.start(restart_timeout);
}

//Frequency of Timer 2
//100 = (1.0 / ( 16MHz / 64 / 25 = 10KHz)) * 1000000
Expand Down
4 changes: 3 additions & 1 deletion firmware/src/MightyBoard/Motherboard/Motherboard.hh
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ private:
// TODO: Move this to an interface board slice.
Timeout interface_update_timeout;
Timeout user_input_timeout;
Timeout heat_hold_timeout;
#ifdef MODEL_REPLICATOR2
Timeout therm_sensor_timeout;
ThermocoupleReader therm_sensor;
Expand Down Expand Up @@ -141,7 +142,7 @@ public:
void reset(bool hard_reset);

/// State reset, used to reset variables needed for printing
void state_reset();
void state_reset(bool hard_reset);

/// initialize things that only need to be set up once, on boot
void init();
Expand Down Expand Up @@ -172,6 +173,7 @@ public:
void setExtra(bool on);

void resetUserInputTimeout();
void resetHeatHoldTimeout();
void startButtonWait();
void heaterFail(HeaterFailMode mode);
/// push an error screen, and wait until button
Expand Down

0 comments on commit 85c35db

Please sign in to comment.