From 1767878c56a87b23432d6cfbb431d1d50bc09c08 Mon Sep 17 00:00:00 2001 From: Jim Morris Date: Wed, 27 Aug 2014 22:12:29 -0700 Subject: [PATCH] optimize readonly update configs --- ConfigSamples/AzteegX5Mini.delta/config | 8 +++++--- ConfigSamples/AzteegX5Mini/config | 8 +++++--- ConfigSamples/Smoothieboard.delta/config | 7 ++++--- .../tools/temperaturecontrol/TemperatureControl.cpp | 9 --------- 4 files changed, 14 insertions(+), 18 deletions(-) diff --git a/ConfigSamples/AzteegX5Mini.delta/config b/ConfigSamples/AzteegX5Mini.delta/config index 15012916..4972d48a 100644 --- a/ConfigSamples/AzteegX5Mini.delta/config +++ b/ConfigSamples/AzteegX5Mini.delta/config @@ -105,14 +105,16 @@ switch.fan.input_on_command M106 # switch.fan.input_off_command M107 # switch.fan.output_pin 2.4 # -# automatically toggle a switch at a specified temperature +# automatically toggle a switch at a specified temperature. Different ones of these may be defined to monitor different temperatures and switch different swithxes # useful to turn on a fan or water pump to cool the hotend -#temperatureswitch.hotend.enable true # -#temperatureswitch.hotend.type misc # select which MOSFET to use, fan or misc (small MOSFETs) +#temperatureswitch.hotend.enable true # +#temperatureswitch.hotend.designator T # first character of the temperature control designator to use as the temperature sensor to monitor +#temperatureswitch.hotend.switch misc # select which switch to use, matches the name of the defined switch #temperatureswitch.hotend.threshold_temp 60.0 # temperature to turn on (if rising) or off the switch #temperatureswitch.hotend.heatup_poll 15 # poll heatup at 15 sec intervals #temperatureswitch.hotend.cooldown_poll 60 # poll cooldown at 60 sec intervals + # switch.psu.enable true # turn atx on/off # switch.psu.input_on_command M80 # # switch.psu.input_off_command M81 # diff --git a/ConfigSamples/AzteegX5Mini/config b/ConfigSamples/AzteegX5Mini/config index 6ed0bec8..234f4d39 100755 --- a/ConfigSamples/AzteegX5Mini/config +++ b/ConfigSamples/AzteegX5Mini/config @@ -96,14 +96,16 @@ switch.misc.input_on_command M42 # switch.misc.input_off_command M43 # switch.misc.output_pin 2.4 # -# automatically toggle a switch at a specified temperature +# automatically toggle a switch at a specified temperature. Different ones of these may be defined to monitor different temperatures and switch different swithxes # useful to turn on a fan or water pump to cool the hotend -#temperatureswitch.hotend.enable true # -#temperatureswitch.hotend.type misc # select which MOSFET to use, fan or misc (small MOSFETs) +#temperatureswitch.hotend.enable true # +#temperatureswitch.hotend.designator T # first character of the temperature control designator to use as the temperature sensor to monitor +#temperatureswitch.hotend.switch misc # select which switch to use, matches the name of the defined switch #temperatureswitch.hotend.threshold_temp 60.0 # temperature to turn on (if rising) or off the switch #temperatureswitch.hotend.heatup_poll 15 # poll heatup at 15 sec intervals #temperatureswitch.hotend.cooldown_poll 60 # poll cooldown at 60 sec intervals + # Switch module for spindle control #switch.spindle.enable false # diff --git a/ConfigSamples/Smoothieboard.delta/config b/ConfigSamples/Smoothieboard.delta/config index 1d900aef..8be0ab6b 100644 --- a/ConfigSamples/Smoothieboard.delta/config +++ b/ConfigSamples/Smoothieboard.delta/config @@ -182,10 +182,11 @@ switch.fan.output_type pwm # pwm output setta #switch.misc.output_pin 2.4 # #switch.misc.output_type digital # just an on or off pin -# automatically toggle a switch at a specified temperature +# automatically toggle a switch at a specified temperature. Different ones of these may be defined to monitor different temperatures and switch different swithxes # useful to turn on a fan or water pump to cool the hotend -#temperatureswitch.hotend.enable true # -#temperatureswitch.hotend.type misc # select which MOSFET to use, fan or misc (small MOSFETs) +#temperatureswitch.hotend.enable true # +#temperatureswitch.hotend.designator T # first character of the temperature control designator to use as the temperature sensor to monitor +#temperatureswitch.hotend.switch misc # select which switch to use, matches the name of the defined switch #temperatureswitch.hotend.threshold_temp 60.0 # temperature to turn on (if rising) or off the switch #temperatureswitch.hotend.heatup_poll 15 # poll heatup at 15 sec intervals #temperatureswitch.hotend.cooldown_poll 60 # poll cooldown at 60 sec intervals diff --git a/src/modules/tools/temperaturecontrol/TemperatureControl.cpp b/src/modules/tools/temperaturecontrol/TemperatureControl.cpp index 4b8d3a73..96345a7e 100644 --- a/src/modules/tools/temperaturecontrol/TemperatureControl.cpp +++ b/src/modules/tools/temperaturecontrol/TemperatureControl.cpp @@ -98,8 +98,6 @@ void TemperatureControl::on_module_loaded() void TemperatureControl::on_halt(void *arg) { - if(this->readonly) return; - // turn off heater this->o = 0; this->heater_pin.set(0); @@ -253,9 +251,6 @@ void TemperatureControl::on_gcode_received(void *argument) void TemperatureControl::on_gcode_execute(void *argument) { - // readonly sensors don't handle this - if(this->readonly) return; - Gcode *gcode = static_cast(argument); if( gcode->has_m) { if (((gcode->m == this->set_m_code) || (gcode->m == this->set_and_wait_m_code)) @@ -309,8 +304,6 @@ void TemperatureControl::on_get_public_data(void *argument) void TemperatureControl::on_set_public_data(void *argument) { - if(this->readonly) return; - PublicDataRequest *pdr = static_cast(argument); if(!pdr->starts_with(temperature_control_checksum)) return; @@ -325,8 +318,6 @@ void TemperatureControl::on_set_public_data(void *argument) void TemperatureControl::set_desired_temperature(float desired_temperature) { - if(this->readonly) return; - if (desired_temperature == 1.0) desired_temperature = preset1; else if (desired_temperature == 2.0) -- 2.20.1