Use static kernel singleton pointer instead of per-class instance pointer
[clinton/Smoothieware.git] / src / modules / utils / pausebutton / PauseButton.cpp
index b7dc677..0121827 100644 (file)
@@ -11,10 +11,10 @@ void PauseButton::on_module_loaded(){
     this->button_state = true;
     this->play_state   = true;
 
-    this->enable     =  this->kernel->config->value( pause_button_enable_checksum )->by_default(false)->as_bool();
-    this->button.from_string( this->kernel->config->value( pause_button_pin_checksum )->by_default("2.12")->as_string())->as_input();
+    this->enable     =  THEKERNEL->config->value( pause_button_enable_checksum )->by_default(false)->as_bool();
+    this->button.from_string( THEKERNEL->config->value( pause_button_pin_checksum )->by_default("2.12")->as_string())->as_input();
 
-    this->kernel->slow_ticker->attach( 100, this, &PauseButton::button_tick );
+    THEKERNEL->slow_ticker->attach( 100, this, &PauseButton::button_tick );
 }
 
 //TODO: Make this use InterruptIn
@@ -29,10 +29,10 @@ uint32_t PauseButton::button_tick(uint32_t dummy){
         if( this->button_state ){
             if( this->play_state ){
                 this->play_state = false;
-                this->kernel->pauser->take();
+                THEKERNEL->pauser->take();
             }else{
                 this->play_state = true;
-                this->kernel->pauser->release();
+                THEKERNEL->pauser->release();
             }
         }
     }