|
|
|
|
@ -151,24 +151,15 @@ bool SF_MoveMotorToZeroPosition(SF_Handle_t instance){ |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// turn until sensor is on and not reached one full rotation already (timeout)
|
|
|
|
|
// while(SF_GetMagSensorAtZeroPosition((SF_t*)instance) == false && numStepsMoved < SPLITFLAP_STEPS_ONE_ROUND ){
|
|
|
|
|
// McuULN2003_IncStep(((SF_t*)instance)->motor);
|
|
|
|
|
//#ifdef McuLib_CONFIG_SDK_USE_FREERTOS
|
|
|
|
|
// vTaskDelay(pdMS_TO_TICKS(20));
|
|
|
|
|
//#else
|
|
|
|
|
// McuWait_Waitms(20);
|
|
|
|
|
//#endif
|
|
|
|
|
// numStepsMoved++;
|
|
|
|
|
// }
|
|
|
|
|
McuULN2003_AccelerationStart(((SF_t*)instance)->motor); |
|
|
|
|
while(SF_GetMagSensorAtZeroPosition((SF_t*)instance) == false && numStepsMoved < SPLITFLAP_STEPS_ONE_ROUND){ |
|
|
|
|
if(McuULN2003_StepCallback(((SF_t*)instance)->motor, true)){ |
|
|
|
|
numStepsMoved++; |
|
|
|
|
} |
|
|
|
|
#ifdef McuLib_CONFIG_SDK_USE_FREERTOS |
|
|
|
|
vTaskDelay(pdMS_TO_TICKS(20)); |
|
|
|
|
vTaskDelay(pdMS_TO_TICKS(1)); |
|
|
|
|
#else |
|
|
|
|
McuWait_Waitms(20); |
|
|
|
|
McuWait_Waitms(1); |
|
|
|
|
#endif |
|
|
|
|
} |
|
|
|
|
McuULN2003_AccelerationEnd(((SF_t*)instance)->motor); |
|
|
|
|
|