Procházet zdrojové kódy

Weak status update

Bartosz Jakubski před 1 měsícem
rodič
revize
06fb43cfac

+ 0 - 4
OZE_Sensor/Core/Src/meas_tasks.c

@@ -313,7 +313,6 @@ void LimiterSwitchTask (void* arg) {
             pinStates                      = (limitXSwitchCenterPrevState << 1) | sensorsInfo.limitXSwitchCenter;
             if ((pinStates & 0x3) == 0x1) {
                 sensorsInfo.positionXOffset = AXE_X_MIDDLE_VALUE - sensorsInfo.currentXPosition;
-                ;
                 sensorsInfo.positionXWeak = 0;
             }
             limitXSwitchCenterPrevState = sensorsInfo.limitXSwitchCenter;
@@ -323,7 +322,6 @@ void LimiterSwitchTask (void* arg) {
             if ((pinStates & 0x3) == 0x1) {
                 limiterYTriggered           = 1;
                 sensorsInfo.positionYOffset = 0 - sensorsInfo.currentYPosition;
-                ;
                 sensorsInfo.positionYWeak = 0;
             }
             limitYSwitchDownPrevState = sensorsInfo.limitYSwitchDown;
@@ -333,7 +331,6 @@ void LimiterSwitchTask (void* arg) {
             if ((pinStates & 0x3) == 0x1) {
                 limiterYTriggered           = 1;
                 sensorsInfo.positionYOffset = 100 - sensorsInfo.currentYPosition;
-                ;
                 sensorsInfo.positionYWeak = 0;
             }
             limitYSwitchUpPrevState = sensorsInfo.limitYSwitchUp;
@@ -342,7 +339,6 @@ void LimiterSwitchTask (void* arg) {
             pinStates                      = (limitYSwitchCenterPrevState << 1) | sensorsInfo.limitYSwitchCenter;
             if ((pinStates & 0x3) == 0x1) {
                 sensorsInfo.currentYPosition = AXE_Y_MIDDLE_VALUE - sensorsInfo.currentYPosition;
-                ;
                 sensorsInfo.positionYWeak = 0;
             }
             limitYSwitchCenterPrevState = sensorsInfo.limitYSwitchCenter;

+ 2 - 2
OZE_Sensor/Core/Src/uart_tasks.c

@@ -453,6 +453,7 @@ void Uart1ReceivedDataProcessCallback (void* arg, SerialProtocolFrameData* spFra
         float enocoderXValue = 0;
         ReadWordFromBufer (spFrameData->dataBuffer, &inputDataBufferPos, (uint32_t*)&enocoderXValue);
         if (osMutexAcquire (sensorsInfoMutex, osWaitForever) == osOK) {
+            sensorsInfo.positionXWeak   = 1;
             sensorsInfo.positionXOffset = enocoderXValue - sensorsInfo.currentXPosition;
             osMutexRelease (sensorsInfoMutex);
             respStatus = spOK;
@@ -464,6 +465,7 @@ void Uart1ReceivedDataProcessCallback (void* arg, SerialProtocolFrameData* spFra
         float enocoderYValue = 0;
         ReadWordFromBufer (spFrameData->dataBuffer, &inputDataBufferPos, (uint32_t*)&enocoderYValue);
         if (osMutexAcquire (sensorsInfoMutex, osWaitForever) == osOK) {
+            sensorsInfo.positionYWeak   = 1;
             sensorsInfo.positionYOffset = enocoderYValue - sensorsInfo.currentYPosition;
             osMutexRelease (sensorsInfoMutex);
             respStatus = spOK;
@@ -522,7 +524,6 @@ void Uart1ReceivedDataProcessCallback (void* arg, SerialProtocolFrameData* spFra
     case spSetPositonX:
     	PositionControlTaskData posXData  __attribute__ ((aligned (32))) = { 0 };
         if (osMutexAcquire (sensorsInfoMutex, osWaitForever) == osOK) {
-        	sensorsInfo.positionXWeak = 1;
             osMutexRelease (sensorsInfoMutex);
         }
     	if (positionXControlTaskInitArg.positionSettingQueue != NULL)
@@ -533,7 +534,6 @@ void Uart1ReceivedDataProcessCallback (void* arg, SerialProtocolFrameData* spFra
     	break;
     case spSetPositonY:
         if (osMutexAcquire (sensorsInfoMutex, osWaitForever) == osOK) {
-        	sensorsInfo.positionYWeak = 1;
             osMutexRelease (sensorsInfoMutex);
         }
     	PositionControlTaskData posYData __attribute__ ((aligned (32))) = { 0 };