some more optimizations
authorJim Morris <morris@wolfman.com>
Wed, 27 Aug 2014 00:35:58 +0000 (17:35 -0700)
committerJim Morris <morris@wolfman.com>
Wed, 27 Aug 2014 00:35:58 +0000 (17:35 -0700)
src/main.cpp
src/modules/tools/temperatureswitch/TemperatureSwitch.cpp
src/modules/tools/temperatureswitch/TemperatureSwitch.h

index aea1a6b..230cc3f 100644 (file)
@@ -162,6 +162,7 @@ void init() {
     kernel->add_module( new Network() );
     #endif
     #ifndef NO_TOOLS_TEMPERATURESWITCH
+    // Must be loaded after TemperatureControlPool
     kernel->add_module( new TemperatureSwitch() );
     #endif
 
index 4dafb42..979d207 100755 (executable)
@@ -42,20 +42,17 @@ TemperatureSwitch::TemperatureSwitch()
 // Load module
 void TemperatureSwitch::on_module_loaded()
 {
+    // TODO load multiple instances of temperature switch linked to different temp controls and switches
+
     // free up space if not loaded
     if (!THEKERNEL->config->value(temperatureswitch_checksum, temperatureswitch_hotend_checksum, temperatureswitch_enable_checksum)->by_default(false)->as_bool()) {
         delete this;
         return;
     }
 
-    // settings
-    this->on_config_reload(this);
-}
+    // load settings
 
-// Get config
-void TemperatureSwitch::on_config_reload(void *argument)
-{
-    // get the list of temperature controllers and remove any that fon't have designator == "T"
+    // get the list of temperature controllers and remove any that don't have designator == "T"
     vector<uint16_t> controller_list;
     THEKERNEL->config->get_module_list(&controller_list, temperature_control_checksum);
 
index d322636..286ecc4 100755 (executable)
@@ -27,7 +27,6 @@ class TemperatureSwitch : public Module
     public:
         TemperatureSwitch();
         void on_module_loaded();
-        void on_config_reload(void *argument);
         void on_second_tick(void *argument);
 
     private: