|
@@ -9,7 +9,7 @@ class Atm_TeensyStep: public Machine {
|
|
|
enum { IDLE, READY, RUNNING, STOPPING }; // STATES
|
|
|
enum { EVT_IDLE_TIMER, EVT_ON_TARGET, EVT_GOTO, ELSE }; // EVENTS
|
|
|
Atm_TeensyStep( void ) : Machine() {};
|
|
|
- Atm_TeensyStep& begin( Stepper & motorRef ) ;
|
|
|
+ Atm_TeensyStep& begin( Stepper & motorRef , StepControl & stepControlRef ) ;
|
|
|
Atm_TeensyStep& trace( Stream & stream );
|
|
|
Atm_TeensyStep& trigger( int event );
|
|
|
int state( void );
|
|
@@ -17,17 +17,22 @@ class Atm_TeensyStep: public Machine {
|
|
|
Atm_TeensyStep& onOnchange( atm_cb_push_t callback, int idx = 0 );
|
|
|
Atm_TeensyStep& gotoStep( long int targetStep );
|
|
|
Stepper * motor;
|
|
|
+ StepControl * controller;
|
|
|
|
|
|
private:
|
|
|
// AccelStepper _motor;
|
|
|
// Stepper *_motor; // STEP pin: 2, DIR pin: 3
|
|
|
// StepControl _controller;
|
|
|
+
|
|
|
enum { ENT_IDLE, ENT_READY, ENT_RUNNING, LP_RUNNING, ENT_STOPPING, EXT_STOPPING }; // ACTIONS
|
|
|
enum { ON_ONCHANGE, CONN_MAX }; // CONNECTORS
|
|
|
atm_connector connectors[CONN_MAX];
|
|
|
int event( int id );
|
|
|
void action( int id );
|
|
|
|
|
|
+ long int _currentStep ;
|
|
|
+ long int _targetStep ;
|
|
|
+
|
|
|
};
|
|
|
|
|
|
/*
|