ソースを参照

Reset system topic

Bartosz Jakubski 4 ヶ月 前
コミット
c36e5503e3

+ 1 - 0
OZE_Main/Core/Inc/serial_protocol.h

@@ -44,6 +44,7 @@ enum _SerialProtocolCommands {
     spSetVoltageMeasOffsets,
     spSetCurrentMeasGains,
     spSetCurrentMeasOffsets,
+	spResetSystem,
     spUnknown
 };
 

+ 1 - 0
OZE_Main/Core/Src/main.c

@@ -845,6 +845,7 @@ void Error_Handler(void)
   /* USER CODE BEGIN Error_Handler_Debug */
   /* User can add his own implementation to report the HAL error return state */
   __disable_irq();
+  NVIC_SystemReset();
   while (1)
   {
   }

+ 151 - 117
OZE_Main/Core/Src/mqtt_client.c

@@ -24,9 +24,9 @@
 #define MQTT_BUFSIZE	1024
 
 char* const subscribeTopicNames[MASTER_BOARD + SLAVES_COUNT] = { "Set/0", "Set/1", "Set/2", "Set/3", "Set/4" };
-#define MAX_COMMANDS_IN_MQTT_PAYLOAD 14
+#define MAX_COMMANDS_IN_MQTT_PAYLOAD 15
 char* const topicCommands[MAX_COMMANDS_IN_MQTT_PAYLOAD] = { "fanSpeed", "motorXon", "motorYon", "diode", "motorXMaxCurrent", "motorYMaxCurrent", "clearPeakElectricalMeasurements", "mainBoardRelay",
-    "setEncoderXValue", "setEncoderYValue", "setVoltageMeasGains", "setVoltageMeasOffsets", "setCurrentMeasGains", "setCurrentMeasOffsets" };
+    "setEncoderXValue", "setEncoderYValue", "setVoltageMeasGains", "setVoltageMeasOffsets", "setCurrentMeasGains", "setCurrentMeasOffsets", "resetSystem" };
 
 enum _Topics
 {
@@ -43,7 +43,8 @@ enum _Topics
 	setVoltageMeasGains,
 	setVoltageMeasOffsets,
 	setCurrentMeasGains,
-	setCurrentMeasOffsets
+	setCurrentMeasOffsets,
+	resetSystem,
 };
 
 enum _BoardNoOverTopic
@@ -295,141 +296,174 @@ void MqttMessageArrived (MessageData* msg) {
             break;
         }
     }
+    if (topicForBoard == unknownBoard) {
+        return;
+    }
 
     cJSON* json             = cJSON_Parse (message->payload);
     const cJSON* objectItem = NULL;
     InterProcessData data   = { 0 };
     uint32_t arraySize      = 0;
