Messa in campo 4 file - 26/06/2020 Francia

Dependencies:   mbed X_NUCLEO_IHM03A1_for

Fork of FORIGO_Modula_V7_3_VdcStep_maggio2020 by Francesco Pistone

Revision:
21:3e6576c2e126
Parent:
20:4a400a4cc419
Child:
22:2136dcad1dbc
--- a/main.cpp	Fri Apr 26 13:46:42 2019 +0000
+++ b/main.cpp	Thu May 02 07:51:08 2019 +0000
@@ -1966,19 +1966,21 @@
                     cntCellsForReload++;
                     if (cntCellsForReload >= cellsCountSet) {
                         TBmotorDirecti=TBforward;       // rotazione normale
-                        #if defined(runner)
-                            #if defined(Zucca)
-                                motor->run(StepperMotor::BWD);
+                        if (tractorSpeed_MtS_timed>0.0f){
+                            #if defined(runner)
+                                #if defined(Zucca)
+                                    motor->run(StepperMotor::BWD);
+                                #else
+                                    motor->run(StepperMotor::FWD);
+                                #endif
                             #else
-                                motor->run(StepperMotor::FWD);
+                                #if defined(Zucca)
+                                    motor->step_clock_mode_enable(StepperMotor::FWD);
+                                #else
+                                    motor->step_clock_mode_enable(StepperMotor::FWD);
+                                #endif
                             #endif
-                        #else
-                            #if defined(Zucca)
-                                motor->step_clock_mode_enable(StepperMotor::FWD);
-                            #else
-                                motor->step_clock_mode_enable(StepperMotor::FWD);
-                            #endif
-                        #endif
+                        }
                         erroreTamburo=0;
                         cntCellsCorrect=0;
                     }
@@ -2003,19 +2005,21 @@
                     if (cellsCountSet>1){
                         erroreTamburo=1;
                         TBmotorDirecti=TBreverse;       // rotazione inversa
-                        #if defined(runner)
-                            #if defined(Zucca)
-                                motor->run(StepperMotor::FWD);
+                        if (tractorSpeed_MtS_timed>0.0f){
+                            #if defined(runner)
+                                #if defined(Zucca)
+                                    motor->run(StepperMotor::FWD);
+                                #else
+                                    motor->run(StepperMotor::BWD);
+                                #endif
                             #else
-                                motor->run(StepperMotor::BWD);
+                                #if defined(Zucca)
+                                    motor->step_clock_mode_enable(StepperMotor::FWD);
+                                #else
+                                    motor->step_clock_mode_enable(StepperMotor::BWD);
+                                #endif
                             #endif
-                        #else
-                            #if defined(Zucca)
-                                motor->step_clock_mode_enable(StepperMotor::FWD);
-                            #else
-                                motor->step_clock_mode_enable(StepperMotor::BWD);
-                            #endif
-                        #endif
+                        }
                     }
                     cntCellsForReload=0;
                     if (tractorSpeed_MtS_timed>0.0f){