diff options
| author | Shlomo Hecht <shlomo@twine-s.com> | 2019-09-18 09:38:52 +0300 |
|---|---|---|
| committer | Shlomo Hecht <shlomo@twine-s.com> | 2019-09-18 09:38:52 +0300 |
| commit | 22aea2d70ade546a64f2339e06ea1bcb7c10b699 (patch) | |
| tree | 664756135fa2b76530a40498c3ea2209c3f9f3c5 /Software | |
| parent | 655862d7719e3186071107ebe6f2da0f50aa9fd1 (diff) | |
| download | Tango-22aea2d70ade546a64f2339e06ea1bcb7c10b699.tar.gz Tango-22aea2d70ade546a64f2339e06ea1bcb7c10b699.zip | |
set Debug log minimal category + some warnings handled
Diffstat (limited to 'Software')
17 files changed, 483 insertions, 83 deletions
diff --git a/Software/Embedded_SW/Embedded/Common/Utilities/RFIDTagHandling.c b/Software/Embedded_SW/Embedded/Common/Utilities/RFIDTagHandling.c index f1e354743..e668c10a4 100644 --- a/Software/Embedded_SW/Embedded/Common/Utilities/RFIDTagHandling.c +++ b/Software/Embedded_SW/Embedded/Common/Utilities/RFIDTagHandling.c @@ -105,7 +105,7 @@ CartridgeTagContent * RFID_Tag2PPC(RfidTagContent *Tag) return NULL; - cartridge_Tag_content__init(PpcTag); + cartridge_tag_content__init(PpcTag); PpcTag->has_uniqueid = true; PpcTag->uniqueid = Tag->uniqueid; PpcTag->serialnumber = Tag->serialnumber; @@ -137,7 +137,7 @@ CartridgeTagContent * RFID_Tag2PPC(RfidTagContent *Tag) PpcTag->inkempty = Tag->inkempty; PpcTag->has_wasteempty = true; PpcTag->wasteempty = Tag->wasteempty; - PpcTag->has_wastefilling; + PpcTag->has_wastefilling = true; PpcTag->wastefilling = Tag->wastefilling; PpcTag->has_wastefull = true; PpcTag->wastefull = Tag->wastefull; diff --git a/Software/Embedded_SW/Embedded/Common/report/report.h b/Software/Embedded_SW/Embedded/Common/report/report.h index 093481081..69dd15bdb 100644 --- a/Software/Embedded_SW/Embedded/Common/report/report.h +++ b/Software/Embedded_SW/Embedded/Common/report/report.h @@ -123,6 +123,8 @@ extern STATUS ReportInit(ReportInitParams InitParams); extern uint32_t ReportInitMessage(MessageContainer* requestContainer); extern void ReportStopReporting(void); extern uint32_t StopReportInitMessage(MessageContainer* requestContainer); +uint32_t SetDebugLogCategoryFunc(MessageContainer* requestContainer); +void ReportResetReason(void); /*************************************************************************** diff --git a/Software/Embedded_SW/Embedded/Common/report/reportInit.c b/Software/Embedded_SW/Embedded/Common/report/reportInit.c index d633ffc00..db131a13e 100644 --- a/Software/Embedded_SW/Embedded/Common/report/reportInit.c +++ b/Software/Embedded_SW/Embedded/Common/report/reportInit.c @@ -37,6 +37,8 @@ #include "PMR/debugging/StopDebugLogRequest.pb-c.h" #include "PMR/debugging/StartDebugLogResponse.pb-c.h" #include "PMR/debugging/StopDebugLogResponse.pb-c.h" +#include "PMR/debugging/SetDebugLogCategoryRequest.pb-c.h" +#include "PMR/debugging/SetDebugLogCategoryResponse.pb-c.h" #include "modules/General/process.h" @@ -122,6 +124,46 @@ int ReportResponseFunc(char *message, /* The formatted message } +void ReportResetReason(void) +{ + /* + #define SYSCTL_CAUSE_HSRVREQ 0x00001000 // Hardware System Service Request + #define SYSCTL_CAUSE_HIB 0x00000040 // Hibernate reset + #define SYSCTL_CAUSE_WDOG1 0x00000020 // Watchdog 1 reset + #define SYSCTL_CAUSE_SW 0x00000010 // Software reset + #define SYSCTL_CAUSE_WDOG0 0x00000008 // Watchdog 0 reset + #define SYSCTL_CAUSE_BOR 0x00000004 // Brown-out reset + #define SYSCTL_CAUSE_POR 0x00000002 // Power on reset + #define SYSCTL_CAUSE_EXT 0x00000001 // External reset + */ + uint32_t RESC = SysCtlResetCauseGet(); + char ResetMessage[200] = "Reset Reason Register"; + if (RESC & SYSCTL_CAUSE_HSRVREQ) + strcat(ResetMessage, ", Service Req"); + + if (RESC & SYSCTL_CAUSE_HIB) + strcat(ResetMessage, ", Hibernate"); + + if (RESC & SYSCTL_CAUSE_WDOG1) + strcat(ResetMessage, ", Watchdog 1"); + + if (RESC & SYSCTL_CAUSE_SW) + strcat(ResetMessage, ", Software"); + + if (RESC & SYSCTL_CAUSE_WDOG0) + strcat(ResetMessage, ", Watchdog 0"); + + if (RESC & SYSCTL_CAUSE_BOR) + strcat(ResetMessage, ", Brown-out"); + + if (RESC & SYSCTL_CAUSE_POR) + strcat(ResetMessage, ", Power on"); + + if (RESC & SYSCTL_CAUSE_EXT) + strcat(ResetMessage, ", External"); + + Report(ResetMessage, __FILE__, __LINE__, RESC, RpWarning, RESC, 0); +} uint32_t ReportInitMessage(MessageContainer* requestContainer) { @@ -146,17 +188,7 @@ uint32_t ReportInitMessage(MessageContainer* requestContainer) #define SYSCTL_CAUSE_POR 0x00000002 // Power on reset #define SYSCTL_CAUSE_EXT 0x00000001 // External reset */ - uint32_t RESC = SysCtlResetCauseGet (); - char ResetMessage[200] = "Reset Reason Register"; - if (RESC & SYSCTL_CAUSE_HSRVREQ) strcat (ResetMessage,", Service Req"); - if (RESC & SYSCTL_CAUSE_HIB) strcat (ResetMessage,", Hibernate"); - if (RESC & SYSCTL_CAUSE_WDOG1) strcat (ResetMessage,", Watchdog 1"); - if (RESC & SYSCTL_CAUSE_SW) strcat (ResetMessage,", Software"); - if (RESC & SYSCTL_CAUSE_WDOG0) strcat (ResetMessage,", Watchdog 0"); - if (RESC & SYSCTL_CAUSE_BOR) strcat (ResetMessage,", Brown-out"); - if (RESC & SYSCTL_CAUSE_POR) strcat (ResetMessage,", Power on"); - if (RESC & SYSCTL_CAUSE_EXT) strcat (ResetMessage,", External"); - Report(ResetMessage,__FILE__,__LINE__,RESC,RpWarning,status,0); + ReportResetReason(); Task_sleep (100); /*SysCtlResetCauseClear(RESC);*/ @@ -170,6 +202,62 @@ uint32_t ReportInitMessage(MessageContainer* requestContainer) #endif return status; } + +uint32_t SetDebugLogCategoryFunc(MessageContainer* requestContainer) +{ + MessageContainer responseContainer; + + SetDebugLogCategoryRequest* request = set_debug_log_category_request__unpack(NULL, requestContainer->data.len, requestContainer->data.data); + + SetDebugLogCategoryResponse response = SET_DEBUG_LOG_CATEGORY_RESPONSE__INIT; + uint32_t status = ERROR; + + if (request->has_minimumcategory) + { + switch(request->minimumcategory) + { + case DEBUG_LOG_CATEGORY__Info: + ReportSeveritySet(RpMessage); + status = OK; + break; + case DEBUG_LOG_CATEGORY__Warning: + ReportSeveritySet(RpWarning); + status = OK; + break; + case DEBUG_LOG_CATEGORY__Error: + ReportSeveritySet(RpError); + status = OK; + break; + case DEBUG_LOG_CATEGORY__Critical: + ReportSeveritySet(RpFatalError); + status = OK; + break; + case DEBUG_LOG_CATEGORY__Debug: + ReportSeveritySet(RpPrivate); + status = OK; + break; + default: + break; + } + } + + responseContainer = createContainer(MESSAGE_TYPE__SetDebugLogCategoryResponse, protobufToken, false, &response, &set_debug_log_category_response__pack, &set_debug_log_category_response__get_packed_size); + responseContainer.continuous = false; + if (status != OK) + { + LOG_ERROR(request->minimumcategory,"SetDebugLogCategory failed"); + responseContainer.error = ERROR_CODE__INVALID_PARAMETER; + responseContainer.has_error = true; + } + 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); + //USBCDCD_sendData(container_buffer, container_size,10); + SendChars(container_buffer, container_size); + //free (container_buffer); + +return OK; +} uint32_t StopReportInitMessage(MessageContainer* requestContainer) { diff --git a/Software/Embedded_SW/Embedded/Communication/Container.c b/Software/Embedded_SW/Embedded/Communication/Container.c index 18f8b4ec5..11bdbe0c8 100644 --- a/Software/Embedded_SW/Embedded/Communication/Container.c +++ b/Software/Embedded_SW/Embedded/Communication/Container.c @@ -254,6 +254,9 @@ void receive_callback(char* buffer, size_t length) case MESSAGE_TYPE__StopDebugLogRequest: StopReportInitMessage(requestContainer); break; + case MESSAGE_TYPE__SetDebugLogCategoryRequest: + SetDebugLogCategoryFunc(requestContainer); + break; case MESSAGE_TYPE__JobRequest: JobRequestFunc(requestContainer); break; 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 2f8a86d66..0cc98181a 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[223] = +static const ProtobufCEnumValue message_type__enum_values_by_number[225] = { { "None", "MESSAGE_TYPE__None", 0 }, { "ErrorResponse", "MESSAGE_TYPE__ErrorResponse", 1 }, @@ -188,6 +188,8 @@ static const ProtobufCEnumValue message_type__enum_values_by_number[223] = { "StartDebugLogResponse", "MESSAGE_TYPE__StartDebugLogResponse", 4001 }, { "StopDebugLogRequest", "MESSAGE_TYPE__StopDebugLogRequest", 4002 }, { "StopDebugLogResponse", "MESSAGE_TYPE__StopDebugLogResponse", 4003 }, + { "SetDebugLogCategoryRequest", "MESSAGE_TYPE__SetDebugLogCategoryRequest", 4004 }, + { "SetDebugLogCategoryResponse", "MESSAGE_TYPE__SetDebugLogCategoryResponse", 4005 }, { "UploadHardwareConfigurationRequest", "MESSAGE_TYPE__UploadHardwareConfigurationRequest", 5000 }, { "UploadHardwareConfigurationResponse", "MESSAGE_TYPE__UploadHardwareConfigurationResponse", 5001 }, { "SystemResetRequest", "MESSAGE_TYPE__SystemResetRequest", 5002 }, @@ -234,72 +236,72 @@ static const ProtobufCEnumValue message_type__enum_values_by_number[223] = { "StopMachineStatusUpdateResponse", "MESSAGE_TYPE__StopMachineStatusUpdateResponse", 9003 }, }; static const ProtobufCIntRange message_type__value_ranges[] = { -{0, 0},{3, 2},{1000, 104},{2000, 119},{3000, 165},{4000, 175},{5000, 179},{6000, 183},{7000, 189},{8000, 213},{9000, 219},{0, 223} +{0, 0},{3, 2},{1000, 104},{2000, 119},{3000, 165},{4000, 175},{5000, 181},{6000, 185},{7000, 191},{8000, 215},{9000, 221},{0, 225} }; -static const ProtobufCEnumValueIndex message_type__enum_values_by_name[223] = +static const ProtobufCEnumValueIndex message_type__enum_values_by_name[225] = { { "AbortJobRequest", 167 }, { "AbortJobResponse", 168 }, - { "ActivateVersionRequest", 211 }, - { "ActivateVersionResponse", 212 }, + { "ActivateVersionRequest", 213 }, + { "ActivateVersionResponse", 214 }, { "CalculateRequest", 2 }, { "CalculateResponse", 3 }, { "CartridgeValidationRequest", 163 }, { "CartridgeValidationResponse", 164 }, { "ColorProfileRequest", 117 }, { "ColorProfileResponse", 118 }, - { "ConnectRequest", 185 }, - { "ConnectResponse", 186 }, - { "CreateRequest", 197 }, - { "CreateResponse", 198 }, + { "ConnectRequest", 187 }, + { "ConnectResponse", 188 }, + { "CreateRequest", 199 }, + { "CreateResponse", 200 }, { "CurrentJobRequest", 171 }, { "CurrentJobResponse", 172 }, - { "DeleteRequest", 199 }, - { "DeleteResponse", 200 }, + { "DeleteRequest", 201 }, + { "DeleteResponse", 202 }, { "DirectSynchronizationRequest", 109 }, { "DirectSynchronizationResponse", 110 }, - { "DisconnectRequest", 187 }, - { "DisconnectResponse", 188 }, + { "DisconnectRequest", 189 }, + { "DisconnectResponse", 190 }, { "DispenserAbortHomingRequest", 129 }, { "DispenserAbortHomingResponse", 130 }, { "DispenserAbortJoggingRequest", 135 }, { "DispenserAbortJoggingResponse", 136 }, - { "DispenserDataRequest", 213 }, - { "DispenserDataResponse", 214 }, + { "DispenserDataRequest", 215 }, + { "DispenserDataResponse", 216 }, { "DispenserHomingRequest", 131 }, { "DispenserHomingResponse", 132 }, { "DispenserJoggingRequest", 133 }, { "DispenserJoggingResponse", 134 }, { "ErrorResponse", 1 }, - { "ExecuteProcessRequest", 193 }, - { "ExecuteProcessResponse", 194 }, + { "ExecuteProcessRequest", 195 }, + { "ExecuteProcessResponse", 196 }, { "ExternalBridgeLoginRequest", 105 }, { "ExternalBridgeLoginResponse", 106 }, { "ExternalBridgeLogoutRequest", 107 }, { "ExternalBridgeLogoutResponse", 108 }, { "ExternalBridgeUdpDiscoveryPacket", 104 }, - { "FileChunkDownloadRequest", 207 }, - { "FileChunkDownloadResponse", 208 }, - { "FileChunkUploadRequest", 191 }, - { "FileChunkUploadResponse", 192 }, - { "FileDownloadRequest", 205 }, - { "FileDownloadResponse", 206 }, - { "FileUploadRequest", 189 }, - { "FileUploadResponse", 190 }, - { "GetFilesRequest", 203 }, - { "GetFilesResponse", 204 }, - { "GetStorageInfoRequest", 201 }, - { "GetStorageInfoResponse", 202 }, + { "FileChunkDownloadRequest", 209 }, + { "FileChunkDownloadResponse", 210 }, + { "FileChunkUploadRequest", 193 }, + { "FileChunkUploadResponse", 194 }, + { "FileDownloadRequest", 207 }, + { "FileDownloadResponse", 208 }, + { "FileUploadRequest", 191 }, + { "FileUploadResponse", 192 }, + { "GetFilesRequest", 205 }, + { "GetFilesResponse", 206 }, + { "GetStorageInfoRequest", 203 }, + { "GetStorageInfoResponse", 204 }, { "JobRequest", 165 }, { "JobResponse", 166 }, - { "KeepAliveRequest", 183 }, - { "KeepAliveResponse", 184 }, - { "KillProcessRequest", 195 }, - { "KillProcessResponse", 196 }, - { "MachineCalibrationDataRequest", 217 }, - { "MachineCalibrationDataResponse", 218 }, - { "MidTankDataSetupRequest", 215 }, - { "MidTankDataSetupResponse", 216 }, + { "KeepAliveRequest", 185 }, + { "KeepAliveResponse", 186 }, + { "KillProcessRequest", 197 }, + { "KillProcessResponse", 198 }, + { "MachineCalibrationDataRequest", 219 }, + { "MachineCalibrationDataResponse", 220 }, + { "MidTankDataSetupRequest", 217 }, + { "MidTankDataSetupResponse", 218 }, { "MotorAbortHomingRequest", 121 }, { "MotorAbortHomingResponse", 122 }, { "MotorAbortJoggingRequest", 127 }, @@ -321,6 +323,8 @@ static const ProtobufCEnumValueIndex message_type__enum_values_by_name[223] = { "SetBlowerStateResponse", 156 }, { "SetComponentValueRequest", 143 }, { "SetComponentValueResponse", 144 }, + { "SetDebugLogCategoryRequest", 179 }, + { "SetDebugLogCategoryResponse", 180 }, { "SetDigitalOutRequest", 137 }, { "SetDigitalOutResponse", 138 }, { "SetHeaterStateRequest", 153 }, @@ -337,8 +341,8 @@ static const ProtobufCEnumValueIndex message_type__enum_values_by_name[223] = { "StartDiagnosticsResponse", 120 }, { "StartEventsNotificationRequest", 149 }, { "StartEventsNotificationResponse", 150 }, - { "StartMachineStatusUpdateRequest", 219 }, - { "StartMachineStatusUpdateResponse", 220 }, + { "StartMachineStatusUpdateRequest", 221 }, + { "StartMachineStatusUpdateResponse", 222 }, { "StopApplicationLogsRequest", 115 }, { "StopApplicationLogsResponse", 116 }, { "StopCartridgesUpdateRequest", 161 }, @@ -349,8 +353,8 @@ static const ProtobufCEnumValueIndex message_type__enum_values_by_name[223] = { "StopDiagnosticsResponse", 148 }, { "StopEventsNotificationRequest", 151 }, { "StopEventsNotificationResponse", 152 }, - { "StopMachineStatusUpdateRequest", 221 }, - { "StopMachineStatusUpdateResponse", 222 }, + { "StopMachineStatusUpdateRequest", 223 }, + { "StopMachineStatusUpdateResponse", 224 }, { "StubAbortJobRequest", 100 }, { "StubAbortJobResponse", 101 }, { "StubCartridgeReadRequest", 6 }, @@ -449,18 +453,18 @@ static const ProtobufCEnumValueIndex message_type__enum_values_by_name[223] = { "StubTivaWriteRegResponse", 79 }, { "StubValveRequest", 30 }, { "StubValveResponse", 31 }, - { "SystemResetRequest", 181 }, - { "SystemResetResponse", 182 }, + { "SystemResetRequest", 183 }, + { "SystemResetResponse", 184 }, { "ThreadAbortJoggingRequest", 141 }, { "ThreadAbortJoggingResponse", 142 }, { "ThreadJoggingRequest", 139 }, { "ThreadJoggingResponse", 140 }, - { "UploadHardwareConfigurationRequest", 179 }, - { "UploadHardwareConfigurationResponse", 180 }, + { "UploadHardwareConfigurationRequest", 181 }, + { "UploadHardwareConfigurationResponse", 182 }, { "UploadProcessParametersRequest", 169 }, { "UploadProcessParametersResponse", 170 }, - { "ValidateVersionRequest", 209 }, - { "ValidateVersionResponse", 210 }, + { "ValidateVersionRequest", 211 }, + { "ValidateVersionResponse", 212 }, }; const ProtobufCEnumDescriptor message_type__descriptor = { @@ -469,9 +473,9 @@ const ProtobufCEnumDescriptor message_type__descriptor = "MessageType", "MessageType", "", - 223, + 225, message_type__enum_values_by_number, - 223, + 225, message_type__enum_values_by_name, 11, 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 71e0db881..eebad14ca 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 @@ -199,6 +199,8 @@ typedef enum _MessageType { MESSAGE_TYPE__StartDebugLogResponse = 4001, MESSAGE_TYPE__StopDebugLogRequest = 4002, MESSAGE_TYPE__StopDebugLogResponse = 4003, + MESSAGE_TYPE__SetDebugLogCategoryRequest = 4004, + MESSAGE_TYPE__SetDebugLogCategoryResponse = 4005, MESSAGE_TYPE__UploadHardwareConfigurationRequest = 5000, MESSAGE_TYPE__UploadHardwareConfigurationResponse = 5001, MESSAGE_TYPE__SystemResetRequest = 5002, diff --git a/Software/Embedded_SW/Embedded/Communication/PMR/Debugging/SetDebugLogCategoryRequest.pb-c.c b/Software/Embedded_SW/Embedded/Communication/PMR/Debugging/SetDebugLogCategoryRequest.pb-c.c new file mode 100644 index 000000000..08841b53c --- /dev/null +++ b/Software/Embedded_SW/Embedded/Communication/PMR/Debugging/SetDebugLogCategoryRequest.pb-c.c @@ -0,0 +1,92 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: SetDebugLogCategoryRequest.proto */ + +/* Do not generate deprecated warnings for self */ +#ifndef PROTOBUF_C__NO_DEPRECATED +#define PROTOBUF_C__NO_DEPRECATED +#endif + +#include "SetDebugLogCategoryRequest.pb-c.h" +void set_debug_log_category_request__init + (SetDebugLogCategoryRequest *message) +{ + static const SetDebugLogCategoryRequest init_value = SET_DEBUG_LOG_CATEGORY_REQUEST__INIT; + *message = init_value; +} +size_t set_debug_log_category_request__get_packed_size + (const SetDebugLogCategoryRequest *message) +{ + assert(message->base.descriptor == &set_debug_log_category_request__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t set_debug_log_category_request__pack + (const SetDebugLogCategoryRequest *message, + uint8_t *out) +{ + assert(message->base.descriptor == &set_debug_log_category_request__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t set_debug_log_category_request__pack_to_buffer + (const SetDebugLogCategoryRequest *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &set_debug_log_category_request__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +SetDebugLogCategoryRequest * + set_debug_log_category_request__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (SetDebugLogCategoryRequest *) + protobuf_c_message_unpack (&set_debug_log_category_request__descriptor, + allocator, len, data); +} +void set_debug_log_category_request__free_unpacked + (SetDebugLogCategoryRequest *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &set_debug_log_category_request__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +static const ProtobufCFieldDescriptor set_debug_log_category_request__field_descriptors[1] = +{ + { + "MinimumCategory", + 1, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_ENUM, + offsetof(SetDebugLogCategoryRequest, has_minimumcategory), + offsetof(SetDebugLogCategoryRequest, minimumcategory), + &debug_log_category__descriptor, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned set_debug_log_category_request__field_indices_by_name[] = { + 0, /* field[0] = MinimumCategory */ +}; +static const ProtobufCIntRange set_debug_log_category_request__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 1 } +}; +const ProtobufCMessageDescriptor set_debug_log_category_request__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "SetDebugLogCategoryRequest", + "SetDebugLogCategoryRequest", + "SetDebugLogCategoryRequest", + "", + sizeof(SetDebugLogCategoryRequest), + 1, + set_debug_log_category_request__field_descriptors, + set_debug_log_category_request__field_indices_by_name, + 1, set_debug_log_category_request__number_ranges, + (ProtobufCMessageInit) set_debug_log_category_request__init, + NULL,NULL,NULL /* reserved[123] */ +}; diff --git a/Software/Embedded_SW/Embedded/Communication/PMR/Debugging/SetDebugLogCategoryRequest.pb-c.h b/Software/Embedded_SW/Embedded/Communication/PMR/Debugging/SetDebugLogCategoryRequest.pb-c.h new file mode 100644 index 000000000..3c50cce05 --- /dev/null +++ b/Software/Embedded_SW/Embedded/Communication/PMR/Debugging/SetDebugLogCategoryRequest.pb-c.h @@ -0,0 +1,73 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: SetDebugLogCategoryRequest.proto */ + +#ifndef PROTOBUF_C_SetDebugLogCategoryRequest_2eproto__INCLUDED +#define PROTOBUF_C_SetDebugLogCategoryRequest_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 "DebugLogCategory.pb-c.h" + +typedef struct _SetDebugLogCategoryRequest SetDebugLogCategoryRequest; + + +/* --- enums --- */ + + +/* --- messages --- */ + +struct _SetDebugLogCategoryRequest +{ + ProtobufCMessage base; + protobuf_c_boolean has_minimumcategory; + DebugLogCategory minimumcategory; +}; +#define SET_DEBUG_LOG_CATEGORY_REQUEST__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&set_debug_log_category_request__descriptor) \ + , 0, DEBUG_LOG_CATEGORY__Info } + + +/* SetDebugLogCategoryRequest methods */ +void set_debug_log_category_request__init + (SetDebugLogCategoryRequest *message); +size_t set_debug_log_category_request__get_packed_size + (const SetDebugLogCategoryRequest *message); +size_t set_debug_log_category_request__pack + (const SetDebugLogCategoryRequest *message, + uint8_t *out); +size_t set_debug_log_category_request__pack_to_buffer + (const SetDebugLogCategoryRequest *message, + ProtobufCBuffer *buffer); +SetDebugLogCategoryRequest * + set_debug_log_category_request__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void set_debug_log_category_request__free_unpacked + (SetDebugLogCategoryRequest *message, + ProtobufCAllocator *allocator); +/* --- per-message closures --- */ + +typedef void (*SetDebugLogCategoryRequest_Closure) + (const SetDebugLogCategoryRequest *message, + void *closure_data); + +/* --- services --- */ + + +/* --- descriptors --- */ + +extern const ProtobufCMessageDescriptor set_debug_log_category_request__descriptor; + +PROTOBUF_C__END_DECLS + + +#endif /* PROTOBUF_C_SetDebugLogCategoryRequest_2eproto__INCLUDED */ diff --git a/Software/Embedded_SW/Embedded/Communication/PMR/Debugging/SetDebugLogCategoryResponse.pb-c.c b/Software/Embedded_SW/Embedded/Communication/PMR/Debugging/SetDebugLogCategoryResponse.pb-c.c new file mode 100644 index 000000000..a8d52bc02 --- /dev/null +++ b/Software/Embedded_SW/Embedded/Communication/PMR/Debugging/SetDebugLogCategoryResponse.pb-c.c @@ -0,0 +1,72 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: SetDebugLogCategoryResponse.proto */ + +/* Do not generate deprecated warnings for self */ +#ifndef PROTOBUF_C__NO_DEPRECATED +#define PROTOBUF_C__NO_DEPRECATED +#endif + +#include "SetDebugLogCategoryResponse.pb-c.h" +void set_debug_log_category_response__init + (SetDebugLogCategoryResponse *message) +{ + static const SetDebugLogCategoryResponse init_value = SET_DEBUG_LOG_CATEGORY_RESPONSE__INIT; + *message = init_value; +} +size_t set_debug_log_category_response__get_packed_size + (const SetDebugLogCategoryResponse *message) +{ + assert(message->base.descriptor == &set_debug_log_category_response__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t set_debug_log_category_response__pack + (const SetDebugLogCategoryResponse *message, + uint8_t *out) +{ + assert(message->base.descriptor == &set_debug_log_category_response__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t set_debug_log_category_response__pack_to_buffer + (const SetDebugLogCategoryResponse *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &set_debug_log_category_response__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +SetDebugLogCategoryResponse * + set_debug_log_category_response__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (SetDebugLogCategoryResponse *) + protobuf_c_message_unpack (&set_debug_log_category_response__descriptor, + allocator, len, data); +} +void set_debug_log_category_response__free_unpacked + (SetDebugLogCategoryResponse *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &set_debug_log_category_response__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +#define set_debug_log_category_response__field_descriptors NULL +#define set_debug_log_category_response__field_indices_by_name NULL +#define set_debug_log_category_response__number_ranges NULL +const ProtobufCMessageDescriptor set_debug_log_category_response__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "SetDebugLogCategoryResponse", + "SetDebugLogCategoryResponse", + "SetDebugLogCategoryResponse", + "", + sizeof(SetDebugLogCategoryResponse), + 0, + set_debug_log_category_response__field_descriptors, + set_debug_log_category_response__field_indices_by_name, + 0, set_debug_log_category_response__number_ranges, + (ProtobufCMessageInit) set_debug_log_category_response__init, + NULL,NULL,NULL /* reserved[123] */ +}; diff --git a/Software/Embedded_SW/Embedded/Communication/PMR/Debugging/SetDebugLogCategoryResponse.pb-c.h b/Software/Embedded_SW/Embedded/Communication/PMR/Debugging/SetDebugLogCategoryResponse.pb-c.h new file mode 100644 index 000000000..dedca6062 --- /dev/null +++ b/Software/Embedded_SW/Embedded/Communication/PMR/Debugging/SetDebugLogCategoryResponse.pb-c.h @@ -0,0 +1,70 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: SetDebugLogCategoryResponse.proto */ + +#ifndef PROTOBUF_C_SetDebugLogCategoryResponse_2eproto__INCLUDED +#define PROTOBUF_C_SetDebugLogCategoryResponse_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 + + +typedef struct _SetDebugLogCategoryResponse SetDebugLogCategoryResponse; + + +/* --- enums --- */ + + +/* --- messages --- */ + +struct _SetDebugLogCategoryResponse +{ + ProtobufCMessage base; +}; +#define SET_DEBUG_LOG_CATEGORY_RESPONSE__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&set_debug_log_category_response__descriptor) \ + } + + +/* SetDebugLogCategoryResponse methods */ +void set_debug_log_category_response__init + (SetDebugLogCategoryResponse *message); +size_t set_debug_log_category_response__get_packed_size + (const SetDebugLogCategoryResponse *message); +size_t set_debug_log_category_response__pack + (const SetDebugLogCategoryResponse *message, + uint8_t *out); +size_t set_debug_log_category_response__pack_to_buffer + (const SetDebugLogCategoryResponse *message, + ProtobufCBuffer *buffer); +SetDebugLogCategoryResponse * + set_debug_log_category_response__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void set_debug_log_category_response__free_unpacked + (SetDebugLogCategoryResponse *message, + ProtobufCAllocator *allocator); +/* --- per-message closures --- */ + +typedef void (*SetDebugLogCategoryResponse_Closure) + (const SetDebugLogCategoryResponse *message, + void *closure_data); + +/* --- services --- */ + + +/* --- descriptors --- */ + +extern const ProtobufCMessageDescriptor set_debug_log_category_response__descriptor; + +PROTOBUF_C__END_DECLS + + +#endif /* PROTOBUF_C_SetDebugLogCategoryResponse_2eproto__INCLUDED */ diff --git a/Software/Embedded_SW/Embedded/Drivers/Motors/MotorActions.c b/Software/Embedded_SW/Embedded/Drivers/Motors/MotorActions.c index 5861d6a7a..4802c720e 100644 --- a/Software/Embedded_SW/Embedded/Drivers/Motors/MotorActions.c +++ b/Software/Embedded_SW/Embedded/Drivers/Motors/MotorActions.c @@ -252,6 +252,8 @@ uint32_t MotorStopAction (TimerMotors_t MotorId) //TODO MotorControlCallback[MotorId] = NULL; MotorStop(MotorId,Hard_Hiz); + return OK; + } uint32_t MotorMoveToStopper (TimerMotors_t MotorId,bool direction, uint32_t Speed, callback_fptr callback,uint32_t backlash,uint32_t timeout) //TODO { diff --git a/Software/Embedded_SW/Embedded/Modules/IDS/IDS_maint.c b/Software/Embedded_SW/Embedded/Modules/IDS/IDS_maint.c index a9e8a5ee1..4a7e29740 100644 --- a/Software/Embedded_SW/Embedded/Modules/IDS/IDS_maint.c +++ b/Software/Embedded_SW/Embedded/Modules/IDS/IDS_maint.c @@ -14,6 +14,7 @@ #include "StateMachines/Printing/printingSTM.h" #include "drivers/I2C_Communication/ADC_MUX/ADC_MUX.h" +#include "drivers/I2C_Communication/Dispenser_Card/IO_Ports/Dispenser_IO.h" #include "drivers/FPGA/FPGA_GPIO/FPGA_GPIO.h" #include "drivers/FPGA/FPGA_SPI_Comm.h" diff --git a/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Stub_HW_Version.c b/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Stub_HW_Version.c index 4867587d9..2d7137a16 100644 --- a/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Stub_HW_Version.c +++ b/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Stub_HW_Version.c @@ -1,8 +1,7 @@ #include <Container.h> #include <DataDef.h> -#include <PMR/Stubs/StubHWVersionResponse.pb-c.h> -#include <PMR/Stubs/StubHWVersionRequest.pb-c.h> + #include <stdbool.h> #include <stdlib.h> #include <stdio.h> @@ -11,15 +10,20 @@ #include "inc/hw_memmap.h" #include "inc/hw_types.h" #include "inc/hw_uart.h" +#include "driverlib/rom_map.h" +#include "driverlib/rom.h" #include "driverlib/gpio.h" + #include "Drivers/USB_Communication/USBCDCD.h" +#include "Drivers/FPGA/FPGA_GPIO/FPGA_GPIO.h" +#include "Drivers/FPGA/FPGA.h" #include "MessageContainer.pb-c.h" +#include <PMR/Stubs/StubHWVersionResponse.pb-c.h> +#include <PMR/Stubs/StubHWVersionRequest.pb-c.h> + #include "Stub_Status.h" -#include "drivers/FPGA/FPGA.h" -#include "driverlib/rom_map.h" -#include "driverlib/rom.h" diff --git a/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/temperature_sensor.c b/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/temperature_sensor.c index 67d61ea65..4e97315f9 100644 --- a/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/temperature_sensor.c +++ b/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/temperature_sensor.c @@ -120,7 +120,7 @@ int temperature_main(){ SysCtlClockSet(SYSCTL_SYSDIV_2_5|SYSCTL_USE_PLL|SYSCTL_OSC_MAIN|SYSCTL_XTAL_16MHZ); - InitConsole(); + //InitConsole(); // // This array is used for storing the data read from the ADC FIFO. It // must be as large as the FIFO for the sequencer in use. This example diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_ex.h b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_ex.h index fabb823fc..32d7772de 100644 --- a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_ex.h +++ b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_ex.h @@ -75,5 +75,6 @@ bool ThreadLoadingActive(void); void ThreadLoadPollRequest(MessageContainer* requestContainer); void ThreadLoadRequest(MessageContainer* requestContainer); +uint32_t Thread_Load_End(void); #endif diff --git a/Software/Embedded_SW/Embedded/StateMachines/Initialization/InitSequence.c b/Software/Embedded_SW/Embedded/StateMachines/Initialization/InitSequence.c index c39752020..f08c4e9b7 100644 --- a/Software/Embedded_SW/Embedded/StateMachines/Initialization/InitSequence.c +++ b/Software/Embedded_SW/Embedded/StateMachines/Initialization/InitSequence.c @@ -122,19 +122,7 @@ uint32_t Start_InitSequence(void) } void InitSequenceResetReason(void) { - /* - #define SYSCTL_CAUSE_HSRVREQ 0x00001000 // Hardware System Service Request - #define SYSCTL_CAUSE_HIB 0x00000040 // Hibernate reset - #define SYSCTL_CAUSE_WDOG1 0x00000020 // Watchdog 1 reset - #define SYSCTL_CAUSE_SW 0x00000010 // Software reset - #define SYSCTL_CAUSE_WDOG0 0x00000008 // Watchdog 0 reset - #define SYSCTL_CAUSE_BOR 0x00000004 // Brown-out reset - #define SYSCTL_CAUSE_POR 0x00000002 // Power on reset - #define SYSCTL_CAUSE_EXT 0x00000001 // External reset - */ - RESET_Cause = SysCtlResetCauseGet (); - LOG_ERROR(RESET_Cause,"Reset Reason Register"); - //SysCtlResetCauseClear(RESET_Cause); + ReportResetReason(); InitStages++; //InitSequenceStateMachine(InitStages); diff --git a/Software/PMR/Messages/Debugging/SetDebugLogCategoryResponse.proto b/Software/PMR/Messages/Debugging/SetDebugLogCategoryResponse.proto index f6c2ed9b2..4aecd410e 100644 --- a/Software/PMR/Messages/Debugging/SetDebugLogCategoryResponse.proto +++ b/Software/PMR/Messages/Debugging/SetDebugLogCategoryResponse.proto @@ -1,7 +1,5 @@ syntax = "proto3"; -import "DebugLogCategory.proto"; - package Tango.PMR.Debugging; option java_package = "com.twine.tango.pmr.debugging"; |
