Bladeren bron

added onTarget connector message

titi 5 jaren geleden
bovenliggende
commit
6b5fa3900f
1 gewijzigde bestanden met toevoegingen van 3 en 3 verwijderingen
  1. 3 3
      Atm_AccelStepper.cpp

+ 3 - 3
Atm_AccelStepper.cpp

@@ -11,8 +11,8 @@ Atm_AccelStepper& Atm_AccelStepper::begin(int step_pin, int dir_pin) {
     /*                       ON_ENTER           ON_LOOP          ON_EXIT  EVT_DISABLE  EVT_ENABLE  EVT_ENABLED_TIMEOUT    EVT_MOVE  EVT_STOP  EVT_EMERGENCY_STOP  EVT_ON_LIMIT_LOW  EVT_ON_LIMIT_HIGH  EVT_ON_TARGET  EVT_HOMING_LOW  EVT_HOMING_HIGH  ELSE */
     /*    DISABLE */     ENT_DISABLED,              -1,              -1,         -1,    ENABLED,                  -1,     RUNNING,        -1,                -1,          DISABLE,           DISABLE,            -1,    HOMING_LOW,     HOMING_HIGH,   -1,
     /*     ENABLED */     ENT_ENABLED,              -1,              -1,    DISABLE,         -1,             DISABLE,     RUNNING,        -1,               -1,          ENABLED,           ENABLED,             -1,    HOMING_LOW,     HOMING_HIGH,   -1,
-    /*     RUNNING */     ENT_RUNNING,      LP_RUNNING,              -1,    DISABLE,         -1,                  -1,     RUNNING,      STOP,              STOP,          RUNNING,           RUNNING,          -1,            -1,              -1,   -1,
-    /*        STOP */        ENT_STOP,         LP_STOP,              -1,    DISABLE,    ENABLED,                  -1,     RUNNING,      STOP,              STOP,             STOP,              STOP,          -1,            -1,              -1,   -1,
+    /*     RUNNING */     ENT_RUNNING,      LP_RUNNING,              -1,    DISABLE,         -1,                  -1,     RUNNING,      STOP,              STOP,          RUNNING,           RUNNING,          ENABLED,            -1,              -1,   -1,
+    /*        STOP */        ENT_STOP,         LP_STOP,              -1,    DISABLE,    ENABLED,                  -1,     RUNNING,      STOP,              STOP,             STOP,              STOP,          ENABLED,            -1,              -1,   -1,
     /*  HOMING_LOW */  ENT_HOMING_LOW,   LP_HOMING_LOW,  EXT_HOMING_LOW,    DISABLE,         -1,                  -1,          -1,      STOP,              STOP,       HOMING_LOW,        HOMING_LOW,            -1,            -1,              -1,   -1,
     /* HOMING_HIGH */ ENT_HOMING_HIGH,  LP_HOMING_HIGH, EXT_HOMING_HIGH,    DISABLE,         -1,                  -1,          -1,      STOP,              STOP,      HOMING_HIGH,       HOMING_HIGH,            -1,            -1,              -1,   -1,
     /*   LIMIT_LOW */   ENT_LIMIT_LOW,    LP_LIMIT_LOW,              -1,         -1,         -1,                  -1,     RUNNING,      STOP,              STOP,               -1,                -1,            -1,            -1,              -1,   -1,
@@ -192,7 +192,7 @@ void Atm_AccelStepper::action( int id ) {
       stepper_update();
 
       if(runMode && _currentSpeed == 0.) {trigger(EVT_EMERGENCY_STOP);}//trigger(EVT_ON_TARGET);
-      if(!runMode && (_currentStep==_targetStep)){trigger(EVT_EMERGENCY_STOP);}
+      if(!runMode && (_currentStep==_targetStep)){push( connectors, ON_ONTARGET, 0, _currentStep, 0 );trigger(EVT_EMERGENCY_STOP);}
       return;
 
     case ENT_STOP: