removed most mbed.h includes
[clinton/Smoothieware.git] / src / libs / Pauser.cpp
1 #include "libs/Kernel.h"
2 #include "Pauser.h"
3 #include "libs/nuts_bolts.h"
4 #include "libs/utils.h"
5 #include <string>
6 using namespace std;
7
8 Pauser::Pauser(){}
9
10 void Pauser::on_module_loaded(){
11 this->counter = 0;
12 }
13
14 void Pauser::take(){
15 this->counter++;
16 if( this->counter == 1 ){
17 this->kernel->call_event(ON_PAUSE, &this->counter);
18 }
19 }
20
21 void Pauser::release(){
22 this->counter--;
23 if( this->counter == 0 ){
24 this->kernel->call_event(ON_PLAY, &this->counter);
25 }
26 }