diff options
| author | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-12-13 17:36:26 +0200 |
|---|---|---|
| committer | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-12-13 17:36:26 +0200 |
| commit | b279560f0b4dfdd16dea6b70975dfc1961b8d61e (patch) | |
| tree | ed4da72f9f77cc9dbec7405533e331ed9dc074ea /Software | |
| parent | 97ea085d1fac43aedc5258486ef355eb13abc195 (diff) | |
| parent | 677b58ea79beb4a6ff4643b7099f0eeb7b9c3a64 (diff) | |
| download | Tango-b279560f0b4dfdd16dea6b70975dfc1961b8d61e.tar.gz Tango-b279560f0b4dfdd16dea6b70975dfc1961b8d61e.zip | |
Merge branch 'master' of https://twinetfs.visualstudio.com/_git/Tango
Diffstat (limited to 'Software')
51 files changed, 880 insertions, 205 deletions
diff --git a/Software/Embedded_SW/Embedded/Common/SWUpdate/FileSystem.c b/Software/Embedded_SW/Embedded/Common/SWUpdate/FileSystem.c index 6b7e816c4..c1f673745 100644 --- a/Software/Embedded_SW/Embedded/Common/SWUpdate/FileSystem.c +++ b/Software/Embedded_SW/Embedded/Common/SWUpdate/FileSystem.c @@ -77,7 +77,7 @@ uint32_t FileUploadRequestFunc(MessageContainer* requestContainer) Fresult = FR_DENIED; else { - Fresult = f_open(FileHandle,request->filename,FA_READ | FA_WRITE | FA_OPEN_ALWAYS ); + Fresult = f_open(FileHandle,request->path,FA_READ | FA_WRITE | FA_OPEN_ALWAYS ); if (Fresult == FR_OK) { FileLength = request->length; diff --git a/Software/Embedded_SW/Embedded/Common/SW_Info/SW_Info.c b/Software/Embedded_SW/Embedded/Common/SW_Info/SW_Info.c index 0f8f8a22a..2da8581c0 100644 --- a/Software/Embedded_SW/Embedded/Common/SW_Info/SW_Info.c +++ b/Software/Embedded_SW/Embedded/Common/SW_Info/SW_Info.c @@ -20,7 +20,7 @@ typedef struct } TangoVersion_t; -TangoVersion_t _gTangoVersion = {001,002,000,002}; +TangoVersion_t _gTangoVersion = {001,002,002,000}; #define BUILD_DATE __DATE__ char Dat[50] = BUILD_DATE; char _gTangoName [MAX_STRING_LEN] = "Tango01 ";//d diff --git a/Software/Embedded_SW/Embedded/Common/Utilities/Update.c b/Software/Embedded_SW/Embedded/Common/Utilities/Update.c new file mode 100644 index 000000000..422c1632b --- /dev/null +++ b/Software/Embedded_SW/Embedded/Common/Utilities/Update.c @@ -0,0 +1,110 @@ + +#include "include.h" +//#include <stdbool.h> +#include <ti/sysbios/knl/Semaphore.h> +#include <ti/sysbios/BIOS.h> + +#include <driverlib/rom.h> +#include <driverlib/sysctl.h> +#include <driverlib/usb.h> +#include <usblib/usblib.h> +#include <usblib/device/usbdevice.h> +#include <inc/hw_nvic.h> +#include <inc/hw_types.h> +#include <inc/hw_memmap.h> + + +#include "Drivers/USB_Communication/USBCDCD.h" + + +extern Semaphore_Handle updateSem; + + +void UpdateUsb(void) +{ + // + // Terminate the USB device and detach from the bus. + // + USBDCDTerm(0); + + // + // Disable all interrupts. + // + ROM_IntMasterDisable(); + + // + // Disable SysTick and its interrupt. + // + ROM_SysTickIntDisable(); + ROM_SysTickDisable(); + + // + // Disable all processor interrupts. Instead of disabling them one at a + // time, a direct write to NVIC is done to disable all peripheral + // interrupts. + // + HWREG(NVIC_DIS0) = 0xffffffff; + HWREG(NVIC_DIS1) = 0xffffffff; + HWREG(NVIC_DIS2) = 0xffffffff; + HWREG(NVIC_DIS3) = 0xffffffff; + HWREG(NVIC_DIS4) = 0xffffffff; + + // + // Enable and reset the USB peripheral. + // + ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_USB0); + ROM_SysCtlPeripheralReset(SYSCTL_PERIPH_USB0); + ROM_USBClockEnable(USB0_BASE, 8, USB_CLOCK_INTERNAL); + + // + // Wait for about a second. + // + ROM_SysCtlDelay(SYS_CLK_FREQ / 3); + + // + // Re-enable interrupts at the NVIC level. + // + ROM_IntMasterEnable(); + + // + // Call the USB boot loader. + // + ROM_UpdateUSB(0); + + // + // Should never get here, but just in case. + // + while(1) + { + } +} + +Void updateTask(UArg arg0, UArg arg1) +{ + + // + // Wait until new updTE ARRIVED + // + Semaphore_pend(updateSem, BIOS_WAIT_FOREVER); + UpdateUsb(); +} +extern Semaphore_Handle ReconnectSem; + + +void ReconnectUsb(void) +{ + //USBCDC_close(); +} + +Void ReconnectTask(UArg arg0, UArg arg1) +{ + + // + // Wait until new updTE ARRIVED + // + while (1) + { + Semaphore_pend(ReconnectSem, BIOS_WAIT_FOREVER); + ReconnectUsb(); + } +} diff --git a/Software/Embedded_SW/Embedded/Communication/PMR/Common/MessageType.pb-c.c b/Software/Embedded_SW/Embedded/Communication/PMR/Common/MessageType.pb-c.c index 864d3e7a7..bd6c3fdd6 100644 --- a/Software/Embedded_SW/Embedded/Communication/PMR/Common/MessageType.pb-c.c +++ b/Software/Embedded_SW/Embedded/Communication/PMR/Common/MessageType.pb-c.c @@ -7,7 +7,7 @@ #endif #include "MessageType.pb-c.h" -static const ProtobufCEnumValue message_type__enum_values_by_number[193] = +static const ProtobufCEnumValue message_type__enum_values_by_number[201] = { { "None", "MESSAGE_TYPE__None", 0 }, { "ErrorResponse", "MESSAGE_TYPE__ErrorResponse", 1 }, @@ -202,14 +202,24 @@ static const ProtobufCEnumValue message_type__enum_values_by_number[193] = { "GetStorageInfoResponse", "MESSAGE_TYPE__GetStorageInfoResponse", 7013 }, { "GetFilesRequest", "MESSAGE_TYPE__GetFilesRequest", 7014 }, { "GetFilesResponse", "MESSAGE_TYPE__GetFilesResponse", 7015 }, + { "FileDownloadRequest", "MESSAGE_TYPE__FileDownloadRequest", 7016 }, + { "FileDownloadResponse", "MESSAGE_TYPE__FileDownloadResponse", 7017 }, + { "FileChunkDownloadRequest", "MESSAGE_TYPE__FileChunkDownloadRequest", 7018 }, + { "FileChunkDownloadResponse", "MESSAGE_TYPE__FileChunkDownloadResponse", 7019 }, + { "ValidateVersionRequest", "MESSAGE_TYPE__ValidateVersionRequest", 7020 }, + { "ValidateVersionResponse", "MESSAGE_TYPE__ValidateVersionResponse", 7021 }, + { "ActivateVersionRequest", "MESSAGE_TYPE__ActivateVersionRequest", 7022 }, + { "ActivateVersionResponse", "MESSAGE_TYPE__ActivateVersionResponse", 7023 }, }; static const ProtobufCIntRange message_type__value_ranges[] = { -{0, 0},{3, 2},{1000, 104},{2000, 113},{3000, 153},{4000, 163},{5000, 167},{6000, 171},{7000, 177},{0, 193} +{0, 0},{3, 2},{1000, 104},{2000, 113},{3000, 153},{4000, 163},{5000, 167},{6000, 171},{7000, 177},{0, 201} }; -static const ProtobufCEnumValueIndex message_type__enum_values_by_name[193] = +static const ProtobufCEnumValueIndex message_type__enum_values_by_name[201] = { { "AbortJobRequest", 155 }, { "AbortJobResponse", 156 }, + { "ActivateVersionRequest", 199 }, + { "ActivateVersionResponse", 200 }, { "CalculateRequest", 2 }, { "CalculateResponse", 3 }, { "ConnectRequest", 173 }, @@ -240,8 +250,12 @@ static const ProtobufCEnumValueIndex message_type__enum_values_by_name[193] = { "ExternalBridgeLogoutRequest", 107 }, { "ExternalBridgeLogoutResponse", 108 }, { "ExternalBridgeUdpDiscoveryPacket", 104 }, + { "FileChunkDownloadRequest", 195 }, + { "FileChunkDownloadResponse", 196 }, { "FileChunkUploadRequest", 179 }, { "FileChunkUploadResponse", 180 }, + { "FileDownloadRequest", 193 }, + { "FileDownloadResponse", 194 }, { "FileUploadRequest", 177 }, { "FileUploadResponse", 178 }, { "GetFilesRequest", 191 }, @@ -401,6 +415,8 @@ static const ProtobufCEnumValueIndex message_type__enum_values_by_name[193] = { "UploadHardwareConfigurationResponse", 168 }, { "UploadProcessParametersRequest", 157 }, { "UploadProcessParametersResponse", 158 }, + { "ValidateVersionRequest", 197 }, + { "ValidateVersionResponse", 198 }, }; const ProtobufCEnumDescriptor message_type__descriptor = { @@ -409,9 +425,9 @@ const ProtobufCEnumDescriptor message_type__descriptor = "MessageType", "MessageType", "", - 193, + 201, message_type__enum_values_by_number, - 193, + 201, message_type__enum_values_by_name, 9, message_type__value_ranges, diff --git a/Software/Embedded_SW/Embedded/Communication/PMR/Common/MessageType.pb-c.h b/Software/Embedded_SW/Embedded/Communication/PMR/Common/MessageType.pb-c.h index acb7261b9..676df890f 100644 --- a/Software/Embedded_SW/Embedded/Communication/PMR/Common/MessageType.pb-c.h +++ b/Software/Embedded_SW/Embedded/Communication/PMR/Common/MessageType.pb-c.h @@ -212,7 +212,15 @@ typedef enum _MessageType { MESSAGE_TYPE__GetStorageInfoRequest = 7012, MESSAGE_TYPE__GetStorageInfoResponse = 7013, MESSAGE_TYPE__GetFilesRequest = 7014, - MESSAGE_TYPE__GetFilesResponse = 7015 + MESSAGE_TYPE__GetFilesResponse = 7015, + MESSAGE_TYPE__FileDownloadRequest = 7016, + MESSAGE_TYPE__FileDownloadResponse = 7017, + MESSAGE_TYPE__FileChunkDownloadRequest = 7018, + MESSAGE_TYPE__FileChunkDownloadResponse = 7019, + MESSAGE_TYPE__ValidateVersionRequest = 7020, + MESSAGE_TYPE__ValidateVersionResponse = 7021, + MESSAGE_TYPE__ActivateVersionRequest = 7022, + MESSAGE_TYPE__ActivateVersionResponse = 7023 PROTOBUF_C__FORCE_ENUM_TO_BE_INT_SIZE(MESSAGE_TYPE) } MessageType; diff --git a/Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/DiagnosticsMonitors.pb-c.c b/Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/DiagnosticsMonitors.pb-c.c index 4ef4913d4..3bbdcdd8c 100644 --- a/Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/DiagnosticsMonitors.pb-c.c +++ b/Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/DiagnosticsMonitors.pb-c.c @@ -52,7 +52,7 @@ void diagnostics_monitors__free_unpacked assert(message->base.descriptor == &diagnostics_monitors__descriptor); protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); } -static const ProtobufCFieldDescriptor diagnostics_monitors__field_descriptors[48] = +static const ProtobufCFieldDescriptor diagnostics_monitors__field_descriptors[55] = { { "Dancer1Angle", @@ -355,20 +355,8 @@ static const ProtobufCFieldDescriptor diagnostics_monitors__field_descriptors[48 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "MidTankPressure", - 26, - PROTOBUF_C_LABEL_REPEATED, - PROTOBUF_C_TYPE_DOUBLE, - offsetof(DiagnosticsMonitors, n_midtankpressure), - offsetof(DiagnosticsMonitors, midtankpressure), - NULL, - NULL, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { "FilterDeltaPressure", - 27, + 26, PROTOBUF_C_LABEL_REPEATED, PROTOBUF_C_TYPE_DOUBLE, offsetof(DiagnosticsMonitors, n_filterdeltapressure), @@ -380,7 +368,7 @@ static const ProtobufCFieldDescriptor diagnostics_monitors__field_descriptors[48 }, { "ChillerTemperature", - 28, + 27, PROTOBUF_C_LABEL_REPEATED, PROTOBUF_C_TYPE_DOUBLE, offsetof(DiagnosticsMonitors, n_chillertemperature), @@ -392,7 +380,7 @@ static const ProtobufCFieldDescriptor diagnostics_monitors__field_descriptors[48 }, { "Dispenser1MotorFrequency", - 29, + 28, PROTOBUF_C_LABEL_REPEATED, PROTOBUF_C_TYPE_DOUBLE, offsetof(DiagnosticsMonitors, n_dispenser1motorfrequency), @@ -404,7 +392,7 @@ static const ProtobufCFieldDescriptor diagnostics_monitors__field_descriptors[48 }, { "Dispenser2MotorFrequency", - 30, + 29, PROTOBUF_C_LABEL_REPEATED, PROTOBUF_C_TYPE_DOUBLE, offsetof(DiagnosticsMonitors, n_dispenser2motorfrequency), @@ -416,7 +404,7 @@ static const ProtobufCFieldDescriptor diagnostics_monitors__field_descriptors[48 }, { "Dispenser3MotorFrequency", - 31, + 30, PROTOBUF_C_LABEL_REPEATED, PROTOBUF_C_TYPE_DOUBLE, offsetof(DiagnosticsMonitors, n_dispenser3motorfrequency), @@ -428,7 +416,7 @@ static const ProtobufCFieldDescriptor diagnostics_monitors__field_descriptors[48 }, { "Dispenser4MotorFrequency", - 32, + 31, PROTOBUF_C_LABEL_REPEATED, PROTOBUF_C_TYPE_DOUBLE, offsetof(DiagnosticsMonitors, n_dispenser4motorfrequency), @@ -440,7 +428,7 @@ static const ProtobufCFieldDescriptor diagnostics_monitors__field_descriptors[48 }, { "Dispenser5MotorFrequency", - 33, + 32, PROTOBUF_C_LABEL_REPEATED, PROTOBUF_C_TYPE_DOUBLE, offsetof(DiagnosticsMonitors, n_dispenser5motorfrequency), @@ -452,7 +440,7 @@ static const ProtobufCFieldDescriptor diagnostics_monitors__field_descriptors[48 }, { "Dispenser6MotorFrequency", - 34, + 33, PROTOBUF_C_LABEL_REPEATED, PROTOBUF_C_TYPE_DOUBLE, offsetof(DiagnosticsMonitors, n_dispenser6motorfrequency), @@ -464,7 +452,7 @@ static const ProtobufCFieldDescriptor diagnostics_monitors__field_descriptors[48 }, { "Dispenser7MotorFrequency", - 35, + 34, PROTOBUF_C_LABEL_REPEATED, PROTOBUF_C_TYPE_DOUBLE, offsetof(DiagnosticsMonitors, n_dispenser7motorfrequency), @@ -476,7 +464,7 @@ static const ProtobufCFieldDescriptor diagnostics_monitors__field_descriptors[48 }, { "Dispenser8MotorFrequency", - 36, + 35, PROTOBUF_C_LABEL_REPEATED, PROTOBUF_C_TYPE_DOUBLE, offsetof(DiagnosticsMonitors, n_dispenser8motorfrequency), @@ -488,7 +476,7 @@ static const ProtobufCFieldDescriptor diagnostics_monitors__field_descriptors[48 }, { "HeadZone4Temperature", - 37, + 36, PROTOBUF_C_LABEL_REPEATED, PROTOBUF_C_TYPE_DOUBLE, offsetof(DiagnosticsMonitors, n_headzone4temperature), @@ -500,7 +488,7 @@ static const ProtobufCFieldDescriptor diagnostics_monitors__field_descriptors[48 }, { "HeadZone5Temperature", - 38, + 37, PROTOBUF_C_LABEL_REPEATED, PROTOBUF_C_TYPE_DOUBLE, offsetof(DiagnosticsMonitors, n_headzone5temperature), @@ -512,7 +500,7 @@ static const ProtobufCFieldDescriptor diagnostics_monitors__field_descriptors[48 }, { "HeadZone6Temperature", - 39, + 38, PROTOBUF_C_LABEL_REPEATED, PROTOBUF_C_TYPE_DOUBLE, offsetof(DiagnosticsMonitors, n_headzone6temperature), @@ -524,7 +512,7 @@ static const ProtobufCFieldDescriptor diagnostics_monitors__field_descriptors[48 }, { "BlowerVoltage", - 40, + 39, PROTOBUF_C_LABEL_REPEATED, PROTOBUF_C_TYPE_DOUBLE, offsetof(DiagnosticsMonitors, n_blowervoltage), @@ -536,7 +524,7 @@ static const ProtobufCFieldDescriptor diagnostics_monitors__field_descriptors[48 }, { "Dispenser1Pressure", - 41, + 40, PROTOBUF_C_LABEL_REPEATED, PROTOBUF_C_TYPE_DOUBLE, offsetof(DiagnosticsMonitors, n_dispenser1pressure), @@ -548,7 +536,7 @@ static const ProtobufCFieldDescriptor diagnostics_monitors__field_descriptors[48 }, { "Dispenser2Pressure", - 42, + 41, PROTOBUF_C_LABEL_REPEATED, PROTOBUF_C_TYPE_DOUBLE, offsetof(DiagnosticsMonitors, n_dispenser2pressure), @@ -560,7 +548,7 @@ static const ProtobufCFieldDescriptor diagnostics_monitors__field_descriptors[48 }, { "Dispenser3Pressure", - 43, + 42, PROTOBUF_C_LABEL_REPEATED, PROTOBUF_C_TYPE_DOUBLE, offsetof(DiagnosticsMonitors, n_dispenser3pressure), @@ -572,7 +560,7 @@ static const ProtobufCFieldDescriptor diagnostics_monitors__field_descriptors[48 }, { "Dispenser4Pressure", - 44, + 43, PROTOBUF_C_LABEL_REPEATED, PROTOBUF_C_TYPE_DOUBLE, offsetof(DiagnosticsMonitors, n_dispenser4pressure), @@ -584,7 +572,7 @@ static const ProtobufCFieldDescriptor diagnostics_monitors__field_descriptors[48 }, { "Dispenser5Pressure", - 45, + 44, PROTOBUF_C_LABEL_REPEATED, PROTOBUF_C_TYPE_DOUBLE, offsetof(DiagnosticsMonitors, n_dispenser5pressure), @@ -596,7 +584,7 @@ static const ProtobufCFieldDescriptor diagnostics_monitors__field_descriptors[48 }, { "Dispenser6Pressure", - 46, + 45, PROTOBUF_C_LABEL_REPEATED, PROTOBUF_C_TYPE_DOUBLE, offsetof(DiagnosticsMonitors, n_dispenser6pressure), @@ -608,7 +596,7 @@ static const ProtobufCFieldDescriptor diagnostics_monitors__field_descriptors[48 }, { "Dispenser7Pressure", - 47, + 46, PROTOBUF_C_LABEL_REPEATED, PROTOBUF_C_TYPE_DOUBLE, offsetof(DiagnosticsMonitors, n_dispenser7pressure), @@ -620,7 +608,7 @@ static const ProtobufCFieldDescriptor diagnostics_monitors__field_descriptors[48 }, { "Dispenser8Pressure", - 48, + 47, PROTOBUF_C_LABEL_REPEATED, PROTOBUF_C_TYPE_DOUBLE, offsetof(DiagnosticsMonitors, n_dispenser8pressure), @@ -630,29 +618,125 @@ static const ProtobufCFieldDescriptor diagnostics_monitors__field_descriptors[48 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, + { + "MidTank1Level", + 48, + PROTOBUF_C_LABEL_REPEATED, + PROTOBUF_C_TYPE_DOUBLE, + offsetof(DiagnosticsMonitors, n_midtank1level), + offsetof(DiagnosticsMonitors, midtank1level), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "MidTank2Level", + 49, + PROTOBUF_C_LABEL_REPEATED, + PROTOBUF_C_TYPE_DOUBLE, + offsetof(DiagnosticsMonitors, n_midtank2level), + offsetof(DiagnosticsMonitors, midtank2level), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "MidTank3Level", + 50, + PROTOBUF_C_LABEL_REPEATED, + PROTOBUF_C_TYPE_DOUBLE, + offsetof(DiagnosticsMonitors, n_midtank3level), + offsetof(DiagnosticsMonitors, midtank3level), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "MidTank4Level", + 51, + PROTOBUF_C_LABEL_REPEATED, + PROTOBUF_C_TYPE_DOUBLE, + offsetof(DiagnosticsMonitors, n_midtank4level), + offsetof(DiagnosticsMonitors, midtank4level), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "MidTank5Level", + 52, + PROTOBUF_C_LABEL_REPEATED, + PROTOBUF_C_TYPE_DOUBLE, + offsetof(DiagnosticsMonitors, n_midtank5level), + offsetof(DiagnosticsMonitors, midtank5level), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "MidTank6Level", + 53, + PROTOBUF_C_LABEL_REPEATED, + PROTOBUF_C_TYPE_DOUBLE, + offsetof(DiagnosticsMonitors, n_midtank6level), + offsetof(DiagnosticsMonitors, midtank6level), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "MidTank7Level", + 54, + PROTOBUF_C_LABEL_REPEATED, + PROTOBUF_C_TYPE_DOUBLE, + offsetof(DiagnosticsMonitors, n_midtank7level), + offsetof(DiagnosticsMonitors, midtank7level), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "MidTank8Level", + 55, + PROTOBUF_C_LABEL_REPEATED, + PROTOBUF_C_TYPE_DOUBLE, + offsetof(DiagnosticsMonitors, n_midtank8level), + offsetof(DiagnosticsMonitors, midtank8level), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, }; static const unsigned diagnostics_monitors__field_indices_by_name[] = { - 39, /* field[39] = BlowerVoltage */ - 27, /* field[27] = ChillerTemperature */ + 38, /* field[38] = BlowerVoltage */ + 26, /* field[26] = ChillerTemperature */ 0, /* field[0] = Dancer1Angle */ 1, /* field[1] = Dancer2Angle */ 2, /* field[2] = Dancer3Angle */ - 28, /* field[28] = Dispenser1MotorFrequency */ - 40, /* field[40] = Dispenser1Pressure */ - 29, /* field[29] = Dispenser2MotorFrequency */ - 41, /* field[41] = Dispenser2Pressure */ - 30, /* field[30] = Dispenser3MotorFrequency */ - 42, /* field[42] = Dispenser3Pressure */ - 31, /* field[31] = Dispenser4MotorFrequency */ - 43, /* field[43] = Dispenser4Pressure */ - 32, /* field[32] = Dispenser5MotorFrequency */ - 44, /* field[44] = Dispenser5Pressure */ - 33, /* field[33] = Dispenser6MotorFrequency */ - 45, /* field[45] = Dispenser6Pressure */ - 34, /* field[34] = Dispenser7MotorFrequency */ - 46, /* field[46] = Dispenser7Pressure */ - 35, /* field[35] = Dispenser8MotorFrequency */ - 47, /* field[47] = Dispenser8Pressure */ + 27, /* field[27] = Dispenser1MotorFrequency */ + 39, /* field[39] = Dispenser1Pressure */ + 28, /* field[28] = Dispenser2MotorFrequency */ + 40, /* field[40] = Dispenser2Pressure */ + 29, /* field[29] = Dispenser3MotorFrequency */ + 41, /* field[41] = Dispenser3Pressure */ + 30, /* field[30] = Dispenser4MotorFrequency */ + 42, /* field[42] = Dispenser4Pressure */ + 31, /* field[31] = Dispenser5MotorFrequency */ + 43, /* field[43] = Dispenser5Pressure */ + 32, /* field[32] = Dispenser6MotorFrequency */ + 44, /* field[44] = Dispenser6Pressure */ + 33, /* field[33] = Dispenser7MotorFrequency */ + 45, /* field[45] = Dispenser7Pressure */ + 34, /* field[34] = Dispenser8MotorFrequency */ + 46, /* field[46] = Dispenser8Pressure */ 22, /* field[22] = DispensersAngularEncoders */ 23, /* field[23] = DispensersLinearPositions */ 21, /* field[21] = DispensersMotorsFrequency */ @@ -664,15 +748,22 @@ static const unsigned diagnostics_monitors__field_indices_by_name[] = { 18, /* field[18] = DryerZone3Temperature */ 3, /* field[3] = FeederMotorFrequency */ 14, /* field[14] = FeederTension */ - 26, /* field[26] = FilterDeltaPressure */ + 25, /* field[25] = FilterDeltaPressure */ 13, /* field[13] = HeadAirFlow */ 10, /* field[10] = HeadZone1Temperature */ 11, /* field[11] = HeadZone2Temperature */ 12, /* field[12] = HeadZone3Temperature */ - 36, /* field[36] = HeadZone4Temperature */ - 37, /* field[37] = HeadZone5Temperature */ - 38, /* field[38] = HeadZone6Temperature */ - 25, /* field[25] = MidTankPressure */ + 35, /* field[35] = HeadZone4Temperature */ + 36, /* field[36] = HeadZone5Temperature */ + 37, /* field[37] = HeadZone6Temperature */ + 47, /* field[47] = MidTank1Level */ + 48, /* field[48] = MidTank2Level */ + 49, /* field[49] = MidTank3Level */ + 50, /* field[50] = MidTank4Level */ + 51, /* field[51] = MidTank5Level */ + 52, /* field[52] = MidTank6Level */ + 53, /* field[53] = MidTank7Level */ + 54, /* field[54] = MidTank8Level */ 9, /* field[9] = MixerTemperature */ 5, /* field[5] = PollerMotor */ 15, /* field[15] = PullerTension */ @@ -684,7 +775,7 @@ static const unsigned diagnostics_monitors__field_indices_by_name[] = { static const ProtobufCIntRange diagnostics_monitors__number_ranges[1 + 1] = { { 1, 0 }, - { 0, 48 } + { 0, 55 } }; const ProtobufCMessageDescriptor diagnostics_monitors__descriptor = { @@ -694,7 +785,7 @@ const ProtobufCMessageDescriptor diagnostics_monitors__descriptor = "DiagnosticsMonitors", "", sizeof(DiagnosticsMonitors), - 48, + 55, diagnostics_monitors__field_descriptors, diagnostics_monitors__field_indices_by_name, 1, diagnostics_monitors__number_ranges, diff --git a/Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/DiagnosticsMonitors.pb-c.h b/Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/DiagnosticsMonitors.pb-c.h index 9a83f61be..5917ffd76 100644 --- a/Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/DiagnosticsMonitors.pb-c.h +++ b/Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/DiagnosticsMonitors.pb-c.h @@ -77,8 +77,6 @@ struct _DiagnosticsMonitors DoubleArray **dispenserslinearpositions; size_t n_dispenserspressure; DoubleArray **dispenserspressure; - size_t n_midtankpressure; - double *midtankpressure; size_t n_filterdeltapressure; double *filterdeltapressure; size_t n_chillertemperature; @@ -123,10 +121,26 @@ struct _DiagnosticsMonitors double *dispenser7pressure; size_t n_dispenser8pressure; double *dispenser8pressure; + size_t n_midtank1level; + double *midtank1level; + size_t n_midtank2level; + double *midtank2level; + size_t n_midtank3level; + double *midtank3level; + size_t n_midtank4level; + double *midtank4level; + size_t n_midtank5level; + double *midtank5level; + size_t n_midtank6level; + double *midtank6level; + size_t n_midtank7level; + double *midtank7level; + size_t n_midtank8level; + double *midtank8level; }; #define DIAGNOSTICS_MONITORS__INIT \ { PROTOBUF_C_MESSAGE_INIT (&diagnostics_monitors__descriptor) \ - , 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL } + , 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL } /* DiagnosticsMonitors methods */ diff --git a/Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/ThreadJoggingRequest.pb-c.c b/Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/ThreadJoggingRequest.pb-c.c index f0b387414..beefe6145 100644 --- a/Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/ThreadJoggingRequest.pb-c.c +++ b/Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/ThreadJoggingRequest.pb-c.c @@ -52,21 +52,9 @@ void thread_jogging_request__free_unpacked assert(message->base.descriptor == &thread_jogging_request__descriptor); protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); } -static const ProtobufCFieldDescriptor thread_jogging_request__field_descriptors[2] = +static const ProtobufCFieldDescriptor thread_jogging_request__field_descriptors[1] = { { - "Direction", - 1, - PROTOBUF_C_LABEL_OPTIONAL, - PROTOBUF_C_TYPE_ENUM, - offsetof(ThreadJoggingRequest, has_direction), - offsetof(ThreadJoggingRequest, direction), - &motor_direction__descriptor, - NULL, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { "Speed", 3, PROTOBUF_C_LABEL_OPTIONAL, @@ -80,14 +68,12 @@ static const ProtobufCFieldDescriptor thread_jogging_request__field_descriptors[ }, }; static const unsigned thread_jogging_request__field_indices_by_name[] = { - 0, /* field[0] = Direction */ - 1, /* field[1] = Speed */ + 0, /* field[0] = Speed */ }; -static const ProtobufCIntRange thread_jogging_request__number_ranges[2 + 1] = +static const ProtobufCIntRange thread_jogging_request__number_ranges[1 + 1] = { - { 1, 0 }, - { 3, 1 }, - { 0, 2 } + { 3, 0 }, + { 0, 1 } }; const ProtobufCMessageDescriptor thread_jogging_request__descriptor = { @@ -97,10 +83,10 @@ const ProtobufCMessageDescriptor thread_jogging_request__descriptor = "ThreadJoggingRequest", "", sizeof(ThreadJoggingRequest), - 2, + 1, thread_jogging_request__field_descriptors, thread_jogging_request__field_indices_by_name, - 2, thread_jogging_request__number_ranges, + 1, thread_jogging_request__number_ranges, (ProtobufCMessageInit) thread_jogging_request__init, NULL,NULL,NULL /* reserved[123] */ }; diff --git a/Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/ThreadJoggingRequest.pb-c.h b/Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/ThreadJoggingRequest.pb-c.h index 7669215aa..799d297b3 100644 --- a/Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/ThreadJoggingRequest.pb-c.h +++ b/Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/ThreadJoggingRequest.pb-c.h @@ -14,7 +14,6 @@ PROTOBUF_C__BEGIN_DECLS # error This file was generated by an older version of protoc-c which is incompatible with your libprotobuf-c headers. Please regenerate this file with a newer version of protoc-c. #endif -#include "MotorDirection.pb-c.h" typedef struct _ThreadJoggingRequest ThreadJoggingRequest; @@ -27,14 +26,12 @@ typedef struct _ThreadJoggingRequest ThreadJoggingRequest; struct _ThreadJoggingRequest { ProtobufCMessage base; - protobuf_c_boolean has_direction; - MotorDirection direction; protobuf_c_boolean has_speed; double speed; }; #define THREAD_JOGGING_REQUEST__INIT \ { PROTOBUF_C_MESSAGE_INIT (&thread_jogging_request__descriptor) \ - , 0, MOTOR_DIRECTION__Forward, 0, 0 } + , 0, 0 } /* ThreadJoggingRequest methods */ diff --git a/Software/Embedded_SW/Embedded/Communication/PMR/IO/ActivateVersionRequest.pb-c.c b/Software/Embedded_SW/Embedded/Communication/PMR/FirmwareUpgrade/ActivateVersionRequest.pb-c.c index 3602f7f9e..634f2ec04 100644 --- a/Software/Embedded_SW/Embedded/Communication/PMR/IO/ActivateVersionRequest.pb-c.c +++ b/Software/Embedded_SW/Embedded/Communication/PMR/FirmwareUpgrade/ActivateVersionRequest.pb-c.c @@ -55,20 +55,20 @@ void activate_version_request__free_unpacked static const ProtobufCFieldDescriptor activate_version_request__field_descriptors[1] = { { - "FileDescriptors", + "Path", 1, - PROTOBUF_C_LABEL_REPEATED, - PROTOBUF_C_TYPE_MESSAGE, - offsetof(ActivateVersionRequest, n_filedescriptors), - offsetof(ActivateVersionRequest, filedescriptors), - &version_file_descriptor__descriptor, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_STRING, + 0, /* quantifier_offset */ + offsetof(ActivateVersionRequest, path), + NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, }; static const unsigned activate_version_request__field_indices_by_name[] = { - 0, /* field[0] = FileDescriptors */ + 0, /* field[0] = Path */ }; static const ProtobufCIntRange activate_version_request__number_ranges[1 + 1] = { diff --git a/Software/Embedded_SW/Embedded/Communication/PMR/IO/ActivateVersionRequest.pb-c.h b/Software/Embedded_SW/Embedded/Communication/PMR/FirmwareUpgrade/ActivateVersionRequest.pb-c.h index 90fe6479d..ee95d51a2 100644 --- a/Software/Embedded_SW/Embedded/Communication/PMR/IO/ActivateVersionRequest.pb-c.h +++ b/Software/Embedded_SW/Embedded/Communication/PMR/FirmwareUpgrade/ActivateVersionRequest.pb-c.h @@ -14,7 +14,6 @@ PROTOBUF_C__BEGIN_DECLS # error This file was generated by an older version of protoc-c which is incompatible with your libprotobuf-c headers. Please regenerate this file with a newer version of protoc-c. #endif -#include "VersionFileDescriptor.pb-c.h" typedef struct _ActivateVersionRequest ActivateVersionRequest; @@ -27,12 +26,11 @@ typedef struct _ActivateVersionRequest ActivateVersionRequest; struct _ActivateVersionRequest { ProtobufCMessage base; - size_t n_filedescriptors; - VersionFileDescriptor **filedescriptors; + char *path; }; #define ACTIVATE_VERSION_REQUEST__INIT \ { PROTOBUF_C_MESSAGE_INIT (&activate_version_request__descriptor) \ - , 0,NULL } + , NULL } /* ActivateVersionRequest methods */ diff --git a/Software/Embedded_SW/Embedded/Communication/PMR/IO/ActivateVersionResponse.pb-c.c b/Software/Embedded_SW/Embedded/Communication/PMR/FirmwareUpgrade/ActivateVersionResponse.pb-c.c index 6f54f8708..6f54f8708 100644 --- a/Software/Embedded_SW/Embedded/Communication/PMR/IO/ActivateVersionResponse.pb-c.c +++ b/Software/Embedded_SW/Embedded/Communication/PMR/FirmwareUpgrade/ActivateVersionResponse.pb-c.c diff --git a/Software/Embedded_SW/Embedded/Communication/PMR/IO/ActivateVersionResponse.pb-c.h b/Software/Embedded_SW/Embedded/Communication/PMR/FirmwareUpgrade/ActivateVersionResponse.pb-c.h index 10dc41bcb..10dc41bcb 100644 --- a/Software/Embedded_SW/Embedded/Communication/PMR/IO/ActivateVersionResponse.pb-c.h +++ b/Software/Embedded_SW/Embedded/Communication/PMR/FirmwareUpgrade/ActivateVersionResponse.pb-c.h diff --git a/Software/Embedded_SW/Embedded/Communication/PMR/IO/ValidateVersionRequest.pb-c.c b/Software/Embedded_SW/Embedded/Communication/PMR/FirmwareUpgrade/ValidateVersionRequest.pb-c.c index f42b94737..5cd60bd02 100644 --- a/Software/Embedded_SW/Embedded/Communication/PMR/IO/ValidateVersionRequest.pb-c.c +++ b/Software/Embedded_SW/Embedded/Communication/PMR/FirmwareUpgrade/ValidateVersionRequest.pb-c.c @@ -55,20 +55,20 @@ void validate_version_request__free_unpacked static const ProtobufCFieldDescriptor validate_version_request__field_descriptors[1] = { { - "FileDescriptors", + "Path", 1, - PROTOBUF_C_LABEL_REPEATED, - PROTOBUF_C_TYPE_MESSAGE, - offsetof(ValidateVersionRequest, n_filedescriptors), - offsetof(ValidateVersionRequest, filedescriptors), - &version_file_descriptor__descriptor, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_STRING, + 0, /* quantifier_offset */ + offsetof(ValidateVersionRequest, path), + NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, }; static const unsigned validate_version_request__field_indices_by_name[] = { - 0, /* field[0] = FileDescriptors */ + 0, /* field[0] = Path */ }; static const ProtobufCIntRange validate_version_request__number_ranges[1 + 1] = { diff --git a/Software/Embedded_SW/Embedded/Communication/PMR/IO/ValidateVersionRequest.pb-c.h b/Software/Embedded_SW/Embedded/Communication/PMR/FirmwareUpgrade/ValidateVersionRequest.pb-c.h index eeb30902e..b55eadc44 100644 --- a/Software/Embedded_SW/Embedded/Communication/PMR/IO/ValidateVersionRequest.pb-c.h +++ b/Software/Embedded_SW/Embedded/Communication/PMR/FirmwareUpgrade/ValidateVersionRequest.pb-c.h @@ -14,7 +14,6 @@ PROTOBUF_C__BEGIN_DECLS # error This file was generated by an older version of protoc-c which is incompatible with your libprotobuf-c headers. Please regenerate this file with a newer version of protoc-c. #endif -#include "VersionFileDescriptor.pb-c.h" typedef struct _ValidateVersionRequest ValidateVersionRequest; @@ -27,12 +26,11 @@ typedef struct _ValidateVersionRequest ValidateVersionRequest; struct _ValidateVersionRequest { ProtobufCMessage base; - size_t n_filedescriptors; - VersionFileDescriptor **filedescriptors; + char *path; }; #define VALIDATE_VERSION_REQUEST__INIT \ { PROTOBUF_C_MESSAGE_INIT (&validate_version_request__descriptor) \ - , 0,NULL } + , NULL } /* ValidateVersionRequest methods */ diff --git a/Software/Embedded_SW/Embedded/Communication/PMR/IO/ValidateVersionResponse.pb-c.c b/Software/Embedded_SW/Embedded/Communication/PMR/FirmwareUpgrade/ValidateVersionResponse.pb-c.c index 9be2cce20..9be2cce20 100644 --- a/Software/Embedded_SW/Embedded/Communication/PMR/IO/ValidateVersionResponse.pb-c.c +++ b/Software/Embedded_SW/Embedded/Communication/PMR/FirmwareUpgrade/ValidateVersionResponse.pb-c.c diff --git a/Software/Embedded_SW/Embedded/Communication/PMR/IO/ValidateVersionResponse.pb-c.h b/Software/Embedded_SW/Embedded/Communication/PMR/FirmwareUpgrade/ValidateVersionResponse.pb-c.h index 0032ec8c9..0032ec8c9 100644 --- a/Software/Embedded_SW/Embedded/Communication/PMR/IO/ValidateVersionResponse.pb-c.h +++ b/Software/Embedded_SW/Embedded/Communication/PMR/FirmwareUpgrade/ValidateVersionResponse.pb-c.h diff --git a/Software/Embedded_SW/Embedded/Communication/PMR/IO/VersionFileDescriptor.pb-c.c b/Software/Embedded_SW/Embedded/Communication/PMR/FirmwareUpgrade/VersionFileDescriptor.pb-c.c index 53b9f5bfd..53b9f5bfd 100644 --- a/Software/Embedded_SW/Embedded/Communication/PMR/IO/VersionFileDescriptor.pb-c.c +++ b/Software/Embedded_SW/Embedded/Communication/PMR/FirmwareUpgrade/VersionFileDescriptor.pb-c.c diff --git a/Software/Embedded_SW/Embedded/Communication/PMR/IO/VersionFileDescriptor.pb-c.h b/Software/Embedded_SW/Embedded/Communication/PMR/FirmwareUpgrade/VersionFileDescriptor.pb-c.h index 692dc6722..692dc6722 100644 --- a/Software/Embedded_SW/Embedded/Communication/PMR/IO/VersionFileDescriptor.pb-c.h +++ b/Software/Embedded_SW/Embedded/Communication/PMR/FirmwareUpgrade/VersionFileDescriptor.pb-c.h diff --git a/Software/Embedded_SW/Embedded/Communication/PMR/IO/VersionFileDestination.pb-c.c b/Software/Embedded_SW/Embedded/Communication/PMR/FirmwareUpgrade/VersionFileDestination.pb-c.c index 3e45ece3e..3e45ece3e 100644 --- a/Software/Embedded_SW/Embedded/Communication/PMR/IO/VersionFileDestination.pb-c.c +++ b/Software/Embedded_SW/Embedded/Communication/PMR/FirmwareUpgrade/VersionFileDestination.pb-c.c diff --git a/Software/Embedded_SW/Embedded/Communication/PMR/IO/VersionFileDestination.pb-c.h b/Software/Embedded_SW/Embedded/Communication/PMR/FirmwareUpgrade/VersionFileDestination.pb-c.h index 83686d194..83686d194 100644 --- a/Software/Embedded_SW/Embedded/Communication/PMR/IO/VersionFileDestination.pb-c.h +++ b/Software/Embedded_SW/Embedded/Communication/PMR/FirmwareUpgrade/VersionFileDestination.pb-c.h diff --git a/Software/Embedded_SW/Embedded/Communication/PMR/FirmwareUpgrade/VersionPackageDescriptor.pb-c.c b/Software/Embedded_SW/Embedded/Communication/PMR/FirmwareUpgrade/VersionPackageDescriptor.pb-c.c new file mode 100644 index 000000000..d0b190ca8 --- /dev/null +++ b/Software/Embedded_SW/Embedded/Communication/PMR/FirmwareUpgrade/VersionPackageDescriptor.pb-c.c @@ -0,0 +1,92 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: VersionPackageDescriptor.proto */ + +/* Do not generate deprecated warnings for self */ +#ifndef PROTOBUF_C__NO_DEPRECATED +#define PROTOBUF_C__NO_DEPRECATED +#endif + +#include "VersionPackageDescriptor.pb-c.h" +void version_package_descriptor__init + (VersionPackageDescriptor *message) +{ + static const VersionPackageDescriptor init_value = VERSION_PACKAGE_DESCRIPTOR__INIT; + *message = init_value; +} +size_t version_package_descriptor__get_packed_size + (const VersionPackageDescriptor *message) +{ + assert(message->base.descriptor == &version_package_descriptor__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t version_package_descriptor__pack + (const VersionPackageDescriptor *message, + uint8_t *out) +{ + assert(message->base.descriptor == &version_package_descriptor__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t version_package_descriptor__pack_to_buffer + (const VersionPackageDescriptor *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &version_package_descriptor__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +VersionPackageDescriptor * + version_package_descriptor__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (VersionPackageDescriptor *) + protobuf_c_message_unpack (&version_package_descriptor__descriptor, + allocator, len, data); +} +void version_package_descriptor__free_unpacked + (VersionPackageDescriptor *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &version_package_descriptor__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +static const ProtobufCFieldDescriptor version_package_descriptor__field_descriptors[1] = +{ + { + "FileDescriptors", + 1, + PROTOBUF_C_LABEL_REPEATED, + PROTOBUF_C_TYPE_MESSAGE, + offsetof(VersionPackageDescriptor, n_filedescriptors), + offsetof(VersionPackageDescriptor, filedescriptors), + &version_file_descriptor__descriptor, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned version_package_descriptor__field_indices_by_name[] = { + 0, /* field[0] = FileDescriptors */ +}; +static const ProtobufCIntRange version_package_descriptor__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 1 } +}; +const ProtobufCMessageDescriptor version_package_descriptor__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "VersionPackageDescriptor", + "VersionPackageDescriptor", + "VersionPackageDescriptor", + "", + sizeof(VersionPackageDescriptor), + 1, + version_package_descriptor__field_descriptors, + version_package_descriptor__field_indices_by_name, + 1, version_package_descriptor__number_ranges, + (ProtobufCMessageInit) version_package_descriptor__init, + NULL,NULL,NULL /* reserved[123] */ +}; diff --git a/Software/Embedded_SW/Embedded/Communication/PMR/FirmwareUpgrade/VersionPackageDescriptor.pb-c.h b/Software/Embedded_SW/Embedded/Communication/PMR/FirmwareUpgrade/VersionPackageDescriptor.pb-c.h new file mode 100644 index 000000000..3b223bab9 --- /dev/null +++ b/Software/Embedded_SW/Embedded/Communication/PMR/FirmwareUpgrade/VersionPackageDescriptor.pb-c.h @@ -0,0 +1,73 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: VersionPackageDescriptor.proto */ + +#ifndef PROTOBUF_C_VersionPackageDescriptor_2eproto__INCLUDED +#define PROTOBUF_C_VersionPackageDescriptor_2eproto__INCLUDED + +#include <protobuf-c/protobuf-c.h> + +PROTOBUF_C__BEGIN_DECLS + +#if PROTOBUF_C_VERSION_NUMBER < 1003000 +# error This file was generated by a newer version of protoc-c which is incompatible with your libprotobuf-c headers. Please update your headers. +#elif 1003000 < PROTOBUF_C_MIN_COMPILER_VERSION +# error This file was generated by an older version of protoc-c which is incompatible with your libprotobuf-c headers. Please regenerate this file with a newer version of protoc-c. +#endif + +#include "VersionFileDescriptor.pb-c.h" + +typedef struct _VersionPackageDescriptor VersionPackageDescriptor; + + +/* --- enums --- */ + + +/* --- messages --- */ + +struct _VersionPackageDescriptor +{ + ProtobufCMessage base; + size_t n_filedescriptors; + VersionFileDescriptor **filedescriptors; +}; +#define VERSION_PACKAGE_DESCRIPTOR__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&version_package_descriptor__descriptor) \ + , 0,NULL } + + +/* VersionPackageDescriptor methods */ +void version_package_descriptor__init + (VersionPackageDescriptor *message); +size_t version_package_descriptor__get_packed_size + (const VersionPackageDescriptor *message); +size_t version_package_descriptor__pack + (const VersionPackageDescriptor *message, + uint8_t *out); +size_t version_package_descriptor__pack_to_buffer + (const VersionPackageDescriptor *message, + ProtobufCBuffer *buffer); +VersionPackageDescriptor * + version_package_descriptor__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void version_package_descriptor__free_unpacked + (VersionPackageDescriptor *message, + ProtobufCAllocator *allocator); +/* --- per-message closures --- */ + +typedef void (*VersionPackageDescriptor_Closure) + (const VersionPackageDescriptor *message, + void *closure_data); + +/* --- services --- */ + + +/* --- descriptors --- */ + +extern const ProtobufCMessageDescriptor version_package_descriptor__descriptor; + +PROTOBUF_C__END_DECLS + + +#endif /* PROTOBUF_C_VersionPackageDescriptor_2eproto__INCLUDED */ diff --git a/Software/Embedded_SW/Embedded/Communication/PMR/IO/DeleteRequest.pb-c.c b/Software/Embedded_SW/Embedded/Communication/PMR/IO/DeleteRequest.pb-c.c index 27fd07849..275a1b11f 100644 --- a/Software/Embedded_SW/Embedded/Communication/PMR/IO/DeleteRequest.pb-c.c +++ b/Software/Embedded_SW/Embedded/Communication/PMR/IO/DeleteRequest.pb-c.c @@ -52,11 +52,11 @@ void delete_request__free_unpacked assert(message->base.descriptor == &delete_request__descriptor); protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); } -static const ProtobufCFieldDescriptor delete_request__field_descriptors[1] = +static const ProtobufCFieldDescriptor delete_request__field_descriptors[2] = { { "Path", - 2, + 1, PROTOBUF_C_LABEL_OPTIONAL, PROTOBUF_C_TYPE_STRING, 0, /* quantifier_offset */ @@ -66,14 +66,27 @@ static const ProtobufCFieldDescriptor delete_request__field_descriptors[1] = 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, + { + "Attribute", + 2, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_ENUM, + offsetof(DeleteRequest, has_attribute), + offsetof(DeleteRequest, attribute), + &file_attribute__descriptor, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, }; static const unsigned delete_request__field_indices_by_name[] = { + 1, /* field[1] = Attribute */ 0, /* field[0] = Path */ }; static const ProtobufCIntRange delete_request__number_ranges[1 + 1] = { - { 2, 0 }, - { 0, 1 } + { 1, 0 }, + { 0, 2 } }; const ProtobufCMessageDescriptor delete_request__descriptor = { @@ -83,7 +96,7 @@ const ProtobufCMessageDescriptor delete_request__descriptor = "DeleteRequest", "", sizeof(DeleteRequest), - 1, + 2, delete_request__field_descriptors, delete_request__field_indices_by_name, 1, delete_request__number_ranges, diff --git a/Software/Embedded_SW/Embedded/Communication/PMR/IO/DeleteRequest.pb-c.h b/Software/Embedded_SW/Embedded/Communication/PMR/IO/DeleteRequest.pb-c.h index 79dabee5e..2ab6d7aa7 100644 --- a/Software/Embedded_SW/Embedded/Communication/PMR/IO/DeleteRequest.pb-c.h +++ b/Software/Embedded_SW/Embedded/Communication/PMR/IO/DeleteRequest.pb-c.h @@ -14,6 +14,7 @@ PROTOBUF_C__BEGIN_DECLS # error This file was generated by an older version of protoc-c which is incompatible with your libprotobuf-c headers. Please regenerate this file with a newer version of protoc-c. #endif +#include "FileAttribute.pb-c.h" typedef struct _DeleteRequest DeleteRequest; @@ -27,10 +28,12 @@ struct _DeleteRequest { ProtobufCMessage base; char *path; + protobuf_c_boolean has_attribute; + FileAttribute attribute; }; #define DELETE_REQUEST__INIT \ { PROTOBUF_C_MESSAGE_INIT (&delete_request__descriptor) \ - , NULL } + , NULL, 0, FILE_ATTRIBUTE__Unspecified } /* DeleteRequest methods */ diff --git a/Software/Embedded_SW/Embedded/Communication/PMR/IO/FileChunkDownloadRequest.pb-c.c b/Software/Embedded_SW/Embedded/Communication/PMR/IO/FileChunkDownloadRequest.pb-c.c index 44c892aec..e54f04f95 100644 --- a/Software/Embedded_SW/Embedded/Communication/PMR/IO/FileChunkDownloadRequest.pb-c.c +++ b/Software/Embedded_SW/Embedded/Communication/PMR/IO/FileChunkDownloadRequest.pb-c.c @@ -52,7 +52,7 @@ void file_chunk_download_request__free_unpacked assert(message->base.descriptor == &file_chunk_download_request__descriptor); protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); } -static const ProtobufCFieldDescriptor file_chunk_download_request__field_descriptors[4] = +static const ProtobufCFieldDescriptor file_chunk_download_request__field_descriptors[3] = { { "DownloadID", @@ -90,29 +90,16 @@ static const ProtobufCFieldDescriptor file_chunk_download_request__field_descrip 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, - { - "IsCanceled", - 4, - PROTOBUF_C_LABEL_OPTIONAL, - PROTOBUF_C_TYPE_BOOL, - offsetof(FileChunkDownloadRequest, has_iscanceled), - offsetof(FileChunkDownloadRequest, iscanceled), - NULL, - NULL, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, }; static const unsigned file_chunk_download_request__field_indices_by_name[] = { 0, /* field[0] = DownloadID */ 1, /* field[1] = FileName */ - 3, /* field[3] = IsCanceled */ 2, /* field[2] = Position */ }; static const ProtobufCIntRange file_chunk_download_request__number_ranges[1 + 1] = { { 1, 0 }, - { 0, 4 } + { 0, 3 } }; const ProtobufCMessageDescriptor file_chunk_download_request__descriptor = { @@ -122,7 +109,7 @@ const ProtobufCMessageDescriptor file_chunk_download_request__descriptor = "FileChunkDownloadRequest", "", sizeof(FileChunkDownloadRequest), - 4, + 3, file_chunk_download_request__field_descriptors, file_chunk_download_request__field_indices_by_name, 1, file_chunk_download_request__number_ranges, diff --git a/Software/Embedded_SW/Embedded/Communication/PMR/IO/FileChunkDownloadRequest.pb-c.h b/Software/Embedded_SW/Embedded/Communication/PMR/IO/FileChunkDownloadRequest.pb-c.h index 1de5229cd..609b7905c 100644 --- a/Software/Embedded_SW/Embedded/Communication/PMR/IO/FileChunkDownloadRequest.pb-c.h +++ b/Software/Embedded_SW/Embedded/Communication/PMR/IO/FileChunkDownloadRequest.pb-c.h @@ -30,12 +30,10 @@ struct _FileChunkDownloadRequest char *filename; protobuf_c_boolean has_position; int64_t position; - protobuf_c_boolean has_iscanceled; - protobuf_c_boolean iscanceled; }; #define FILE_CHUNK_DOWNLOAD_REQUEST__INIT \ { PROTOBUF_C_MESSAGE_INIT (&file_chunk_download_request__descriptor) \ - , NULL, NULL, 0, 0, 0, 0 } + , NULL, NULL, 0, 0 } /* FileChunkDownloadRequest methods */ diff --git a/Software/Embedded_SW/Embedded/Communication/PMR/IO/FileChunkUploadRequest.pb-c.c b/Software/Embedded_SW/Embedded/Communication/PMR/IO/FileChunkUploadRequest.pb-c.c index a4ca27f4f..1c4f4110c 100644 --- a/Software/Embedded_SW/Embedded/Communication/PMR/IO/FileChunkUploadRequest.pb-c.c +++ b/Software/Embedded_SW/Embedded/Communication/PMR/IO/FileChunkUploadRequest.pb-c.c @@ -52,7 +52,7 @@ void file_chunk_upload_request__free_unpacked assert(message->base.descriptor == &file_chunk_upload_request__descriptor); protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); } -static const ProtobufCFieldDescriptor file_chunk_upload_request__field_descriptors[3] = +static const ProtobufCFieldDescriptor file_chunk_upload_request__field_descriptors[4] = { { "UploadID", @@ -67,9 +67,21 @@ static const ProtobufCFieldDescriptor file_chunk_upload_request__field_descripto 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "Buffer", + "Path", 2, PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_STRING, + 0, /* quantifier_offset */ + offsetof(FileChunkUploadRequest, path), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "Buffer", + 3, + PROTOBUF_C_LABEL_OPTIONAL, PROTOBUF_C_TYPE_BYTES, offsetof(FileChunkUploadRequest, has_buffer), offsetof(FileChunkUploadRequest, buffer), @@ -92,15 +104,15 @@ static const ProtobufCFieldDescriptor file_chunk_upload_request__field_descripto }, }; static const unsigned file_chunk_upload_request__field_indices_by_name[] = { - 1, /* field[1] = Buffer */ - 2, /* field[2] = IsCanceled */ + 2, /* field[2] = Buffer */ + 3, /* field[3] = IsCanceled */ + 1, /* field[1] = Path */ 0, /* field[0] = UploadID */ }; -static const ProtobufCIntRange file_chunk_upload_request__number_ranges[2 + 1] = +static const ProtobufCIntRange file_chunk_upload_request__number_ranges[1 + 1] = { { 1, 0 }, - { 4, 2 }, - { 0, 3 } + { 0, 4 } }; const ProtobufCMessageDescriptor file_chunk_upload_request__descriptor = { @@ -110,10 +122,10 @@ const ProtobufCMessageDescriptor file_chunk_upload_request__descriptor = "FileChunkUploadRequest", "", sizeof(FileChunkUploadRequest), - 3, + 4, file_chunk_upload_request__field_descriptors, file_chunk_upload_request__field_indices_by_name, - 2, file_chunk_upload_request__number_ranges, + 1, file_chunk_upload_request__number_ranges, (ProtobufCMessageInit) file_chunk_upload_request__init, NULL,NULL,NULL /* reserved[123] */ }; diff --git a/Software/Embedded_SW/Embedded/Communication/PMR/IO/FileChunkUploadRequest.pb-c.h b/Software/Embedded_SW/Embedded/Communication/PMR/IO/FileChunkUploadRequest.pb-c.h index 5b084a772..0010dd701 100644 --- a/Software/Embedded_SW/Embedded/Communication/PMR/IO/FileChunkUploadRequest.pb-c.h +++ b/Software/Embedded_SW/Embedded/Communication/PMR/IO/FileChunkUploadRequest.pb-c.h @@ -27,6 +27,7 @@ struct _FileChunkUploadRequest { ProtobufCMessage base; char *uploadid; + char *path; protobuf_c_boolean has_buffer; ProtobufCBinaryData buffer; protobuf_c_boolean has_iscanceled; @@ -34,7 +35,7 @@ struct _FileChunkUploadRequest }; #define FILE_CHUNK_UPLOAD_REQUEST__INIT \ { PROTOBUF_C_MESSAGE_INIT (&file_chunk_upload_request__descriptor) \ - , NULL, 0, {0,NULL}, 0, 0 } + , NULL, NULL, 0, {0,NULL}, 0, 0 } /* FileChunkUploadRequest methods */ diff --git a/Software/Embedded_SW/Embedded/Communication/PMR/IO/FileInfo.pb-c.c b/Software/Embedded_SW/Embedded/Communication/PMR/IO/FileInfo.pb-c.c index a27b5b1fc..dd71b8ac1 100644 --- a/Software/Embedded_SW/Embedded/Communication/PMR/IO/FileInfo.pb-c.c +++ b/Software/Embedded_SW/Embedded/Communication/PMR/IO/FileInfo.pb-c.c @@ -82,7 +82,7 @@ static const ProtobufCFieldDescriptor file_info__field_descriptors[6] = "Length", 3, PROTOBUF_C_LABEL_OPTIONAL, - PROTOBUF_C_TYPE_INT32, + PROTOBUF_C_TYPE_INT64, offsetof(FileInfo, has_length), offsetof(FileInfo, length), NULL, diff --git a/Software/Embedded_SW/Embedded/Communication/PMR/IO/FileInfo.pb-c.h b/Software/Embedded_SW/Embedded/Communication/PMR/IO/FileInfo.pb-c.h index 5875b98a8..393b8276b 100644 --- a/Software/Embedded_SW/Embedded/Communication/PMR/IO/FileInfo.pb-c.h +++ b/Software/Embedded_SW/Embedded/Communication/PMR/IO/FileInfo.pb-c.h @@ -30,7 +30,7 @@ struct _FileInfo char *name; char *fullpath; protobuf_c_boolean has_length; - int32_t length; + int64_t length; protobuf_c_boolean has_lastmodifieddate; int32_t lastmodifieddate; protobuf_c_boolean has_lastmodifiedtime; diff --git a/Software/Embedded_SW/Embedded/Communication/PMR/IO/FileUploadRequest.pb-c.c b/Software/Embedded_SW/Embedded/Communication/PMR/IO/FileUploadRequest.pb-c.c index 4b17c92ed..25349a4e1 100644 --- a/Software/Embedded_SW/Embedded/Communication/PMR/IO/FileUploadRequest.pb-c.c +++ b/Software/Embedded_SW/Embedded/Communication/PMR/IO/FileUploadRequest.pb-c.c @@ -55,12 +55,12 @@ void file_upload_request__free_unpacked static const ProtobufCFieldDescriptor file_upload_request__field_descriptors[2] = { { - "FileName", + "Path", 1, PROTOBUF_C_LABEL_OPTIONAL, PROTOBUF_C_TYPE_STRING, 0, /* quantifier_offset */ - offsetof(FileUploadRequest, filename), + offsetof(FileUploadRequest, path), NULL, NULL, 0, /* flags */ @@ -80,8 +80,8 @@ static const ProtobufCFieldDescriptor file_upload_request__field_descriptors[2] }, }; static const unsigned file_upload_request__field_indices_by_name[] = { - 0, /* field[0] = FileName */ 1, /* field[1] = Length */ + 0, /* field[0] = Path */ }; static const ProtobufCIntRange file_upload_request__number_ranges[1 + 1] = { diff --git a/Software/Embedded_SW/Embedded/Communication/PMR/IO/FileUploadRequest.pb-c.h b/Software/Embedded_SW/Embedded/Communication/PMR/IO/FileUploadRequest.pb-c.h index c4b936d12..d8eabb4ee 100644 --- a/Software/Embedded_SW/Embedded/Communication/PMR/IO/FileUploadRequest.pb-c.h +++ b/Software/Embedded_SW/Embedded/Communication/PMR/IO/FileUploadRequest.pb-c.h @@ -26,7 +26,7 @@ typedef struct _FileUploadRequest FileUploadRequest; struct _FileUploadRequest { ProtobufCMessage base; - char *filename; + char *path; protobuf_c_boolean has_length; int64_t length; }; diff --git a/Software/Embedded_SW/Embedded/Communication/PMR/IO/GetStorageInfoResponse.pb-c.c b/Software/Embedded_SW/Embedded/Communication/PMR/IO/GetStorageInfoResponse.pb-c.c index 864b46201..6c45145e5 100644 --- a/Software/Embedded_SW/Embedded/Communication/PMR/IO/GetStorageInfoResponse.pb-c.c +++ b/Software/Embedded_SW/Embedded/Communication/PMR/IO/GetStorageInfoResponse.pb-c.c @@ -58,7 +58,7 @@ static const ProtobufCFieldDescriptor get_storage_info_response__field_descripto "Capacity", 1, PROTOBUF_C_LABEL_OPTIONAL, - PROTOBUF_C_TYPE_INT32, + PROTOBUF_C_TYPE_INT64, offsetof(GetStorageInfoResponse, has_capacity), offsetof(GetStorageInfoResponse, capacity), NULL, @@ -70,7 +70,7 @@ static const ProtobufCFieldDescriptor get_storage_info_response__field_descripto "FreeSpace", 2, PROTOBUF_C_LABEL_OPTIONAL, - PROTOBUF_C_TYPE_INT32, + PROTOBUF_C_TYPE_INT64, offsetof(GetStorageInfoResponse, has_freespace), offsetof(GetStorageInfoResponse, freespace), NULL, diff --git a/Software/Embedded_SW/Embedded/Communication/PMR/IO/GetStorageInfoResponse.pb-c.h b/Software/Embedded_SW/Embedded/Communication/PMR/IO/GetStorageInfoResponse.pb-c.h index beda98113..822dafbb5 100644 --- a/Software/Embedded_SW/Embedded/Communication/PMR/IO/GetStorageInfoResponse.pb-c.h +++ b/Software/Embedded_SW/Embedded/Communication/PMR/IO/GetStorageInfoResponse.pb-c.h @@ -27,9 +27,9 @@ struct _GetStorageInfoResponse { ProtobufCMessage base; protobuf_c_boolean has_capacity; - int32_t capacity; + int64_t capacity; protobuf_c_boolean has_freespace; - int32_t freespace; + int64_t freespace; char *root; }; #define GET_STORAGE_INFO_RESPONSE__INIT \ diff --git a/Software/Embedded_SW/Embedded/DataDef.h b/Software/Embedded_SW/Embedded/DataDef.h index 9521f88f1..2298a41ed 100644 --- a/Software/Embedded_SW/Embedded/DataDef.h +++ b/Software/Embedded_SW/Embedded/DataDef.h @@ -121,7 +121,7 @@ enum #define CurrentMotDriver 0x08 #define VoltageMotDriver 0x00 -#define MagneticLImitSwitch 0x01 +//#define MagneticLImitSwitch 0x01 //#define FPGA_Reg_Size_Bits 16 diff --git a/Software/Embedded_SW/Embedded/Drivers/FPGA/JTAG_VME/slim_vme_8051/hardware.c b/Software/Embedded_SW/Embedded/Drivers/FPGA/JTAG_VME/slim_vme_8051/hardware.c index c331e9412..ec8481977 100644 --- a/Software/Embedded_SW/Embedded/Drivers/FPGA/JTAG_VME/slim_vme_8051/hardware.c +++ b/Software/Embedded_SW/Embedded/Drivers/FPGA/JTAG_VME/slim_vme_8051/hardware.c @@ -28,6 +28,9 @@ #include "inc/hw_types.h" #include "driverlib/gpio.h" +#include "delay.h" + + /************************************************************* * * * EXTERNAL VARIABLE * @@ -229,6 +232,7 @@ void writePort( unsigned char a_ucPins, unsigned char a_ucValue ) /* the unit of a_uiDelay is milliseconds */ void ispVMDelay( unsigned int a_uiDelay ) { + delayms(a_uiDelay); } /************************************************************* diff --git a/Software/Embedded_SW/Embedded/Drivers/USB_Communication/USBCDCD.c b/Software/Embedded_SW/Embedded/Drivers/USB_Communication/USBCDCD.c index 4ac6ee1f4..1666d5cb0 100644 --- a/Software/Embedded_SW/Embedded/Drivers/USB_Communication/USBCDCD.c +++ b/Software/Embedded_SW/Embedded/Drivers/USB_Communication/USBCDCD.c @@ -122,6 +122,9 @@ unsigned int USBCDCD_receiveData(unsigned char *_pBuff, unsigned int _timeout); bool USBCDCD_waitForConnect(unsigned int _timeout); +uint32_t DFUDetachCallback(void *pvCBData, uint32_t ui32Event, + uint32_t ui32MsgData, void *pvMsgData); + /* The languages supported by this device. */ const unsigned char langDescriptor[] = { 4, @@ -252,12 +255,100 @@ static tUSBDCDCDevice g_sCDCDevice = STRINGDESCRIPTORSCOUNT }; -//static tLineCoding g_sLineCoding = { -// 115200, /* 115200 baud rate. */ -// 1, /* 1 Stop Bit. */ -// 0, /* No Parity. */ -// 8 /* 8 Bits of data. */ -//}; +//***************************************************************************** +// +// The DFU runtime interface initialization and customization structures +// +//***************************************************************************** +tUSBDDFUDevice g_sDFUDevice = +{ + DFUDetachCallback, + (void *)&g_sDFUDevice +}; + +//**************************************************************************** +// +// The number of device class instances that this composite device will +// use. +// +//**************************************************************************** +#define NUM_DEVICES 2 + +//**************************************************************************** +// +// The array of devices supported by this composite device. +// +//**************************************************************************** +tCompositeEntry g_psCompDevices[NUM_DEVICES]; + +//**************************************************************************** +// +// Additional workspace required by the composite driver to hold a lookup +// table allowing mapping of composite interface and endpoint numbers to +// individual device class instances. +// +//**************************************************************************** +uint32_t g_pui32CompWorkspace[NUM_DEVICES]; + +//**************************************************************************** +// +// The instance data for this composite device. +// +//**************************************************************************** +tCompositeInstance g_sCompInstance; + +//**************************************************************************** +// +// Allocate the Device Data for the top level composite device class. +// +//**************************************************************************** +tUSBDCompositeDevice g_sCompDevice = +{ + // + // Stellaris VID. + // + USB_VID_TI_1CBE, + + // + // Stellaris PID for composite SERIAL/DFU device. + // + USB_PID_COMP_SERIAL, + + // + // This is in milliamps. + // + 250, + + // + // Bus powered device. + // + USB_CONF_ATTR_BUS_PWR, + + // + // Device event handler function pointer (receives connect, disconnect + // and other device-level notifications). + // + ControlHandler, + + // + // The string table. + // + g_ppui8StringDescriptors, + NUM_STRING_DESCRIPTORS, + + // + // The Composite device array. + // + NUM_DEVICES, + g_psCompDevices, +}; + +static tLineCoding g_sLineCoding = { + 115200, /* 115200 baud rate. */ + 1, /* 1 Stop Bit. */ + 0, /* No Parity. */ + 8 /* 8 Bits of data. */ +}; //***************************************************************************** @@ -271,7 +362,7 @@ static tUSBDCDCDevice g_sCDCDevice = //! \return Returns the character read from the USB port. // //***************************************************************************** -char USBGetChar(void) +/*char USBGetChar(void) { uint8_t ucChar; int len = 0; @@ -287,7 +378,7 @@ char USBGetChar(void) // return (ucChar); } - +*/ void USBFlush(void) { USBBufferFlush(&rxBuffer); @@ -391,6 +482,47 @@ void CheckForSerialStateChange(const tUSBDCDCDevice *psDevice, uint32_t ui32Erro } //***************************************************************************** // +// This is the callback from the USB DFU runtime interface driver. +// +// \param pvCBData is ignored by this function. +// \param ui32Event is one of the valid events for a DFU device. +// \param ui32MsgParam is defined by the event that occurs. +// \param pvMsgData is a pointer to data that is defined by the event that +// occurs. +// +// This function will be called to inform the application when a change occurs +// during operation as a DFU device. Currently, the only event passed to this +// callback is USBD_DFU_EVENT_DETACH which tells the recipient that they should +// pass control to the boot loader at the earliest, non-interrupt context +// point. +// +// \return This function will return 0. +// +//***************************************************************************** +uint32_t +DFUDetachCallback(void *pvCBData, uint32_t ui32Event, uint32_t ui32MsgData, + void *pvMsgData) +{ + if(ui32Event == USBD_DFU_EVENT_DETACH) + { + // + // Set the flag that the main loop uses to determine when it is time + // to transfer control back to the boot loader. Note that we + // absolutely DO NOT call USBDDFUUpdateBegin() here since we are + // currently in interrupt context and this would cause bad things to + // happen (and the boot loader to not work). + // + // + // Release updateSem + // + Semaphore_post(updateSem); + } + + return(0); +} + +//***************************************************************************** +// // Handles CDC driver notifications related to control and setup of the device. // // \param pvCBData is the client-supplied callback pointer for this channel. @@ -755,14 +887,35 @@ void USBCDCD_init(void) //if done several times in different places doesn't work in the upgrade. USBBufferInit(&txBuffer); USBBufferInit(&rxBuffer); + if (!USBDCDCCompositeInit(0, &g_sCDCDevice, &(g_sCompDevice.psDevices[0]))) + { + System_abort("Error initializing the serial device"); + } + if (!USBDDFUCompositeInit(0, &g_sDFUDevice, &(g_sCompDevice.psDevices[1]))) + { + System_abort("Error initializing the DFU device"); + } + + // + // Pass the USB library our device information, initialize the USB + // controller and connect the device to the bus. + // + g_sCompDevice.sPrivateData.sDeviceDescriptor.bcdUSB = 0X200; + USBDComposite = USBDCompositeInit(0, &g_sCompDevice, DESCRIPTOR_BUFFER_SIZE, g_pui8DescriptorBuffer); + if (!USBDComposite) + { + System_abort("Error initializing the composite device"); + } + +/* //if (!USBDCDCCompositeInit(0, &g_sCDCDevice, &(g_sCompDevice.psDevices[0]))) USBDComposite = USBDCDCInit(0, &g_sCDCDevice); if (!USBDComposite) { System_abort("Error initializing the serial device"); } - +*/ } diff --git a/Software/Embedded_SW/Embedded/Drivers/Valves/Valve.c b/Software/Embedded_SW/Embedded/Drivers/Valves/Valve.c index 50c021d40..39d010375 100644 --- a/Software/Embedded_SW/Embedded/Drivers/Valves/Valve.c +++ b/Software/Embedded_SW/Embedded/Drivers/Valves/Valve.c @@ -309,8 +309,10 @@ void EnableDisableAllDispensersValves(bool EnableOrDisable ) void Valve_Set(Valves_t Valve_Id, bool Direction) { +#ifndef EVALUATION_BOARD ValveRequest[Valve_Id].Direction = Direction; Valve_Command( Valve_Id); +#endif } //------------------------------------------------------------------------------------------------------------------------ diff --git a/Software/Embedded_SW/Embedded/Embedded.cfg b/Software/Embedded_SW/Embedded/Embedded.cfg index a49f86836..6ba47d133 100644 --- a/Software/Embedded_SW/Embedded/Embedded.cfg +++ b/Software/Embedded_SW/Embedded/Embedded.cfg @@ -178,6 +178,11 @@ task6Params.instance.name = "report"; task6Params.priority = 3; Program.global.report = Task.create("&reportService", task6Params); +var updateTaskParams = new Task.Params(); +updateTaskParams.instance.name = "update"; +updateTaskParams.priority = 4; +Program.global.update = Task.create("&updateTask", updateTaskParams); + /* ================ Text configuration ================ */ var Text = xdc.useModule('xdc.runtime.Text'); /* diff --git a/Software/Embedded_SW/Embedded/Modules/AlarmHandling/AlarmHandling.c b/Software/Embedded_SW/Embedded/Modules/AlarmHandling/AlarmHandling.c index b7b018cdb..b5c586b92 100644 --- a/Software/Embedded_SW/Embedded/Modules/AlarmHandling/AlarmHandling.c +++ b/Software/Embedded_SW/Embedded/Modules/AlarmHandling/AlarmHandling.c @@ -127,8 +127,8 @@ AlarmHandlingItem AlarmItem[MAX_SYSTEM_ALARMS]={ {eHundredMillisecond,TemperatureAlarm,TEMP_SENSE_ANALOG_DYEINGH_TEMP5,270,true,DEBUG_LOG_CATEGORY__Error,0xFF,10,0,false,EVENT_TYPE__DyeingHead5OverTemperature,NULL,"DyeingHead5 Over Temperature"}, {eHundredMillisecond,TemperatureAlarm,TEMP_SENSE_ANALOG_MIXCHIP_TEMP,270,true,DEBUG_LOG_CATEGORY__Error,0xFF,10,0,false,EVENT_TYPE__DyeingHead6OverTemperature,NULL,"DyeingHead6 Over Temperature"}, {eHundredMillisecond,TemperatureAlarm,TEMP_SENSE_ANALOG_DRYER_TEMP1,270,true,DEBUG_LOG_CATEGORY__Error,0xFF,10,0,false,EVENT_TYPE__DryerOverTemperature,NULL,"Dryer Over Temperature"}, -{eHundredMillisecond,TemperatureAlarm,TEMP_SENSE_ANALOG_DRYER_TEMP1,270,true,DEBUG_LOG_CATEGORY__Error,0xFF,10,0,false,EVENT_TYPE__DryerOverTemperature,NULL,"Dryer Over Temperature"}, -{eHundredMillisecond,TemperatureAlarm,TEMP_SENSE_ANALOG_DRYER_TEMP1,300,true,DEBUG_LOG_CATEGORY__Error,0xFF,10,0,false,EVENT_TYPE__DryerOverTemperature,NULL,"Dryer Over Temperature"}, +//{eHundredMillisecond,TemperatureAlarm,TEMP_SENSE_ANALOG_DRYER_TEMP1,270,true,DEBUG_LOG_CATEGORY__Error,0xFF,10,0,false,EVENT_TYPE__DryerOverTemperature,NULL,"Dryer Over Temperature"}, +//{eHundredMillisecond,TemperatureAlarm,TEMP_SENSE_ANALOG_DRYER_TEMP1,300,true,DEBUG_LOG_CATEGORY__Error,0xFF,10,0,false,EVENT_TYPE__DryerOverTemperature,NULL,"Dryer Over Temperature"}, //{eHundredMillisecond,TemperatureAlarm,TEMP_SENSE_AN_ENCLOSURETEMP3,9,false,DEBUG_LOG_CATEGORY__Error,0xFF,10,0,false,EVENT_TYPE__GeneralInternalOverTemperature,NULL,"Mixer PT100 Not Working"}, //{eHundredMillisecond,TemperatureAlarm,TEMP_SENSE_AN_ENCLOSURETEMP1,250,true,DEBUG_LOG_CATEGORY__Error,0xFF,0,0,false,EVENT_TYPE__GeneralInternalPT100 Not Working,NULL,"GeneralInternalPT100 Not Working"}, //{eHundredMillisecond,TemperatureAlarm,TEMP_SENSE_AN_ENCLOSURETEMP2,80,true,DEBUG_LOG_CATEGORY__Error,0xFF,0,0,false,EVENT_TYPE__GeneralInternalPT100 Not Working,NULL,"GeneralInternalPT100 Not Working"}, @@ -205,6 +205,7 @@ AlarmHandlingItem AlarmItem[MAX_SYSTEM_ALARMS]={ {eOneSecond,DoNotPollAlarm,0,0,false,DEBUG_LOG_CATEGORY__Warning,0xFF,0,0,false,EVENT_TYPE__ThreadTensionControlFailure,NULL,"Thread Tension Control Failure"}, }; char TestMessage[5]="Test"; +bool DispenserInUse[MAX_SYSTEM_DISPENSERS] = {false,false,false,false,false,false,false,false}; /* typedef struct { @@ -294,13 +295,16 @@ uint32_t AlarmHandlingConsequentActions(uint32_t AlarmId, DebugLogCategory Sever JobEndReasonEnum AlarmHandlingPrepareJob(void *CurrentJob) { JobTicket* JobTicket = CurrentJob; - bool DispenserInUse[MAX_SYSTEM_DISPENSERS] = {false,false,false,false,false,false,false,false}; EventType HeaterEventType[MAX_HEATERS_NUM] = {EVENT_TYPE__DryerOverTemperature,EVENT_TYPE__DryerOverTemperature,EVENT_TYPE__DryerOverTemperature,EVENT_TYPE__DyeingHead1OverTemperature,EVENT_TYPE__DyeingHead2OverTemperature, EVENT_TYPE__DyeingHead3OverTemperature,EVENT_TYPE__DyeingHead4OverTemperature,EVENT_TYPE__DyeingHead5OverTemperature,EVENT_TYPE__DyeingHead6OverTemperature, EVENT_TYPE__GeneralInternalOverTemperature}; int Segment_i,Brush_i,Dispenser_i,DispenserId,Alarm_i,Heater_i,AlarmId=0; HeaterState HeaterState; + for (Dispenser_i = 0;Dispenser_i < MAX_SYSTEM_DISPENSERS;Dispenser_i++) + { + DispenserInUse[Dispenser_i] = false; + } JobEndReasonEnum status = JOB_OK; if (JobTicket->n_segments == 0) return OK; diff --git a/Software/Embedded_SW/Embedded/Modules/Control/PIDAlgo.c b/Software/Embedded_SW/Embedded/Modules/Control/PIDAlgo.c index 72774461a..f9aee7929 100644 --- a/Software/Embedded_SW/Embedded/Modules/Control/PIDAlgo.c +++ b/Software/Embedded_SW/Embedded/Modules/Control/PIDAlgo.c @@ -52,8 +52,6 @@ float AdvancedPIDAlgorithmCalculation(float _setPoint,float _mesuredParam , PID_ } derivative = (error - *_pre_error)/params->dt; - float IntegralErrorMultiplier; - float ProportionalErrorMultiplier; output = params->Kp*error/params->ProportionalErrorMultiplier + params->Ki**_integral/params->IntegralErrorMultiplier + params->Kd*derivative; diff --git a/Software/Embedded_SW/Embedded/Modules/Diagnostics/Diagnostics.c b/Software/Embedded_SW/Embedded/Modules/Diagnostics/Diagnostics.c index 82e2d1ee1..9c4ceb8d7 100644 --- a/Software/Embedded_SW/Embedded/Modules/Diagnostics/Diagnostics.c +++ b/Software/Embedded_SW/Embedded/Modules/Diagnostics/Diagnostics.c @@ -90,7 +90,7 @@ double dryerzone3temperature[DIAGNOSTICS_LIMIT]; double dispensermotorfrequency[MAX_SYSTEM_DISPENSERS][DIAGNOSTICS_LIMIT]; double dispenserspressure[MAX_SYSTEM_DISPENSERS][DIAGNOSTICS_LIMIT]; -double MidTankpressure[MAX_SYSTEM_DISPENSERS][DIAGNOSTICS_LIMIT]; +double MidTankpressure[MAX_SYSTEM_DISPENSERS][1]; DoubleArray DispenserFreq[MAX_SYSTEM_DISPENSERS]; DoubleArray DiagnosticsDispenserPressure[MAX_SYSTEM_DISPENSERS]; @@ -198,7 +198,6 @@ void DiagnosticLoadMotor(int MotorId, int frequency) } void DiagnosticsLoadDigitalValues(void) { - //int i; DigitalOutputState[0].interfaceio = INTERFACE_IOS__GPO_DRYER_SSR3_CTRL; DigitalOutputState[0].value = GetHeaterState(0); @@ -367,7 +366,7 @@ void Diagnostic100msecCollection(void) { dispensermotorfrequency[i][DiagnosticsIndex] = MotorGetSpeed(HARDWARE_MOTOR_TYPE__MOTO_DISPENSER_1+i); dispenserspressure[i][DiagnosticsIndex] = GetDispenserPressure(i); //Read_MidTank_Pressure_Sensor - MidTankpressure[i][DiagnosticsIndex] = Get_MidTank_Pressure_Sensor(i); + MidTankpressure[i][0] = Get_MidTank_Pressure_Sensor(i); } /* dispenser1motorfrequency[DiagnosticsIndex] = MotorGetSpeed(HARDWARE_MOTOR_TYPE__MOTO_DISPENSER_1); dispenser2motorfrequency[DiagnosticsIndex] = MotorGetSpeed(HARDWARE_MOTOR_TYPE__MOTO_DISPENSER_2); @@ -554,6 +553,23 @@ void SendDiagnostics(void) DiagnosticsMonitor.n_dispenser8pressure = DiagnosticsIndex; DiagnosticsMonitor.dispenser8pressure = dispenserspressure[7]; + + DiagnosticsMonitor.n_midtank1level = 1; + DiagnosticsMonitor.midtank1level = MidTankpressure[0]; + DiagnosticsMonitor.n_midtank2level = 1; + DiagnosticsMonitor.midtank2level = MidTankpressure[1]; + DiagnosticsMonitor.n_midtank3level = 1; + DiagnosticsMonitor.midtank3level = MidTankpressure[2]; + DiagnosticsMonitor.n_midtank4level = 1; + DiagnosticsMonitor.midtank4level = MidTankpressure[3]; + DiagnosticsMonitor.n_midtank5level = 1; + DiagnosticsMonitor.midtank5level = MidTankpressure[4]; + DiagnosticsMonitor.n_midtank6level = 1; + DiagnosticsMonitor.midtank6level = MidTankpressure[5]; + DiagnosticsMonitor.n_midtank7level = 1; + DiagnosticsMonitor.midtank7level = MidTankpressure[6]; + DiagnosticsMonitor.n_midtank8level = 1; + DiagnosticsMonitor.midtank8level = MidTankpressure[7]; response.monitors = &DiagnosticsMonitor; //response.digitalpins = DigitalPinArray; response.n_componentsstates = 0; diff --git a/Software/Embedded_SW/Embedded/Modules/General/GeneralHardware.c b/Software/Embedded_SW/Embedded/Modules/General/GeneralHardware.c index 4ad9af903..f2618e65f 100644 --- a/Software/Embedded_SW/Embedded/Modules/General/GeneralHardware.c +++ b/Software/Embedded_SW/Embedded/Modules/General/GeneralHardware.c @@ -131,7 +131,6 @@ uint32_t HWConfiguration(UploadHardwareConfigurationRequest* UploadRequest) uint32_t HWConfigurationFunc(MessageContainer* requestContainer) { uint32_t status = 0; - int Motor_i, Dancer_i, Dispenser_i,PID_i; MessageContainer responseContainer; UploadHardwareConfigurationResponse response = UPLOAD_HARDWARE_CONFIGURATION_RESPONSE__INIT; diff --git a/Software/Embedded_SW/Embedded/Modules/General/process.c b/Software/Embedded_SW/Embedded/Modules/General/process.c index 96248ab8b..a918f6574 100644 --- a/Software/Embedded_SW/Embedded/Modules/General/process.c +++ b/Software/Embedded_SW/Embedded/Modules/General/process.c @@ -15,6 +15,10 @@ #include "PMR/Printing/UploadProcessParametersResponse.pb-c.h" #include "PMR/Hardware/HardwarePidControlType.pb-c.h" #include "PMR/common/MessageContainer.pb-c.h" +#include "drivers/Valves/Valve.h" +#include "drivers/I2C_Communication/ADC_MUX/ADC_MUX.h" +#include "modules/ids/ids_ex.h" + double dyeingspeed = 0; double dryerbufferlength = 0; @@ -33,6 +37,8 @@ ProcessParameters ProcessParametersKeep; uint32_t HandleProcessParameters(ProcessParameters* ProcessParams) { uint32_t status = 0; + int Disp_i; + if (ProcessParams->dryerzone1temp > MAX_ALLOWED_TEMPERATURE) status = ERROR_CODE__INVALID_PARAMETER; if (ProcessParams->dryerzone2temp > MAX_ALLOWED_TEMPERATURE) status = ERROR_CODE__INVALID_PARAMETER; if (ProcessParams->dryerzone3temp > MAX_ALLOWED_TEMPERATURE) status = ERROR_CODE__INVALID_PARAMETER; @@ -139,6 +145,12 @@ uint32_t HandleProcessParameters(ProcessParameters* ProcessParams) headairflow = ProcessParams->headairflow; dryerairflow = ProcessParams->dryerairflow; + for (Disp_i = 0;Disp_i < MAX_SYSTEM_DISPENSERS;Disp_i++) + { + Valve_Set(IDS_Id_to_AirValve[Disp_i], Atm_MidTank_ON ); //Atm_MidTank_OFF/ON + Read_MidTank_Pressure_Sensor(Disp_i); + Valve_Set(IDS_Id_to_AirValve[Disp_i], Atm_MidTank_OFF ); //Atm_MidTank_OFF/ON + } return status;//status; } diff --git a/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters.h b/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters.h index 975635342..7d0a94cbb 100644 --- a/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters.h +++ b/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters.h @@ -26,9 +26,9 @@ typedef struct HeaterPIDControlConfigstruc float outputproportionalband; //int32_t sensorcorrectionadjustment; //int32_t sensortypeandsetpointlimits; - //int32_t setpointramprateorsoftstartramp; + int32_t setpointramprateorsoftstartramp; //int32_t setpointcontroloutputrate; - //int32_t outputonoffhysteresisvalues; + int32_t outputonoffhysteresisvalue; //int32_t processvariablesamplingrate; //int32_t pvinputfilterfactormode; int32_t sensormaxvalue; diff --git a/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_init.c b/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_init.c index 169ae463e..4de0d8894 100644 --- a/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_init.c +++ b/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_init.c @@ -137,6 +137,8 @@ uint32_t HeaterConfigRequestMessage(HardwarePidControl* request) HeaterControl[HeaterId].id = HeaterId; HeaterControl[HeaterId].outputproportionalpowerlimit = request->outputproportionalpowerlimit; HeaterControl[HeaterId].outputproportionalband = request->outputproportionalband; + HeaterControl[HeaterId].setpointramprateorsoftstartramp = request->setpointramprateorsoftstartramp; + HeaterControl[HeaterId].outputonoffhysteresisvalue = request->outputonoffhysteresisvalue; if (HeaterId == HARDWARE_PID_CONTROL_TYPE__DryerAirTemperature) { HeaterControl[HARDWARE_PID_CONTROL_TYPE__DryerHeaterMain].sensormaxvalue = request->sensormaxvalue; diff --git a/Software/Embedded_SW/Embedded/Modules/IDS/IDS_print.c b/Software/Embedded_SW/Embedded/Modules/IDS/IDS_print.c index 62a534a1c..9db07f271 100644 --- a/Software/Embedded_SW/Embedded/Modules/IDS/IDS_print.c +++ b/Software/Embedded_SW/Embedded/Modules/IDS/IDS_print.c @@ -40,6 +40,8 @@ HardwarePidControlType ThreadDispenserIdToControlId[MAX_SYSTEM_DISPENSERS] = { bool DispenserReady[MAX_SYSTEM_DISPENSERS] = {true}; bool IDS_Active = false; /******************** STRUCTURES AND ENUMs ********************************************/ +uint32_t IDS_Valve_DistanceToSpoolReady(uint32_t deviceID, uint32_t ReadValue); +uint32_t IDS_Valve_PresegmentReady(uint32_t deviceID, uint32_t ReadValue); /******************** GLOBAL PARAMETERS ********************************************/ DispenserControlConfig_t DispenserControlConfig[MAX_SYSTEM_DISPENSERS]; uint32_t ControlIdtoDispenserId [MAX_SYSTEM_DISPENSERS] = {0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF}; diff --git a/Software/Embedded_SW/Embedded/StateMachines/Printing/JobSTM.c b/Software/Embedded_SW/Embedded/StateMachines/Printing/JobSTM.c index b60f844cb..49a01de82 100644 --- a/Software/Embedded_SW/Embedded/StateMachines/Printing/JobSTM.c +++ b/Software/Embedded_SW/Embedded/StateMachines/Printing/JobSTM.c @@ -440,9 +440,13 @@ void ThreadAbortJoggingRequestFunc(MessageContainer* requestContainer) responseContainer.continuous = false; uint8_t* container_buffer = my_malloc(message_container__get_packed_size(&responseContainer)); - size_t container_size = message_container__pack(&responseContainer, container_buffer); - my_free(responseContainer.data.data); - SendChars(container_buffer, container_size); + if (container_buffer) + { + size_t container_size = message_container__pack(&responseContainer, container_buffer); + SendChars(container_buffer, container_size); + } + if (responseContainer.data.data) + my_free(responseContainer.data.data); return ; @@ -483,9 +487,13 @@ uint32_t SendStubJobProgress(uint32_t IfIndex, uint32_t readValue) responseContainer = createContainer(MESSAGE_TYPE__StubJobResponse, JobToken, done, &response, &stub_job_response__pack, &stub_job_response__get_packed_size); container_buffer = my_malloc(message_container__get_packed_size(&responseContainer)); - size_t container_size = message_container__pack(&responseContainer, container_buffer); - SendChars((char*)container_buffer, container_size); - my_free(responseContainer.data.data); + if (container_buffer) + { + size_t container_size = message_container__pack(&responseContainer, container_buffer); + SendChars(container_buffer, container_size); + } + if (responseContainer.data.data) + my_free(responseContainer.data.data); return OK; } @@ -519,9 +527,13 @@ void Stub_JobRequest(MessageContainer* requestContainer) } // responseContainer.continuous = false; uint8_t* container_buffer = my_malloc(message_container__get_packed_size(&responseContainer)); - size_t container_size = message_container__pack(&responseContainer, container_buffer); - SendChars(container_buffer, container_size); - my_free(responseContainer.data.data); + if (container_buffer) + { + size_t container_size = message_container__pack(&responseContainer, container_buffer); + SendChars(container_buffer, container_size); + } + if (responseContainer.data.data) + my_free(responseContainer.data.data); return ; @@ -545,9 +557,13 @@ void Stub_AbortJobRequest(MessageContainer* requestContainer) responseContainer.continuous = false; uint8_t* container_buffer = my_malloc(message_container__get_packed_size(&responseContainer)); - size_t container_size = message_container__pack(&responseContainer, container_buffer); - my_free(responseContainer.data.data); - SendChars(container_buffer, container_size); + if (container_buffer) + { + size_t container_size = message_container__pack(&responseContainer, container_buffer); + SendChars(container_buffer, container_size); + } + if (responseContainer.data.data) + my_free(responseContainer.data.data); return ; @@ -733,9 +749,13 @@ void SendJobProgress(double ProcessedLength, int SegmentId, bool done, char *Mes responseContainer.error = ERROR_CODE__CONTINUOUS_RESPONSE_ABORTED; } } - size_t container_size = message_container__pack(&responseContainer, container_buffer); - my_free(responseContainer.data.data); - SendChars((char*)container_buffer, container_size); + if (container_buffer) + { + size_t container_size = message_container__pack(&responseContainer, container_buffer); + SendChars(container_buffer, container_size); + } + if (responseContainer.data.data) + my_free(responseContainer.data.data); } void JobStopReporting(void) { @@ -787,9 +807,13 @@ uint32_t CurrentJobRequestFunc(MessageContainer* requestContainer) } responseContainer.continuous = false; uint8_t* container_buffer = my_malloc(message_container__get_packed_size(&responseContainer)); - size_t container_size = message_container__pack(&responseContainer, container_buffer); - my_free(responseContainer.data.data); - SendChars(container_buffer, container_size); + if (container_buffer) + { + size_t container_size = message_container__pack(&responseContainer, container_buffer); + SendChars(container_buffer, container_size); + } + if (responseContainer.data.data) + my_free(responseContainer.data.data); return OK; } @@ -823,9 +847,13 @@ uint32_t ResumeCurrentJobRequestFunc(MessageContainer* requestContainer) } responseContainer.continuous = false; uint8_t* container_buffer = my_malloc(message_container__get_packed_size(&responseContainer)); - size_t container_size = message_container__pack(&responseContainer, container_buffer); - my_free(responseContainer.data.data); - SendChars(container_buffer, container_size); + if (container_buffer) + { + size_t container_size = message_container__pack(&responseContainer, container_buffer); + SendChars(container_buffer, container_size); + } + if (responseContainer.data.data) + my_free(responseContainer.data.data); return OK; } diff --git a/Software/Embedded_SW/Embedded/delay.c b/Software/Embedded_SW/Embedded/delay.c new file mode 100644 index 000000000..046acab43 --- /dev/null +++ b/Software/Embedded_SW/Embedded/delay.c @@ -0,0 +1,36 @@ +/* + * delay.c - Delay in millisecond and microsecond functions + * + * Convert from SysCtlDelay in TivaWare library to milliseconds and microseconds delay. + * + * Created on: Dec 13, 2018 + * Author: avi + */ + +#include <stdint.h> +#include <stdbool.h> +#include "driverlib/sysctl.h" +#include "Include.h" + + + +void delayms(uint32_t ui32ms) +{ + //SysCtlClockGet(); + // 1 clock cycle = 1 / SysCtlClockGet() second + // 1 SysCtlDelay = 3 clock cycle = 3 / SysCtlClockGet() second + // 1 second = SysCtlClockGet() / 3 + // 0.001 second = 1 ms = SysCtlClockGet() / 3 / 1000 + + SysCtlDelay(ui32ms * (SYS_CLK_FREQ / 3 / 1000)); +} + +void delayUs(uint32_t ui32Us) +{ + SysCtlDelay(ui32Us * (SYS_CLK_FREQ / 3 / 1000000)); +} + + + + + diff --git a/Software/Embedded_SW/Embedded/delay.h b/Software/Embedded_SW/Embedded/delay.h new file mode 100644 index 000000000..d35c904fd --- /dev/null +++ b/Software/Embedded_SW/Embedded/delay.h @@ -0,0 +1,17 @@ +/* + * delay.h + * + * Created on: Dec 13, 2018 + * Author: avi + */ + +#ifndef DELAY_H_ +#define DELAY_H_ + +void delayms(uint32_t ui32ms); + +void delayUs(uint32_t ui32Us); + + + +#endif /* DELAY_H_ */ |
