titi 5 years ago
parent
commit
b1d521eaf0
1 changed files with 27 additions and 4 deletions
  1. 27 4
      Atm_AccelStepper.cpp

+ 27 - 4
Atm_AccelStepper.cpp

@@ -187,14 +187,37 @@ void Atm_AccelStepper::action( int id ) {
       push( connectors, ON_ONLIMITLOW, 0, 0, 0 );
       //stop motor if going down, allow going up
       if(_limitLow_Hard && (stepper->speed()<0) ) {trigger(EVT_EMERGENCY_STOP);}
-      else{
-        stepper_update();
-         switch(_isHoming) trigger.EVT_HOMINGtrigger(EVT_MOVE);}
+      else{ stepper_update(); _isHoming ? trigger(EVT_ENABLE):trigger(EVT_MOVE);}
+       //   switch(_isHoming) {
+       //     case 0 :
+       //      trigger(EVT_MOVE);
+       //      break;
+       //     case 1 :
+       //      trigger(EVT_HOMING_LOW);
+       //      break;
+       //     case 2 :
+       //      trigger(EVT_HOMING_HIGH);
+       //      break;
+       //   }
+       // }
       return;
     case ENT_LIMIT_HIGH:
       push( connectors, ON_ONLIMITHIGH, 0, 1, 0 );
       if(_limitHigh_Hard && (stepper->speed()>0)) {trigger(EVT_EMERGENCY_STOP);}
-      else{stepper_update(); trigger(EVT_MOVE);}
+      else{ stepper_update(); _isHoming ? trigger(EVT_ENABLE):trigger(EVT_MOVE);}
+       //  stepper_update();
+       //   switch(_isHoming) {
+       //     case 0 :
+       //      trigger(EVT_MOVE);
+       //      break;
+       //     case 1 :
+       //      trigger(EVT_HOMING_HIGH);
+       //      break;
+       //     case 2 :
+       //      trigger(EVT_HOMING_HIGH);
+       //      break;
+       //   }
+       // }
       return;
   }
 }