X-Git-Url: https://git.hcoop.net/clinton/Smoothieware.git/blobdiff_plain/f98a4624df939a844278d9e66c49f34ef84fe49c..73706276e827407ead310af1a9feed756878e501:/src/modules/tools/temperaturecontrol/TemperatureControl.cpp diff --git a/src/modules/tools/temperaturecontrol/TemperatureControl.cpp b/src/modules/tools/temperaturecontrol/TemperatureControl.cpp index 071d3d7a..e2bcb992 100644 --- a/src/modules/tools/temperaturecontrol/TemperatureControl.cpp +++ b/src/modules/tools/temperaturecontrol/TemperatureControl.cpp @@ -329,6 +329,8 @@ void TemperatureControl::on_gcode_received(void *argument) this->waiting = true; // on_second_tick will announce temps while ( get_temperature() < target_temperature ) { THEKERNEL->call_event(ON_IDLE, this); + // check if ON_HALT was called (usually by kill button) + if(THEKERNEL->is_halted() || this->target_temperature == UNDEFINED) break; } this->waiting = false; } @@ -368,12 +370,11 @@ void TemperatureControl::on_get_public_data(void *argument) t.id= this->name_checksum; v->push_back(t); pdr->set_taken(); - pdr->clear_returned_data(); }else if(pdr->second_element_is(current_temperature_checksum)) { // if targeted at us if(pdr->third_element_is(this->name_checksum)) { - // ok this is targeted at us, so send back the requested data + // ok this is targeted at us, so set the requ3sted data in the pointer passed into us struct pad_temperature *t= static_cast(pdr->get_data_ptr()); t->current_temperature = this->get_temperature(); t->target_temperature = (target_temperature <= 0) ? 0 : this->target_temperature; @@ -381,7 +382,6 @@ void TemperatureControl::on_get_public_data(void *argument) t->designator= this->designator; t->id= this->name_checksum; pdr->set_taken(); - pdr->clear_returned_data(); } }