Skip to content

Commit

Permalink
Fix for heat hold timeout, interrupting filament loading post cancell…
Browse files Browse the repository at this point in the history
…ed build, as well as during any other onboard process
  • Loading branch information
wdcrith committed Sep 10, 2013
1 parent 0fce0db commit 983723e
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 2 deletions.
20 changes: 18 additions & 2 deletions firmware/src/MightyBoard/Motherboard/Motherboard.cc
Original file line number Diff line number Diff line change
Expand Up @@ -554,6 +554,14 @@ void Motherboard::runMotherboardSlice() {

}

//If the heat_hold_timeout elapses while we are doing onboard processes
//(i.e. Load Filament) we should clear the heat_hold_timeout without shutting
//down the heaters
if(heat_hold_timeout.hasElapsed() && (motherboard.GetBoardStatus() & STATUS_ONBOARD_PROCESS))
{
abortHeatHoldTimeout();
}

// 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((heat_hold_timeout.hasElapsed() || user_input_timeout.hasElapsed()) && !heatShutdown && (host::getHostState() != host::HOST_STATE_BUILDING_FROM_SD) && (host::getHostState() != host::HOST_STATE_BUILDING))
Expand Down Expand Up @@ -584,8 +592,7 @@ void Motherboard::runMotherboardSlice() {

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();
abortHeatHoldTimeout();
}
}

Expand Down Expand Up @@ -680,10 +687,19 @@ void Motherboard::runMotherboardSlice() {
void Motherboard::resetUserInputTimeout(){
user_input_timeout.start(USER_INPUT_TIMEOUT);
}

// reset heat hold timeout to start from zero
void Motherboard::resetHeatHoldTimeout(){
heat_hold_timeout.start(restart_timeout);
}

// reset heat hold timeout to start from zero and abort it so it does not
// timout until restarted (restarts after a print cancellation)
void Motherboard::abortHeatHoldTimeout(){
heat_hold_timeout.clear();
heat_hold_timeout.abort();
}

//Frequency of Timer 2
//100 = (1.0 / ( 16MHz / 64 / 25 = 10KHz)) * 1000000
#define MICROS_INTERVAL 100
Expand Down
1 change: 1 addition & 0 deletions firmware/src/MightyBoard/Motherboard/Motherboard.hh
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@ public:

void resetUserInputTimeout();
void resetHeatHoldTimeout();
void abortHeatHoldTimeout();
void startButtonWait();
void heaterFail(HeaterFailMode mode);
/// push an error screen, and wait until button
Expand Down
7 changes: 7 additions & 0 deletions firmware/src/MightyBoard/shared/Menu.cc
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,12 @@ void HeaterPreheat::handleSelect(uint8_t index) {
Motherboard::getBoard().getPlatformHeater().set_target_temperature(0);

Motherboard::getBoard().setBoardStatus(Motherboard::STATUS_PREHEATING, false);
//Clear the heat_hold since heat hold is seen as preheating
//and so if a user wishes to preheat his bot selecting "Cool"
//and then preheating will not end in a heat_hold_timeout
Motherboard::getBoard().abortHeatHoldTimeout();
}

interface::popScreen();
interface::queueScreen(InterfaceBoard::BUILD_SCREEN);
//needsRedraw = true;
Expand Down Expand Up @@ -766,6 +771,8 @@ void FilamentScreen::update(LiquidCrystalSerial& lcd, bool forceRedraw) {

Motherboard &board = Motherboard::getBoard();
board.setBoardStatus(Motherboard::STATUS_ONBOARD_PROCESS, true);
//Abort the HeatHold as it will interfere with loading filament
board.abortHeatHoldTimeout();
lcd.setCursor(0,0);
switch (filamentState){
/// starting state - set hot temperature for desired tool and start heat up timer
Expand Down

0 comments on commit 983723e

Please sign in to comment.