Consolidate common spindle functions
[clinton/Smoothieware.git] / src / modules / tools / spindle / AnalogSpindleControl.cpp
index 7801fdf..76f3668 100644 (file)
@@ -35,7 +35,7 @@ void AnalogSpindleControl::on_module_loaded()
         Pin *smoothie_pin = new Pin();
         smoothie_pin->from_string(THEKERNEL->config->value(spindle_checksum, spindle_pwm_pin_checksum)->by_default("nc")->as_string());
         pwm_pin = smoothie_pin->as_output()->hardware_pwm();
-        output_inverted = smoothie_pin->inverting;
+        output_inverted = smoothie_pin->is_inverting();
         delete smoothie_pin;
     }
     // If we got no hardware PWM pin, delete this module
@@ -54,15 +54,11 @@ void AnalogSpindleControl::on_module_loaded()
 
     // Get digital out pin for switching the VFD on and off (wired to a digital input on the VFD via an optocoupler)
     std::string switch_on_pin = THEKERNEL->config->value(spindle_checksum, spindle_switch_on_pin_checksum)->by_default("nc")->as_string();
-    switch_on == NULL;
+    switch_on = NULL;
     if(switch_on_pin.compare("nc") != 0) {
         switch_on = new Pin();
         switch_on->from_string(switch_on_pin)->as_output()->set(false);
     }
-    // register for events
-    register_for_event(ON_GCODE_RECEIVED);
-    register_for_event(ON_GCODE_EXECUTE);
-
 }
 
 void AnalogSpindleControl::turn_on()