-    for (int topicCmdNumber = 0; topicCmdNumber < MAX_COMMANDS_IN_MQTT_PAYLOAD; topicCmdNumber++) {
-        spCommand  = spUnknown;
-        objectItem = cJSON_GetObjectItemCaseSensitive (json, topicCommands[topicCmdNumber]);
-        if (objectItem != NULL) {
-            switch (topicCmdNumber) {
-            case fanSpeedTopic: spCommand = spSetFanSpeed;
-            case motorXonTopic:
-                if (spCommand == spUnknown) {
-                    spCommand = spSetMotorXOn;
-                }
-            case motorYonTopic:
-                if (spCommand == spUnknown) {
-                    spCommand = spSetMotorYOn;
-                }
-                if (cJSON_IsArray (objectItem)) {
-                    data.spCommand = spCommand;
-                    arraySize      = cJSON_GetArraySize (objectItem);
-                    if (arraySize == 2) {
-                        for (int i = 0; i < arraySize; i++) {
-                            cJSON* item = cJSON_GetArrayItem (objectItem, i);
-                            if (cJSON_IsNumber (item)) {
-                                data.values.integerValues.value[i] = item->valueint;
+    if (topicForBoard != main_board) {
+        for (int topicCmdNumber = 0; topicCmdNumber < MAX_COMMANDS_IN_MQTT_PAYLOAD; topicCmdNumber++) {
+            spCommand  = spUnknown;
+            objectItem = cJSON_GetObjectItemCaseSensitive (json, topicCommands[topicCmdNumber]);
+            if (objectItem != NULL) {
+                switch (topicCmdNumber) {
+                case fanSpeedTopic: spCommand = spSetFanSpeed;
+                case motorXonTopic:
+                    if (spCommand == spUnknown) {
+                        spCommand = spSetMotorXOn;
+                    }
+                case motorYonTopic:
+                    if (spCommand == spUnknown) {
+                        spCommand = spSetMotorYOn;
+                    }
+                    if (cJSON_IsArray (objectItem)) {
+                        data.spCommand = spCommand;
+                        arraySize      = cJSON_GetArraySize (objectItem);
+                        if (arraySize == 2) {
+                            for (int i = 0; i < arraySize; i++) {
+                                cJSON* item = cJSON_GetArrayItem (objectItem, i);
+                                if (cJSON_IsNumber (item)) {
+                                    data.values.integerValues.value[i] = item->valueint;
+                                }
                             }
                         }
                     }
-                }
-                break;
-            case diodeTopic:
-                data.spCommand                     = spSetDiodeOn;
-                data.values.integerValues.value[0] = objectItem->valueint;
-                data.values.integerValues.value[1] = 0;
-                break;
-            case motorXMaxCurrentTopic: spCommand = spSetmotorXMaxCurrent;
-            case motorYMaxCurrentTopic:
-                if (spCommand == spUnknown) {
-                    spCommand = spSetmotorYMaxCurrent;
-                }
-                data.spCommand                   = spCommand;
-                data.values.flaotValues.value[0] = objectItem->valuedouble;
-                data.values.flaotValues.value[1] = 0.0;
-                break;
-            case clearPeakElectricalMeasurementsTopic: data.spCommand = spClearPeakMeasurments; break;
-            case mainBoardRelayTopic:
-                if (cJSON_IsArray (objectItem)) {
-                    arraySize = cJSON_GetArraySize (objectItem);
-                    if (arraySize == 2) {
-                        int32_t relayNumber = -1;
-                        cJSON* item         = cJSON_GetArrayItem (objectItem, 0);
-                        if (cJSON_IsNumber (item)) {
-                            relayNumber = item->valueint;
+                    break;
+                case diodeTopic:
+                    if (cJSON_IsNumber (objectItem)) {
+                        data.spCommand                     = spSetDiodeOn;
+                        data.values.integerValues.value[0] = objectItem->valueint;
+                    }
+                    break;
+                case motorXMaxCurrentTopic: spCommand = spSetmotorXMaxCurrent;
+                case motorYMaxCurrentTopic:
+                    if (cJSON_IsNumber (objectItem)) {
+                        if (spCommand == spUnknown) {
+                            spCommand = spSetmotorYMaxCurrent;
                         }
-                        int32_t relayTimeOn = 0;
-                        item                = cJSON_GetArrayItem (objectItem, 1);
-                        if (cJSON_IsNumber (item)) {
-                            relayTimeOn = item->valueint;
+                        data.spCommand                   = spCommand;
+                        data.values.flaotValues.value[0] = objectItem->valuedouble;
+                    }
+                    break;
+                case clearPeakElectricalMeasurementsTopic:
+                    if (cJSON_IsNumber (objectItem)) {
+                        if (objectItem->valueint == 1) {
+                            data.spCommand = spClearPeakMeasurments;
                         }
-                        RelayCtrl (relayNumber, relayTimeOn);
                     }
-                }
-                break;
-            case setEncoderXValue:
-                data.spCommand                   = spSetEncoderXValue;
-                data.values.flaotValues.value[0] = objectItem->valuedouble;
-                data.values.flaotValues.value[1] = 0;
-                break;
-            case setEncoderYValue:
-                data.spCommand                   = spSetEncoderYValue;
-                data.values.flaotValues.value[0] = objectItem->valuedouble;
-                data.values.flaotValues.value[1] = 0;
-                break;
-            case setVoltageMeasGains:
-            	spCommand = spSetVoltageMeasGains;
-            case setVoltageMeasOffsets:
-                if (spCommand == spUnknown) {
-                    spCommand = spSetVoltageMeasOffsets;
-                }
-            case setCurrentMeasGains:
-                if (spCommand == spUnknown) {
-                    spCommand = spSetCurrentMeasGains;
-                }
-            case setCurrentMeasOffsets:
-                if (spCommand == spUnknown) {
-                    spCommand = spSetCurrentMeasOffsets;
-                }
-                if (cJSON_IsArray (objectItem)) {
-                    data.spCommand = spCommand;
-                    arraySize      = cJSON_GetArraySize (objectItem);
-                    if (arraySize == 3) {
-                        for (int i = 0; i < arraySize; i++) {
-                            cJSON* item = cJSON_GetArrayItem (objectItem, i);
+                    break;
+                case mainBoardRelayTopic:
+                    if (cJSON_IsArray (objectItem)) {
+                        arraySize = cJSON_GetArraySize (objectItem);
+                        if (arraySize == 2) {
+                            int32_t relayNumber = -1;
+                            cJSON* item         = cJSON_GetArrayItem (objectItem, 0);
                             if (cJSON_IsNumber (item)) {
-                                data.values.flaotValues.value[i] = item->valuedouble;
+                                relayNumber = item->valueint;
                             }
+                            int32_t relayTimeOn = 0;
+                            item                = cJSON_GetArrayItem (objectItem, 1);
+                            if (cJSON_IsNumber (item)) {
+                                relayTimeOn = item->valueint;
+                            }
+                            RelayCtrl (relayNumber, relayTimeOn);
                         }
                     }
+                    break;
+                case setEncoderXValue:
+                    if (cJSON_IsNumber (objectItem)) {
+                        data.spCommand                   = spSetEncoderXValue;
+                        data.values.flaotValues.value[0] = objectItem->valuedouble;
+                    }
+                    break;
+                case setEncoderYValue:
+                    if (cJSON_IsNumber (objectItem)) {
+                        data.spCommand                   = spSetEncoderYValue;
+                        data.values.flaotValues.value[0] = objectItem->valuedouble;
+                    }
+                    break;
+                case setVoltageMeasGains: spCommand = spSetVoltageMeasGains;
+                case setVoltageMeasOffsets:
+                    if (spCommand == spUnknown) {
+                        spCommand = spSetVoltageMeasOffsets;
+                    }
+                case setCurrentMeasGains:
+                    if (spCommand == spUnknown) {
+                        spCommand = spSetCurrentMeasGains;
+                    }
+                case setCurrentMeasOffsets:
+                    if (spCommand == spUnknown) {
+                        spCommand = spSetCurrentMeasOffsets;
+                    }
+                    if (cJSON_IsArray (objectItem)) {
+                        data.spCommand = spCommand;
+                        arraySize      = cJSON_GetArraySize (objectItem);
+                        if (arraySize == 3) {
+                            for (int i = 0; i < arraySize; i++) {
+                                cJSON* item = cJSON_GetArrayItem (objectItem, i);
+                                if (cJSON_IsNumber (item)) {
+                                    data.values.flaotValues.value[i] = item->valuedouble;
+                                }
+                            }
+                        }
+                    }
+                    break;
+                case resetSystem:
+                    if (cJSON_IsNumber (objectItem)) {
+                        if (objectItem->valueint == 1) {
+                            data.spCommand = spResetSystem;
+                            break;
+                        }
+                    }
+                default: break;
                 }
-            	break;
-            default: break;
             }
-
-            switch (topicForBoard) {
-            case main_board: break;
-            case board_1:
-                if (uart1TaskData.sendCmdToSlaveQueue != NULL) {
-                    osMessageQueuePut (uart1TaskData.sendCmdToSlaveQueue, &data, 0, (TickType_t)100);
-                }
-                printf ("Send cmd to board 1\n");
-                break;
-            case board_2:
-                if (uart3TaskData.sendCmdToSlaveQueue != NULL) {
-                    osMessageQueuePut (uart3TaskData.sendCmdToSlaveQueue, &data, 0, (TickType_t)100);
-                }
-                printf ("Send cmd to board 2\n");
-                break;
-            case board_3:
-                if (uart6TaskData.sendCmdToSlaveQueue != NULL) {
-                    osMessageQueuePut (uart6TaskData.sendCmdToSlaveQueue, &data, 0, (TickType_t)100);
-                }
-                printf ("Send cmd to board 3\n");
-                break;
-            case board_4:
-                if (uart2TaskData.sendCmdToSlaveQueue != NULL) {
-                    osMessageQueuePut (uart2TaskData.sendCmdToSlaveQueue, &data, 0, (TickType_t)100);
+        }
+    } else {
+        for (int topicCmdNumber = 0; topicCmdNumber < MAX_COMMANDS_IN_MQTT_PAYLOAD; topicCmdNumber++) {
+            objectItem = cJSON_GetObjectItemCaseSensitive (json, topicCommands[topicCmdNumber]);
+            if (objectItem != NULL) {
+                if (topicCmdNumber == resetSystem) {
+                    __disable_irq ();
+                    NVIC_SystemReset ();
+                    break;
                 }
-                printf ("Send cmd to board 4\n");
-                break;
-            default: break;
             }
         }
     }
+
+    switch (topicForBoard) {
+    case main_board: break;
+    case board_1:
+        if (uart1TaskData.sendCmdToSlaveQueue != NULL) {
+            osMessageQueuePut (uart1TaskData.sendCmdToSlaveQueue, &data, 0, (TickType_t)100);
+        }
+        printf ("Send cmd to board 1\n");
+        break;
+    case board_2:
+        if (uart3TaskData.sendCmdToSlaveQueue != NULL) {
+            osMessageQueuePut (uart3TaskData.sendCmdToSlaveQueue, &data, 0, (TickType_t)100);
+        }
+        printf ("Send cmd to board 2\n");
+        break;
+    case board_3:
+        if (uart6TaskData.sendCmdToSlaveQueue != NULL) {
+            osMessageQueuePut (uart6TaskData.sendCmdToSlaveQueue, &data, 0, (TickType_t)100);
+        }
+        printf ("Send cmd to board 3\n");
+        break;
+    case board_4:
+        if (uart2TaskData.sendCmdToSlaveQueue != NULL) {
+            osMessageQueuePut (uart2TaskData.sendCmdToSlaveQueue, &data, 0, (TickType_t)100);
+        }
+        printf ("Send cmd to board 4\n");
+        break;
+    default: break;
+    }
+
     cJSON_Delete (json);
     printf ("MQTT Topic:%s, MSG[%d]:%s\n", topicName, (int)message->payloadlen, (char*)message->payload);
 }

+ 51 - 55
OZE_Main/Core/Src/uart_tasks.c

@@ -342,8 +342,8 @@ void UartTxTask (void* argument) {
     uint32_t rndVal                     = 0;
     uint16_t bytesToSend                = 0;
     SerialProtocolCommands frameCommand = spUnknown;
-    uint16_t inputDataBufferPos = 0;
-    uint8_t boardNumber = 0;
+    uint16_t inputDataBufferPos         = 0;
+    uint8_t boardNumber                 = 0;
 
     while (pdTRUE) {
         if (uartTaskData->sendCmdToSlaveQueue != NULL) {
@@ -372,74 +372,70 @@ void UartTxTask (void* argument) {
             case spSetVoltageMeasOffsets:
             case spSetCurrentMeasGains:
             case spSetCurrentMeasOffsets:
-            	WriteDataToBuffer (outputDataBuffer, &outputDataBufferPos, &data.values.flaotValues.value[0], sizeof (float));
-            	WriteDataToBuffer (outputDataBuffer, &outputDataBufferPos, &data.values.flaotValues.value[1], sizeof (float));
-            	WriteDataToBuffer (outputDataBuffer, &outputDataBufferPos, &data.values.flaotValues.value[2], sizeof (float));
-            	break;
+                WriteDataToBuffer (outputDataBuffer, &outputDataBufferPos, &data.values.flaotValues.value[0], sizeof (float));
+                WriteDataToBuffer (outputDataBuffer, &outputDataBufferPos, &data.values.flaotValues.value[1], sizeof (float));
+                WriteDataToBuffer (outputDataBuffer, &outputDataBufferPos, &data.values.flaotValues.value[2], sizeof (float));
+                break;
+            case spResetSystem: break;
             default: continue; break;
             }
 
             bytesToSend = PrepareReqFrame (uartTaskData->uartTxBuffer, frameId, frameCommand, outputDataBuffer, outputDataBufferPos);
             HAL_UART_Transmit_IT (uartTaskData->huart, uartTaskData->uartTxBuffer, bytesToSend);
             bytesInMsg = xMessageBufferReceive (uartTaskData->processRxDataMsgBuffer, &frameData, INPUT_DATA_BUFF_SIZE, pdMS_TO_TICKS (1000));
-        	for(boardNumber = 0; boardNumber < SLAVES_COUNT; boardNumber++)
-        	{
-        		if(boardToUartNumberMap[boardNumber] == uartTaskData->uartNumber)
-        		{
-        			break;
-        		}
-        	}
+            for (boardNumber = 0; boardNumber < SLAVES_COUNT; boardNumber++) {
+                if (boardToUartNumberMap[boardNumber] == uartTaskData->uartNumber) {
+                    break;
+                }
+            }
             if (bytesInMsg == 0) {
-                if (frameCommand == spGetElectricalMeasurments)
-                {
-                	osMutexAcquire (resMeasurementsMutex, osWaitForever);
-                	slaveLastSeen[boardNumber]++;
-                	osMutexRelease(resMeasurementsMutex);
+                if (frameCommand == spGetElectricalMeasurments) {
+                    osMutexAcquire (resMeasurementsMutex, osWaitForever);
+                    slaveLastSeen[boardNumber]++;
+                    osMutexRelease (resMeasurementsMutex);
                 }
                 printf ("Uart%d: Response timeout for frameId 0x%x\n", uartTaskData->uartNumber, frameId);
             } else {
                 if ((frameId == frameData.frameHeader.frameId) && (frameData.frameHeader.respStatus == spOK)) {
                     printf ("Uart%d: Response for frameId 0x%x OK\n", uartTaskData->uartNumber, frameId);
                     slaveLastSeen[boardNumber] = 0;
-                    switch(frameData.frameHeader.frameCommand)
-                    {
+                    switch (frameData.frameHeader.frameCommand) {
                     case spGetElectricalMeasurments:
-                    	osMutexAcquire (resMeasurementsMutex, osWaitForever);
-            			RESMeasurements *resMeas = &resMeasurements[boardNumber];
-                    	inputDataBufferPos = 0;
-                    	ReadMeasSetFromBuffer(frameData.dataBuffer, &inputDataBufferPos, resMeas->voltageRMS);
-                    	ReadMeasSetFromBuffer(frameData.dataBuffer, &inputDataBufferPos, resMeas->voltagePeak);
-                    	ReadMeasSetFromBuffer(frameData.dataBuffer, &inputDataBufferPos, resMeas->currentRMS);
-                    	ReadMeasSetFromBuffer(frameData.dataBuffer, &inputDataBufferPos, resMeas->currentPeak);
-                    	ReadMeasSetFromBuffer(frameData.dataBuffer, &inputDataBufferPos, resMeas->power);
-                    	osMutexRelease(resMeasurementsMutex);
-                    	break;
+                        osMutexAcquire (resMeasurementsMutex, osWaitForever);
+                        RESMeasurements* resMeas = &resMeasurements[boardNumber];
+                        inputDataBufferPos       = 0;
+                        ReadMeasSetFromBuffer (frameData.dataBuffer, &inputDataBufferPos, resMeas->voltageRMS);
+                        ReadMeasSetFromBuffer (frameData.dataBuffer, &inputDataBufferPos, resMeas->voltagePeak);
+                        ReadMeasSetFromBuffer (frameData.dataBuffer, &inputDataBufferPos, resMeas->currentRMS);
+                        ReadMeasSetFromBuffer (frameData.dataBuffer, &inputDataBufferPos, resMeas->currentPeak);
+                        ReadMeasSetFromBuffer (frameData.dataBuffer, &inputDataBufferPos, resMeas->power);
+                        osMutexRelease (resMeasurementsMutex);
+                        break;
                     case spGetSensorMeasurments:
-                    	osMutexAcquire (sensorsInfoMutex, osWaitForever);
-                    	inputDataBufferPos = 0;
-                    	SesnorsInfo* sensors = &sensorsInfo[boardNumber];
-                    	ReadFloatFromBuffer(frameData.dataBuffer, &inputDataBufferPos, &sensors->pvTemperature[0]);
-                    	ReadFloatFromBuffer(frameData.dataBuffer, &inputDataBufferPos, &sensors->pvTemperature[1]);
-                    	ReadFloatFromBuffer(frameData.dataBuffer, &inputDataBufferPos, &sensors->fanVoltage);
-                    	ReadFloatFromBuffer(frameData.dataBuffer, &inputDataBufferPos, &sensors->pvEncoderX);
-                    	ReadFloatFromBuffer(frameData.dataBuffer, &inputDataBufferPos, &sensors->pvEncoderY);
-                    	ReadByteFromBufer(frameData.dataBuffer, &inputDataBufferPos, &sensors->motorXStatus);
-                    	ReadByteFromBufer(frameData.dataBuffer, &inputDataBufferPos, &sensors->motorYStatus);
-                    	ReadFloatFromBuffer(frameData.dataBuffer, &inputDataBufferPos, &sensors->motorXAveCurrent);
-                    	ReadFloatFromBuffer(frameData.dataBuffer, &inputDataBufferPos, &sensors->motorYAveCurrent);
-                    	ReadFloatFromBuffer(frameData.dataBuffer, &inputDataBufferPos, &sensors->motorXPeakCurrent);
-                    	ReadFloatFromBuffer(frameData.dataBuffer, &inputDataBufferPos, &sensors->motorYPeakCurrent);
-                    	ReadByteFromBufer(frameData.dataBuffer, &inputDataBufferPos, &sensors->limitXSwitchUp);
-                    	ReadByteFromBufer(frameData.dataBuffer, &inputDataBufferPos, &sensors->limitXSwitchDown);
-                    	ReadByteFromBufer(frameData.dataBuffer, &inputDataBufferPos, &sensors->limitXSwitchCenter);
-                    	ReadByteFromBufer(frameData.dataBuffer, &inputDataBufferPos, &sensors->limitYSwitchUp);
-                    	ReadByteFromBufer(frameData.dataBuffer, &inputDataBufferPos, &sensors->limitYSwitchDown);
-                    	ReadByteFromBufer(frameData.dataBuffer, &inputDataBufferPos, &sensors->limitYSwitchCenter);
-                    	ReadByteFromBufer(frameData.dataBuffer, &inputDataBufferPos, &sensors->powerSupplyFailMask);
-                    	osMutexRelease(sensorsInfoMutex);
-                    	break;
-                    default:
-                    	break;
+                        osMutexAcquire (sensorsInfoMutex, osWaitForever);
+                        inputDataBufferPos   = 0;
+                        SesnorsInfo* sensors = &sensorsInfo[boardNumber];
+                        ReadFloatFromBuffer (frameData.dataBuffer, &inputDataBufferPos, &sensors->pvTemperature[0]);
+                        ReadFloatFromBuffer (frameData.dataBuffer, &inputDataBufferPos, &sensors->pvTemperature[1]);
+                        ReadFloatFromBuffer (frameData.dataBuffer, &inputDataBufferPos, &sensors->fanVoltage);
+                        ReadFloatFromBuffer (frameData.dataBuffer, &inputDataBufferPos, &sensors->pvEncoderX);
+                        ReadFloatFromBuffer (frameData.dataBuffer, &inputDataBufferPos, &sensors->pvEncoderY);
+                        ReadByteFromBufer (frameData.dataBuffer, &inputDataBufferPos, &sensors->motorXStatus);
+                        ReadByteFromBufer (frameData.dataBuffer, &inputDataBufferPos, &sensors->motorYStatus);
+                        ReadFloatFromBuffer (frameData.dataBuffer, &inputDataBufferPos, &sensors->motorXAveCurrent);
+                        ReadFloatFromBuffer (frameData.dataBuffer, &inputDataBufferPos, &sensors->motorYAveCurrent);
+                        ReadFloatFromBuffer (frameData.dataBuffer, &inputDataBufferPos, &sensors->motorXPeakCurrent);
+                        ReadFloatFromBuffer (frameData.dataBuffer, &inputDataBufferPos, &sensors->motorYPeakCurrent);
+                        ReadByteFromBufer (frameData.dataBuffer, &inputDataBufferPos, &sensors->limitXSwitchUp);
+                        ReadByteFromBufer (frameData.dataBuffer, &inputDataBufferPos, &sensors->limitXSwitchDown);
+                        ReadByteFromBufer (frameData.dataBuffer, &inputDataBufferPos, &sensors->limitXSwitchCenter);
+                        ReadByteFromBufer (frameData.dataBuffer, &inputDataBufferPos, &sensors->limitYSwitchUp);
+                        ReadByteFromBufer (frameData.dataBuffer, &inputDataBufferPos, &sensors->limitYSwitchDown);
+                        ReadByteFromBufer (frameData.dataBuffer, &inputDataBufferPos, &sensors->limitYSwitchCenter);
+                        ReadByteFromBufer (frameData.dataBuffer, &inputDataBufferPos, &sensors->powerSupplyFailMask);
+                        osMutexRelease (sensorsInfoMutex);
+                        break;
+                    default: break;
                     }
                 }
             }

ファイルの差分が大きいため隠しています
+ 75644 - 75460
OZE_Main/Debug/OZE_Main.list


ファイルの差分が大きいため隠しています
+ 2442 - 2439
OZE_Main/Debug/OZE_Main.map


+ 1 - 0
OZE_Sensor/Core/Inc/serial_protocol.h

@@ -44,6 +44,7 @@ enum _SerialProtocolCommands {
     spSetVoltageMeasOffsets,
     spSetCurrentMeasGains,
     spSetCurrentMeasOffsets,
+	spResetSystem,
     spUnknown
 };
 

+ 1 - 0
OZE_Sensor/Core/Src/main.c

@@ -1579,6 +1579,7 @@ void Error_Handler(void)
   /* USER CODE BEGIN Error_Handler_Debug */
   /* User can add his own implementation to report the HAL error return state */
   __disable_irq();
+  NVIC_SystemReset();
   while (1)
   {
   }

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

@@ -505,6 +505,10 @@ void Uart1ReceivedDataProcessCallback (void* arg, SerialProtocolFrameData* spFra
             respStatus = spInternalError;
         }
         break;
+    case spResetSystem:
+    	__disable_irq();
+    	NVIC_SystemReset();
+    	break;
     default: respStatus = spUnknownCommand; break;
     }
     dataToSend = PrepareRespFrame (uartTaskData->uartTxBuffer, spFrameData->frameHeader.frameId, spFrameData->frameHeader.frameCommand, respStatus, outputDataBuffer, outputDataBufferPos);

ファイルの差分が大きいため隠しています
+ 41456 - 41381
OZE_Sensor/Debug/OZE_Sensor.list


ファイルの差分が大きいため隠しています
+ 1282 - 1279
OZE_Sensor/Debug/OZE_Sensor.map