smoothie port to mbed online compiler (smoothieware.org)
For documentation, license, ..., please check http://smoothieware.org/
This version has been tested with a 3 axis machine
Diff: libs/Pauser.cpp
- Revision:
- 0:31e91bb0ef3c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/libs/Pauser.cpp Tue Jul 31 21:11:18 2012 +0000 @@ -0,0 +1,26 @@ +#include "libs/Kernel.h" +#include "Pauser.h" +#include "libs/nuts_bolts.h" +#include "libs/utils.h" +#include <string> +using namespace std; + +Pauser::Pauser(){} + +void Pauser::on_module_loaded(){ + this->counter = 0; +} + +void Pauser::take(){ + this->counter++; + if( this->counter == 1 ){ + this->kernel->call_event(ON_PAUSE, &this->counter); + } +} + +void Pauser::release(){ + this->counter--; + if( this->counter == 0 ){ + this->kernel->call_event(ON_PLAY, &this->counter); + } +}