From 22eaa079a4bd20c81d221b2fa623756fc338e168 Mon Sep 17 00:00:00 2001 From: Shlomo Hecht Date: Sun, 7 Jun 2020 16:28:45 +0300 Subject: thread loading messages 1 --- .../Embedded/Modules/Thread/ThreadLoad.c | 41 ++++++++++++---------- 1 file changed, 23 insertions(+), 18 deletions(-) (limited to 'Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c') diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c b/Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c index a91781ce4..61ceb0813 100644 --- a/Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c +++ b/Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c @@ -50,20 +50,20 @@ //#include //#include static char* LoadStagesStr[15] = { - /*00*/ "INIT", - /*01*/ "REDUCE_HEAT", - /*02*/ "LIFT_ROCKERS", - /*03*/ "SET_LOAD_ARM", - /*04*/ "OPEN_COVERS", - /*05*/ "LIFT_DANCERS", - /*06*/ "INITIAL_TENSION", - /*07*/ "CLOSE_ROCKERS", - /*08*/ "CLOSE_DANCERS", - /*09*/ "CLOSE_LIDS", - /*10*/ "JOG_FEEDER", - /*11*/ "DRYER_LOADING", - /*12*/ "RESUME_HEATING", - /*13*/ "JOG_THREAD" , + /*00*/ "Initialization", + /*01*/ "heating stop", + /*02*/ "Rockers opening", + /*03*/ "Drier unloading", + /*04*/ "Lids opening", + /*05*/ "Dancers opening", + /*06*/ "Initial tension building", + /*07*/ "Rockers closing", + /*08*/ "Dancers closing", + /*09*/ "Lids closing", + /*10*/ "Feeder jogging", + /*11*/ "Drier loading", + /*12*/ "Heating resuming", + /*13*/ "Thread jogging" , /*14*/ "END"}; /* typedef enum @@ -284,7 +284,7 @@ { TimeoutsCounter = 0; load.color = fastBILNK; - usnprintf(LoadErrorMsg, 100, "Load sequence timeout %s motor %d",LoadStagesStr[LoadStages], MotorId); + usnprintf(LoadErrorMsg, 100, "Stage %s - motor %s timeout",LoadStagesStr[LoadStages], MotorStr[MotorId]); Report(LoadErrorMsg,__FILE__,__LINE__,LoadStages,RpWarning,TimeoutsCounter,0); LoadStatus = ERROR; @@ -493,7 +493,7 @@ if (HandleProcessParameters(&ProcessParametersRecover,false)!= OK) { - usnprintf(LoadErrorMsg, 100, "Load sequence error %d",LoadStagesStr[LoadStages]); + usnprintf(LoadErrorMsg, 100, "Stage %s error",LoadStagesStr[LoadStages]); Report(LoadErrorMsg,__FILE__,__LINE__,LoadStages,RpWarning,TimeoutsCounter,0); } else @@ -617,8 +617,9 @@ Report("Store Number of cycles in drier - halted",__FILE__,__LINE__,numberOfCycles,RpMessage,LoadArmRounds,0); MCU_E2PromProgram(EEPROM_STORAGE_DRYER_CYCLES,numberOfCycles); TimeoutsCounter = 0; + CallbackCounter = 0; load.color = fastBILNK; - usnprintf(LoadErrorMsg, 100, "Load sequence timeout %s motor %d",LoadStagesStr[LoadStages], HARDWARE_MOTOR_TYPE__MOTO_DRYER_LOADARM); + usnprintf(LoadErrorMsg, 100, "Stage %s - Drier load arm timeout",LoadStagesStr[LoadStages]); Report(LoadErrorMsg,__FILE__,__LINE__,LoadStages,RpWarning,TimeoutsCounter,0); LoadStatus = ERROR; MotorSetMaxSpeed (HARDWARE_MOTOR_TYPE__MOTO_DRYER_LOADARM, 200); @@ -834,7 +835,7 @@ MotorStop(HARDWARE_MOTOR_TYPE__MOTO_DRYER_DRIVING,Hard_Hiz); MotorStop(HARDWARE_MOTOR_TYPE__MOTO_DRYER_LOADARM,Hard_Stop); load.color = fastBILNK; - usnprintf(LoadErrorMsg, 100, "Load sequence timeout %s motor %d",LoadStagesStr[LoadStages], HARDWARE_MOTOR_TYPE__MOTO_DRYER_LOADARM); + usnprintf(LoadErrorMsg, 100, "Stage %s - Drier load arm timeout",LoadStagesStr[LoadStages]); Report(LoadErrorMsg,__FILE__,__LINE__,LoadStages,RpWarning,TimeoutsCounter,0); Report("Drier unloading timeout(1) or no movement",__FILE__,temp,DrierPrevLocation,RpWarning,ReadValue,0); LoadStatus = ERROR; @@ -950,6 +951,8 @@ { REPORT_MSG(ReadValue,"ThreadLoadStateMachine"); ThreadLoaded(); + ThreadLoadingReport(); + if (LoadStages!=ReadValue) LoadStages = ReadValue; switch (ReadValue) @@ -1038,6 +1041,7 @@ LOG_ERROR(LoadStages,"ERROR IN LOAD STATE MACHINE"); break; } + return OK; } uint32_t ThreadLoadButton(THREAD_LOAD_STAGES_ENUM ReadValue) @@ -1054,6 +1058,7 @@ uint32_t ThreadLoadButton(THREAD_LOAD_STAGES_ENUM ReadValue) } Report("ThreadLoadButton",__FILE__,__LINE__,LoadStages,RpMessage,ReadValue,0); Report("ThreadLoadButton params",__FILE__,LoadStatus,TryAgain,RpMessage,SecondTry,0); + ThreadLoadingReport(); if (LoadStatus == ERROR) { if ((SecondTry == false)&&(TryAgain == true)) -- cgit v1.3.1 From 78709f8a869bd6a638a332062d83e51f3c132a2c Mon Sep 17 00:00:00 2001 From: Shlomo Hecht Date: Sun, 7 Jun 2020 16:53:31 +0300 Subject: TryThreadLoading --- .../Embedded_SW/Embedded/Communication/Container.c | 3 + .../Communication/PMR/Common/MessageType.pb-c.c | 14 +++-- .../Communication/PMR/Common/MessageType.pb-c.h | 4 +- .../ThreadLoading/TryThreadLoadingRequest.pb-c.c | 72 ++++++++++++++++++++++ .../ThreadLoading/TryThreadLoadingRequest.pb-c.h | 70 +++++++++++++++++++++ .../ThreadLoading/TryThreadLoadingResponse.pb-c.c | 72 ++++++++++++++++++++++ .../ThreadLoading/TryThreadLoadingResponse.pb-c.h | 70 +++++++++++++++++++++ .../Dispenser_Card/EEPROM/Dispenser_EEPROM.c | 8 +++ .../Dispenser_Card/EEPROM/Dispenser_EEPROM.h | 2 + .../Embedded/Modules/General/GeneralHardware.c | 4 +- .../Embedded/Modules/Thread/ThreadLoad.c | 25 ++++++++ 11 files changed, 335 insertions(+), 9 deletions(-) create mode 100644 Software/Embedded_SW/Embedded/Communication/PMR/ThreadLoading/TryThreadLoadingRequest.pb-c.c create mode 100644 Software/Embedded_SW/Embedded/Communication/PMR/ThreadLoading/TryThreadLoadingRequest.pb-c.h create mode 100644 Software/Embedded_SW/Embedded/Communication/PMR/ThreadLoading/TryThreadLoadingResponse.pb-c.c create mode 100644 Software/Embedded_SW/Embedded/Communication/PMR/ThreadLoading/TryThreadLoadingResponse.pb-c.h (limited to 'Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c') diff --git a/Software/Embedded_SW/Embedded/Communication/Container.c b/Software/Embedded_SW/Embedded/Communication/Container.c index 1bdc0b535..b5264cda0 100644 --- a/Software/Embedded_SW/Embedded/Communication/Container.c +++ b/Software/Embedded_SW/Embedded/Communication/Container.c @@ -506,6 +506,9 @@ void receive_callback(char* buffer, size_t length) case MESSAGE_TYPE__StubMainCardEEpromWriteRequest: MainCardEEpromWriteRequestFunc(requestContainer); break; + case MESSAGE_TYPE__TryThreadLoadingRequest: + TryThreadLoadingFunc(requestContainer); + break; default: //unsupported message type !! LOG_ERROR (requestContainer->type,"unsupported message type"); 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 2c7d12003..75c0591b1 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[257] = +static const ProtobufCEnumValue message_type__enum_values_by_number[259] = { { "", "", 0 }, { "", "", 1 }, @@ -266,11 +266,13 @@ static const ProtobufCEnumValue message_type__enum_values_by_number[257] = { "", "", 11003 }, { "", "", 11004 }, { "", "", 11005 }, + { "", "", 11006 }, + { "", "", 11007 }, }; static const ProtobufCIntRange message_type__value_ranges[] = { -{0, 0},{3, 2},{1000, 112},{2000, 131},{3000, 177},{4000, 191},{5000, 199},{6000, 203},{7000, 209},{8000, 233},{9000, 239},{10000, 243},{11000, 251},{0, 257} +{0, 0},{3, 2},{1000, 112},{2000, 131},{3000, 177},{4000, 191},{5000, 199},{6000, 203},{7000, 209},{8000, 233},{9000, 239},{10000, 243},{11000, 251},{0, 259} }; -static const ProtobufCEnumValueIndex message_type__enum_values_by_name[257] = +static const ProtobufCEnumValueIndex message_type__enum_values_by_name[259] = { { "", 189 }, { "", 190 }, @@ -521,6 +523,8 @@ static const ProtobufCEnumValueIndex message_type__enum_values_by_name[257] = { "", 154 }, { "", 151 }, { "", 152 }, + { "", 257 }, + { "", 258 }, { "", 127 }, { "", 128 }, { "", 199 }, @@ -537,9 +541,9 @@ const ProtobufCEnumDescriptor message_type__descriptor = "", "", "", - 257, + 259, message_type__enum_values_by_number, - 257, + 259, message_type__enum_values_by_name, 13, 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 3cfe8f4fb..231bc8411 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 @@ -276,7 +276,9 @@ typedef enum _MessageType { MESSAGE_TYPE__ContinueThreadLoadingRequest = 11002, MESSAGE_TYPE__ContinueThreadLoadingResponse = 11003, MESSAGE_TYPE__StopThreadLoadingRequest = 11004, - MESSAGE_TYPE__StopThreadLoadingResponse = 11005 + MESSAGE_TYPE__StopThreadLoadingResponse = 11005, + MESSAGE_TYPE__TryThreadLoadingRequest = 11006, + MESSAGE_TYPE__TryThreadLoadingResponse = 11007 PROTOBUF_C__FORCE_ENUM_TO_BE_INT_SIZE(MESSAGE_TYPE) } MessageType; diff --git a/Software/Embedded_SW/Embedded/Communication/PMR/ThreadLoading/TryThreadLoadingRequest.pb-c.c b/Software/Embedded_SW/Embedded/Communication/PMR/ThreadLoading/TryThreadLoadingRequest.pb-c.c new file mode 100644 index 000000000..cd1eff033 --- /dev/null +++ b/Software/Embedded_SW/Embedded/Communication/PMR/ThreadLoading/TryThreadLoadingRequest.pb-c.c @@ -0,0 +1,72 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: TryThreadLoadingRequest.proto */ + +/* Do not generate deprecated warnings for self */ +#ifndef PROTOBUF_C__NO_DEPRECATED +#define PROTOBUF_C__NO_DEPRECATED +#endif + +#include "TryThreadLoadingRequest.pb-c.h" +void try_thread_loading_request__init + (TryThreadLoadingRequest *message) +{ + static const TryThreadLoadingRequest init_value = TRY_THREAD_LOADING_REQUEST__INIT; + *message = init_value; +} +size_t try_thread_loading_request__get_packed_size + (const TryThreadLoadingRequest *message) +{ + assert(message->base.descriptor == &try_thread_loading_request__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t try_thread_loading_request__pack + (const TryThreadLoadingRequest *message, + uint8_t *out) +{ + assert(message->base.descriptor == &try_thread_loading_request__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t try_thread_loading_request__pack_to_buffer + (const TryThreadLoadingRequest *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &try_thread_loading_request__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +TryThreadLoadingRequest * + try_thread_loading_request__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (TryThreadLoadingRequest *) + protobuf_c_message_unpack (&try_thread_loading_request__descriptor, + allocator, len, data); +} +void try_thread_loading_request__free_unpacked + (TryThreadLoadingRequest *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &try_thread_loading_request__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +#define try_thread_loading_request__field_descriptors NULL +#define try_thread_loading_request__field_indices_by_name NULL +#define try_thread_loading_request__number_ranges NULL +const ProtobufCMessageDescriptor try_thread_loading_request__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "", + "", + "", + "", + sizeof(TryThreadLoadingRequest), + 0, + try_thread_loading_request__field_descriptors, + try_thread_loading_request__field_indices_by_name, + 0, try_thread_loading_request__number_ranges, + (ProtobufCMessageInit) try_thread_loading_request__init, + NULL,NULL,NULL /* reserved[123] */ +}; diff --git a/Software/Embedded_SW/Embedded/Communication/PMR/ThreadLoading/TryThreadLoadingRequest.pb-c.h b/Software/Embedded_SW/Embedded/Communication/PMR/ThreadLoading/TryThreadLoadingRequest.pb-c.h new file mode 100644 index 000000000..5de127af4 --- /dev/null +++ b/Software/Embedded_SW/Embedded/Communication/PMR/ThreadLoading/TryThreadLoadingRequest.pb-c.h @@ -0,0 +1,70 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: TryThreadLoadingRequest.proto */ + +#ifndef PROTOBUF_C_TryThreadLoadingRequest_2eproto__INCLUDED +#define PROTOBUF_C_TryThreadLoadingRequest_2eproto__INCLUDED + +#include + +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 _TryThreadLoadingRequest TryThreadLoadingRequest; + + +/* --- enums --- */ + + +/* --- messages --- */ + +struct _TryThreadLoadingRequest +{ + ProtobufCMessage base; +}; +#define TRY_THREAD_LOADING_REQUEST__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&try_thread_loading_request__descriptor) \ + } + + +/* TryThreadLoadingRequest methods */ +void try_thread_loading_request__init + (TryThreadLoadingRequest *message); +size_t try_thread_loading_request__get_packed_size + (const TryThreadLoadingRequest *message); +size_t try_thread_loading_request__pack + (const TryThreadLoadingRequest *message, + uint8_t *out); +size_t try_thread_loading_request__pack_to_buffer + (const TryThreadLoadingRequest *message, + ProtobufCBuffer *buffer); +TryThreadLoadingRequest * + try_thread_loading_request__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void try_thread_loading_request__free_unpacked + (TryThreadLoadingRequest *message, + ProtobufCAllocator *allocator); +/* --- per-message closures --- */ + +typedef void (*TryThreadLoadingRequest_Closure) + (const TryThreadLoadingRequest *message, + void *closure_data); + +/* --- services --- */ + + +/* --- descriptors --- */ + +extern const ProtobufCMessageDescriptor try_thread_loading_request__descriptor; + +PROTOBUF_C__END_DECLS + + +#endif /* PROTOBUF_C_TryThreadLoadingRequest_2eproto__INCLUDED */ diff --git a/Software/Embedded_SW/Embedded/Communication/PMR/ThreadLoading/TryThreadLoadingResponse.pb-c.c b/Software/Embedded_SW/Embedded/Communication/PMR/ThreadLoading/TryThreadLoadingResponse.pb-c.c new file mode 100644 index 000000000..b12bf1438 --- /dev/null +++ b/Software/Embedded_SW/Embedded/Communication/PMR/ThreadLoading/TryThreadLoadingResponse.pb-c.c @@ -0,0 +1,72 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: TryThreadLoadingResponse.proto */ + +/* Do not generate deprecated warnings for self */ +#ifndef PROTOBUF_C__NO_DEPRECATED +#define PROTOBUF_C__NO_DEPRECATED +#endif + +#include "TryThreadLoadingResponse.pb-c.h" +void try_thread_loading_response__init + (TryThreadLoadingResponse *message) +{ + static const TryThreadLoadingResponse init_value = TRY_THREAD_LOADING_RESPONSE__INIT; + *message = init_value; +} +size_t try_thread_loading_response__get_packed_size + (const TryThreadLoadingResponse *message) +{ + assert(message->base.descriptor == &try_thread_loading_response__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t try_thread_loading_response__pack + (const TryThreadLoadingResponse *message, + uint8_t *out) +{ + assert(message->base.descriptor == &try_thread_loading_response__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t try_thread_loading_response__pack_to_buffer + (const TryThreadLoadingResponse *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &try_thread_loading_response__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +TryThreadLoadingResponse * + try_thread_loading_response__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (TryThreadLoadingResponse *) + protobuf_c_message_unpack (&try_thread_loading_response__descriptor, + allocator, len, data); +} +void try_thread_loading_response__free_unpacked + (TryThreadLoadingResponse *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &try_thread_loading_response__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +#define try_thread_loading_response__field_descriptors NULL +#define try_thread_loading_response__field_indices_by_name NULL +#define try_thread_loading_response__number_ranges NULL +const ProtobufCMessageDescriptor try_thread_loading_response__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "", + "", + "", + "", + sizeof(TryThreadLoadingResponse), + 0, + try_thread_loading_response__field_descriptors, + try_thread_loading_response__field_indices_by_name, + 0, try_thread_loading_response__number_ranges, + (ProtobufCMessageInit) try_thread_loading_response__init, + NULL,NULL,NULL /* reserved[123] */ +}; diff --git a/Software/Embedded_SW/Embedded/Communication/PMR/ThreadLoading/TryThreadLoadingResponse.pb-c.h b/Software/Embedded_SW/Embedded/Communication/PMR/ThreadLoading/TryThreadLoadingResponse.pb-c.h new file mode 100644 index 000000000..7340ada7c --- /dev/null +++ b/Software/Embedded_SW/Embedded/Communication/PMR/ThreadLoading/TryThreadLoadingResponse.pb-c.h @@ -0,0 +1,70 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: TryThreadLoadingResponse.proto */ + +#ifndef PROTOBUF_C_TryThreadLoadingResponse_2eproto__INCLUDED +#define PROTOBUF_C_TryThreadLoadingResponse_2eproto__INCLUDED + +#include + +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 _TryThreadLoadingResponse TryThreadLoadingResponse; + + +/* --- enums --- */ + + +/* --- messages --- */ + +struct _TryThreadLoadingResponse +{ + ProtobufCMessage base; +}; +#define TRY_THREAD_LOADING_RESPONSE__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&try_thread_loading_response__descriptor) \ + } + + +/* TryThreadLoadingResponse methods */ +void try_thread_loading_response__init + (TryThreadLoadingResponse *message); +size_t try_thread_loading_response__get_packed_size + (const TryThreadLoadingResponse *message); +size_t try_thread_loading_response__pack + (const TryThreadLoadingResponse *message, + uint8_t *out); +size_t try_thread_loading_response__pack_to_buffer + (const TryThreadLoadingResponse *message, + ProtobufCBuffer *buffer); +TryThreadLoadingResponse * + try_thread_loading_response__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void try_thread_loading_response__free_unpacked + (TryThreadLoadingResponse *message, + ProtobufCAllocator *allocator); +/* --- per-message closures --- */ + +typedef void (*TryThreadLoadingResponse_Closure) + (const TryThreadLoadingResponse *message, + void *closure_data); + +/* --- services --- */ + + +/* --- descriptors --- */ + +extern const ProtobufCMessageDescriptor try_thread_loading_response__descriptor; + +PROTOBUF_C__END_DECLS + + +#endif /* PROTOBUF_C_TryThreadLoadingResponse_2eproto__INCLUDED */ diff --git a/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/Dispenser_Card/EEPROM/Dispenser_EEPROM.c b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/Dispenser_Card/EEPROM/Dispenser_EEPROM.c index 5fd916667..ffbbf6608 100644 --- a/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/Dispenser_Card/EEPROM/Dispenser_EEPROM.c +++ b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/Dispenser_Card/EEPROM/Dispenser_EEPROM.c @@ -94,7 +94,15 @@ uint32_t I2C_EEprom_Read_Ch(uint8_t Dispenser_ID, uint8_t EEprom_Add) return status; } +uint32_t Dispenser_EEPROM_Read_Data(uint8_t Dispenser_ID)//0..7 +{ + uint32_t status= OK; + assert(Dispenser_ID < MAX_SYSTEM_DISPENSERS); + status |= I2C_EEprom_Set_for_Read_Ch(Dispenser_ID, 0xA0); + status |= I2C_EEprom_Read_Ch(Dispenser_ID, 0xA0); + return status; +} uint32_t test_disp_eeprom(uint8_t Dispenser_ID , uint8_t EEprom_Add)//0..7 { uint32_t status= OK; diff --git a/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/Dispenser_Card/EEPROM/Dispenser_EEPROM.h b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/Dispenser_Card/EEPROM/Dispenser_EEPROM.h index 1a1af1851..bdf1b3693 100644 --- a/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/Dispenser_Card/EEPROM/Dispenser_EEPROM.h +++ b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/Dispenser_Card/EEPROM/Dispenser_EEPROM.h @@ -17,6 +17,8 @@ uint32_t I2C_EEprom_Read_Ch(uint8_t Dispenser_ID, uint8_t EEprom_Add); uint32_t test_disp_eeprom(uint8_t Dispenser_ID , uint8_t EEprom_Add); uint8_t Check_Dispenser_Type(); +uint32_t Dispenser_EEPROM_Read_Data(uint8_t Dispenser_ID);//0..7 + uint32_t DispenserEEpromRequestFunc(MessageContainer* requestContainer); uint32_t StubDispenserEEpromRequestFunc(MessageContainer* requestContainer); diff --git a/Software/Embedded_SW/Embedded/Modules/General/GeneralHardware.c b/Software/Embedded_SW/Embedded/Modules/General/GeneralHardware.c index 2cf368ebd..39d10bfc2 100644 --- a/Software/Embedded_SW/Embedded/Modules/General/GeneralHardware.c +++ b/Software/Embedded_SW/Embedded/Modules/General/GeneralHardware.c @@ -483,9 +483,7 @@ uint32_t HWConfiguration(UploadHardwareConfigurationRequest* UploadRequest) LOG_ERROR (Dispenser_i, "Dispenser identification failed"); //return ERROR; } - - status |= I2C_EEprom_Set_for_Read_Ch(Dispenser_i, 0xA0); - status |= I2C_EEprom_Read_Ch(Dispenser_i, 0xA0); + status |= Dispenser_EEPROM_Read_Data(Dispenser_i); } Calculateinit(); } diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c b/Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c index 61ceb0813..75c232a1c 100644 --- a/Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c +++ b/Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c @@ -1392,6 +1392,31 @@ uint32_t ThreadLoadingReport(void) } +uint32_t TryThreadLoadingFunc(MessageContainer* requestContainer) +{ + TryThreadLoadingRequest *request = continue_thread_loading_request__unpack(NULL, requestContainer->data.len, requestContainer->data.data); + TryThreadLoadingResponse Cresponse = TRY_THREAD_LOADING_RESPONSE__INIT; + MessageContainer responseContainer; + MessageState = 2; + ThreadLoadingReport(); + if (request->processparameters) + { + dryerbufferlength = request->processparameters->dryerbufferlength; + LoadArmRounds = (int)(request->processparameters->dryerbufferlength); + + } + Report("TryThreadLoadingFunc",__FILE__,__LINE__,(int)(request->processparameters->dryerbufferlength),RpWarning,(int)LoadStages,0); + + responseContainer = createContainer(MESSAGE_TYPE__TryThreadLoadingResponse, requestContainer->token, true, &Cresponse, &try_thread_loading_response__pack, &try_thread_loading_response__get_packed_size); + 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((char*)container_buffer, container_size); + + ThreadLoadButton(LoadStages); + return OK; +} uint32_t StartThreadLoadingFunc(MessageContainer* requestContainer) { StartThreadLoadingRequest *request = start_thread_loading_request__unpack(NULL, requestContainer->data.len, requestContainer->data.data); -- cgit v1.3.1 From c9e928b3fc2407b4b3008bfe2df1c15624373e5f Mon Sep 17 00:00:00 2001 From: Shlomo Hecht Date: Sun, 7 Jun 2020 17:00:27 +0300 Subject: bug fix. trythreadloading 2 --- Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c') diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c b/Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c index 75c232a1c..abfdd2237 100644 --- a/Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c +++ b/Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c @@ -44,6 +44,8 @@ #include "PMR/ThreadLoading/StartThreadLoadingResponse.pb-c.h" #include "PMR/ThreadLoading/ContinueThreadLoadingRequest.pb-c.h" #include "PMR/ThreadLoading/ContinueThreadLoadingResponse.pb-c.h" +#include "PMR/ThreadLoading/TryThreadLoadingRequest.pb-c.h" +#include "PMR/ThreadLoading/TryThreadLoadingResponse.pb-c.h" #include "PMR/ThreadLoading/StopThreadLoadingRequest.pb-c.h" #include "PMR/ThreadLoading/StopThreadLoadingResponse.pb-c.h" @@ -1399,13 +1401,7 @@ uint32_t TryThreadLoadingFunc(MessageContainer* requestContainer) MessageContainer responseContainer; MessageState = 2; ThreadLoadingReport(); - if (request->processparameters) - { - dryerbufferlength = request->processparameters->dryerbufferlength; - LoadArmRounds = (int)(request->processparameters->dryerbufferlength); - - } - Report("TryThreadLoadingFunc",__FILE__,__LINE__,(int)(request->processparameters->dryerbufferlength),RpWarning,(int)LoadStages,0); + Report("TryThreadLoadingFunc",__FILE__,__LINE__,MESSAGE_TYPE__TryThreadLoadingResponse,RpWarning,(int)LoadStages,0); responseContainer = createContainer(MESSAGE_TYPE__TryThreadLoadingResponse, requestContainer->token, true, &Cresponse, &try_thread_loading_response__pack, &try_thread_loading_response__get_packed_size); responseContainer.continuous = false; -- cgit v1.3.1 From a68537dfd4c0e620d6c9568f52f74a6b307f6659 Mon Sep 17 00:00:00 2001 From: Shlomo Hecht Date: Mon, 8 Jun 2020 10:42:54 +0300 Subject: Version 1.4.6.30 final (?) --- Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c') diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c b/Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c index abfdd2237..349215d7d 100644 --- a/Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c +++ b/Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c @@ -813,7 +813,7 @@ else //timeout or no movement { Report("Store Number of cycles in drier - halted",__FILE__,__LINE__,numberOfCycles,RpMessage,LoadArmRounds,0); - MCU_E2PromProgram(EEPROM_STORAGE_DRYER_CYCLES,LoadArmRounds-(numberOfCycles-2));//it takes two cycles to identify a stop of the arm + MCU_E2PromProgram(EEPROM_STORAGE_DRYER_CYCLES,LoadArmRounds-(numberOfCycles-1)); TimeoutsCounter = 0; CallbackCounter = 0; /*if(PullerControlId != 0xFF) -- cgit v1.3.1