From a282b0a50f0b19712a11e16320a5de7d337ffa30 Mon Sep 17 00:00:00 2001 From: Shlomo Hecht Date: Tue, 19 Nov 2019 16:46:51 +0200 Subject: update mastrer with latest changes in Alpha + embedded version --- Software/Embedded_SW/Embedded/Common/SWUpdate/FileSystem.c | 4 ---- 1 file changed, 4 deletions(-) (limited to 'Software/Embedded_SW/Embedded/Common/SWUpdate/FileSystem.c') diff --git a/Software/Embedded_SW/Embedded/Common/SWUpdate/FileSystem.c b/Software/Embedded_SW/Embedded/Common/SWUpdate/FileSystem.c index 018e83ce0..7871c5e28 100644 --- a/Software/Embedded_SW/Embedded/Common/SWUpdate/FileSystem.c +++ b/Software/Embedded_SW/Embedded/Common/SWUpdate/FileSystem.c @@ -31,14 +31,10 @@ #include #include -#include "third_party/fatfs/src/ffconf.h" -#include "third_party/fatfs/src/diskio.h" #include "drivers/Flash_Memory/Flash_Memory.h" #include "drivers/Flash_Memory/fatfs/ff.h" #include "drivers/FPGA/FPGA_GPIO/FPGA_GPIO.h" -#include "third_party/fatfs/src/ffconf.h" - #include "StateMachines/Printing/PrintingSTM.h" -- cgit v1.3.1 From 797d4654f845a6d6c8f6e02bcdc6bc11ceeed51f Mon Sep 17 00:00:00 2001 From: Shlomo Hecht Date: Sun, 1 Dec 2019 14:34:42 +0200 Subject: update with Beta code --- .../Embedded/Common/SWUpdate/FileSystem.c | 65 +++++-- .../Embedded/Communication/CommunicationTask.c | 2 +- .../Embedded_SW/Embedded/Communication/Container.c | 7 +- .../Embedded/Drivers/FPGA/FPGA_GPIO/FPGA_GPIO.c | 20 +- .../I2C_Communication/Head_Card/I2C_Head_Mux.c | 2 +- .../Head_Card/PT100/Head_PT100_ADC.c | 2 +- .../I2C_Communication/RFID_NFC/PN7150/PN7150.c | 2 + .../Embedded_SW/Embedded/Drivers/Motors/Motor.c | 2 + .../Embedded/Drivers/Motors/MotorActions.c | 5 +- .../Embedded/Drivers/USB_Communication/USBCDCD.c | 10 + .../Embedded_SW/Embedded/Drivers/Valves/Valve.c | 2 +- .../Embedded/Drivers/logi-tag/LT_RFID.c | 215 +++++++++++++++++++++ Software/Embedded_SW/Embedded/Main.c | 7 +- .../Embedded/Modules/AlarmHandling/AlarmHandling.c | 25 +-- .../Embedded_SW/Embedded/Modules/Control/control.c | 2 +- .../Embedded/Modules/Diagnostics/Diagnostics.c | 68 ++++--- .../Modules/Diagnostics/DiagnosticsHoming.c | 4 +- .../Embedded/Modules/General/GeneralHardware.c | 11 +- .../Embedded_SW/Embedded/Modules/General/buttons.h | 9 +- .../Embedded_SW/Embedded/Modules/General/process.c | 1 - .../Embedded/Modules/Heaters/Heaters_print.c | 2 +- .../Embedded/Modules/IDS/IDS_Cleaning.c | 10 +- .../Embedded_SW/Embedded/Modules/IDS/IDS_print.c | 93 +++++++-- .../Embedded/Modules/Thread/ThreadLoad.c | 19 +- .../Embedded/Modules/Thread/Thread_Winder.c | 12 +- .../Embedded/Software Release Notes.txt | 11 ++ .../Embedded/StateMachines/Printing/JobSTM.c | 1 + .../StartThreadLoadingUpdateRequest.proto | 9 + .../StartThreadLoadingUpdateResponse.proto | 11 ++ .../Messages/Diagnostics/ThreadLoadingState.proto | 25 +++ 30 files changed, 531 insertions(+), 123 deletions(-) create mode 100644 Software/PMR/Messages/Diagnostics/StartThreadLoadingUpdateRequest.proto create mode 100644 Software/PMR/Messages/Diagnostics/StartThreadLoadingUpdateResponse.proto create mode 100644 Software/PMR/Messages/Diagnostics/ThreadLoadingState.proto (limited to 'Software/Embedded_SW/Embedded/Common/SWUpdate/FileSystem.c') diff --git a/Software/Embedded_SW/Embedded/Common/SWUpdate/FileSystem.c b/Software/Embedded_SW/Embedded/Common/SWUpdate/FileSystem.c index 7871c5e28..5650cbd1b 100644 --- a/Software/Embedded_SW/Embedded/Common/SWUpdate/FileSystem.c +++ b/Software/Embedded_SW/Embedded/Common/SWUpdate/FileSystem.c @@ -94,32 +94,39 @@ uint32_t FileUploadRequestFunc(MessageContainer* requestContainer) Fresult = FR_DENIED; else { - Semaphore_pend(FFS_Sem, BIOS_WAIT_FOREVER); - Fresult = f_open(UploadFileHandle,request->path,FA_READ | FA_WRITE | FA_OPEN_ALWAYS | FA_CREATE_ALWAYS); - if (Fresult == FR_OK) + if (Semaphore_pend(FFS_Sem, BIOS_NO_WAIT)) { - FileLength = request->length; - FileReceivedLength = 0; - REPORT_MSG (FileLength,"file upload request"); - response.has_maxchunklength = true; - response.maxchunklength = MAX_CHUNK_LENGTH; - strcpy(FileHandleChar, "1234"); - response.uploadid = FileHandleChar; //supporting only single file at each time. - FileDone = false; + CommRxTaskHandle = Task_self(); + Task_setPri(CommRxTaskHandle, 3); + // Report("Task_setPri", __FILE__, __LINE__, 4, RpWarning, (int)CommRxTaskHandle, 0); + Report("FileUploadRequestFunc 2", __FILE__, __LINE__, msec_millisecondCounter, RpWarning, (int)0, 0); + Fresult = f_open(UploadFileHandle,request->path,FA_READ | FA_WRITE | FA_OPEN_ALWAYS | FA_CREATE_ALWAYS); + if (Fresult == FR_OK) + { + Report("FileUploadRequestFunc 3", __FILE__, __LINE__, msec_millisecondCounter, RpWarning, (int)0, 0); + FileLength = request->length; + FileReceivedLength = 0; + REPORT_MSG (FileLength,"file upload request"); + response.has_maxchunklength = true; + response.maxchunklength = MAX_CHUNK_LENGTH; + strcpy(FileHandleChar, "1234"); + response.uploadid = FileHandleChar; //supporting only single file at each time. + FileDone = false; + } + else + { + my_free (UploadFileHandle); + UploadFileHandle = 0; + Semaphore_post(FFS_Sem); + } } else { - my_free (UploadFileHandle); - UploadFileHandle = 0; - Semaphore_post(FFS_Sem); + Fresult = FR_DENIED; + Report("Semaphore_pend failed", __FILE__, __LINE__, 4, RpWarning, (int)0, 0); } - } } - CommRxTaskHandle = Task_self(); - Task_setPri(CommRxTaskHandle, 4); - // Report("Task_setPri", __FILE__, __LINE__, 4, RpWarning, (int)CommRxTaskHandle, 0); - responseContainer = createContainer(MESSAGE_TYPE__FileUploadResponse, requestContainer->token, false, &response, &file_upload_response__pack, &file_upload_response__get_packed_size); if (Fresult!= FR_OK) @@ -533,6 +540,8 @@ uint32_t GetStorageInfoRequestFunc(MessageContainer* requestContainer) return OK; } +//char Datestr[100]; + uint32_t GetFilesRequestFunc(MessageContainer* requestContainer) { //uint32_t status = OK; @@ -549,6 +558,15 @@ uint32_t GetFilesRequestFunc(MessageContainer* requestContainer) char FullPath[MAX_NUM_OF_FILES][60]; int i,NumOfFiles = 0; FRESULT Fresult = FR_OK; + /* + time_t t; + struct tm *ltm; + char *curTime; + t = time(NULL); + ltm = localtime(&t); + curTime = asctime(ltm); + Report(curTime, __FILE__, ltm->tm_hour,ltm->tm_min , RpWarning, ltm->tm_sec, 0); + */ Semaphore_pend(FFS_Sem, BIOS_WAIT_FOREVER); Fresult |= f_opendir(&dir, g_cCwdBuf); @@ -600,7 +618,14 @@ uint32_t GetFilesRequestFunc(MessageContainer* requestContainer) Data[i].lastmodifieddate = fno[i]->fdate; Data[i].has_lastmodifiedtime = true; Data[i].lastmodifiedtime = fno[i]->ftime; - //Report(Data[i].name, __FILE__, __LINE__, Data[i].lastmodifieddate, RpWarning, (int)Data[i].lastmodifiedtime, 0); + /* + t = (fno[i]->fdate<<16)+fno[i]->ftime; + ltm = localtime(&t); + curTime = asctime(ltm); + usnprintf(&Datestr, 100, "File info %s %s",fno[i]->fname, curTime); + Report(Datestr, __FILE__, __LINE__, t, RpWarning, (int)Data[i].lastmodifiedtime, 0); + Task_sleep(50); + */ if (i==0) usnprintf(&FullPath[i], 50, "%s", request->path); diff --git a/Software/Embedded_SW/Embedded/Communication/CommunicationTask.c b/Software/Embedded_SW/Embedded/Communication/CommunicationTask.c index a970aab5a..43a185a3a 100644 --- a/Software/Embedded_SW/Embedded/Communication/CommunicationTask.c +++ b/Software/Embedded_SW/Embedded/Communication/CommunicationTask.c @@ -41,7 +41,7 @@ SerialBuffer inBuffer[11]; bool SerialBufferUsed[11] = {false,false,false,false,false,false,false,false,false,false,false}; uint32_t initArray(size_t initialSize) { - if (initialSize >= COMM_MAX_BUFFER_SIZE) return 0; + if (initialSize >= COMM_MAX_BUFFER_SIZE) return 0xFF; if (initialSize > SHORT_BUFFER_SIZE) { if (SerialBufferUsed[10] == true) diff --git a/Software/Embedded_SW/Embedded/Communication/Container.c b/Software/Embedded_SW/Embedded/Communication/Container.c index 11bdbe0c8..d7a49a5f4 100644 --- a/Software/Embedded_SW/Embedded/Communication/Container.c +++ b/Software/Embedded_SW/Embedded/Communication/Container.c @@ -134,11 +134,12 @@ void receive_callback(char* buffer, size_t length) MessageContainer* requestContainer = message_container__unpack(NULL, length, (uint8_t*)buffer); if (requestContainer == NULL) return; - if (requestContainer->type != MESSAGE_TYPE__KeepAliveRequest) //user action resets the idle counter + if ((requestContainer->type>= MESSAGE_TYPE__StartDiagnosticsRequest)&&(requestContainer->type != MESSAGE_TYPE__KeepAliveRequest)) //user action resets the idle counter { - resetIdleCounter(); - REPORT_MSG(requestContainer->type,"Message received"); + ReportWithPackageFilter(CommFilter,"Message received", __FILE__,__LINE__,requestContainer->type, RpMessage,length, 0); } + if (requestContainer->type != MESSAGE_TYPE__KeepAliveRequest) + resetIdleCounter(); KeepAliveOneSecondCounter = 0; /*msgId[RxIndex] = requestContainer->type; Length[RxIndex] = length; diff --git a/Software/Embedded_SW/Embedded/Drivers/FPGA/FPGA_GPIO/FPGA_GPIO.c b/Software/Embedded_SW/Embedded/Drivers/FPGA/FPGA_GPIO/FPGA_GPIO.c index 001c083c2..f5ef82720 100644 --- a/Software/Embedded_SW/Embedded/Drivers/FPGA/FPGA_GPIO/FPGA_GPIO.c +++ b/Software/Embedded_SW/Embedded/Drivers/FPGA/FPGA_GPIO/FPGA_GPIO.c @@ -512,6 +512,18 @@ uint32_t DeActivateCoolerPump() //WHS - Pump the waste accumulated in cooler to F1_Moto_Driver_SW1 = F1_Mot_Dr_SW1.ushort; return OK; } +uint32_t MagnetControlId = 0xFF; +uint32_t MagnetCallBackFunction(uint32_t IfIndex, uint32_t BusyFlag) +{ + if (SafeRemoveControlCallback(MagnetControlId, MagnetCallBackFunction )==OK) + MagnetControlId = 0xFF; + else + Report("Remove control callback failed",__FILE__,__LINE__,(int)MagnetControlId,RpWarning,(int)MagnetCallBackFunction,0); + Report("MagnetCallBackFunction",__FILE__,__LINE__,(int)MagnetControlId,RpWarning,(int)MagnetCallBackFunction,0); + MotorStop(HARDWARE_MOTOR_TYPE__MOTO_RLOADARM,Hard_Hiz ); + + return OK; +} uint32_t ActivateHeadMagnet() { @@ -521,7 +533,10 @@ uint32_t ActivateHeadMagnet() F2_CTRL = F2_CTRL_Reg.ushort; if (isMotorConfigured(HARDWARE_MOTOR_TYPE__MOTO_RLOADARM)) { - MotorGotoWithCallback(HARDWARE_MOTOR_TYPE__MOTO_RLOADARM, DH_LID_CLOSE, Motor_Id_to_LS_IdUp[HARDWARE_MOTOR_TYPE__MOTO_RLOADARM], NULL,1000); + MotorGoTo(HARDWARE_MOTOR_TYPE__MOTO_RLOADARM,DH_LID_CLOSE ); + MagnetControlId = AddControlCallback(NULL, MagnetCallBackFunction, 2* eOneSecond, TemplateDataReadCBFunction,0,0, 0 ); + + //MotorGotoWithCallback(HARDWARE_MOTOR_TYPE__MOTO_RLOADARM, DH_LID_CLOSE, Motor_Id_to_LS_IdUp[HARDWARE_MOTOR_TYPE__MOTO_RLOADARM], NULL,1000); } return OK; } @@ -531,7 +546,8 @@ uint32_t DeActivateHeadMagnet() Report("DeActivateHeadMagnet - open the lid magnet",__FILE__,__LINE__,(int)HARDWARE_MOTOR_TYPE__MOTO_RLOADARM,RpWarning,(int)DH_LID_CLOSE,0); if (isMotorConfigured(HARDWARE_MOTOR_TYPE__MOTO_RLOADARM)) { - MotorGotoWithCallback(HARDWARE_MOTOR_TYPE__MOTO_RLOADARM, DH_LID_OPEN, Motor_Id_to_LS_IdDown[HARDWARE_MOTOR_TYPE__MOTO_RLOADARM], NULL,1000); + MotorGoTo(HARDWARE_MOTOR_TYPE__MOTO_RLOADARM,DH_LID_OPEN ); + //MotorGotoWithCallback(HARDWARE_MOTOR_TYPE__MOTO_RLOADARM, DH_LID_OPEN, Motor_Id_to_LS_IdDown[HARDWARE_MOTOR_TYPE__MOTO_RLOADARM], NULL,1000); } F2_CTRL_Reg.ushort |= SPARE_SSR13_CTRL; F2_CTRL = F2_CTRL_Reg.ushort; diff --git a/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/Head_Card/I2C_Head_Mux.c b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/Head_Card/I2C_Head_Mux.c index a7fa349f3..4d7259bd3 100644 --- a/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/Head_Card/I2C_Head_Mux.c +++ b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/Head_Card/I2C_Head_Mux.c @@ -18,7 +18,7 @@ uint32_t Select_Main_Head_Mux_Channel() uint8_t Write_Buf[1]; - Block_Main_WHS_Mux_Channel(); + //Block_Main_WHS_Mux_Channel(); Write_Buf[0] = 0x01 << 4;//Channel 4 diff --git a/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/Head_Card/PT100/Head_PT100_ADC.c b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/Head_Card/PT100/Head_PT100_ADC.c index 5c250f1b7..d9464efc0 100644 --- a/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/Head_Card/PT100/Head_PT100_ADC.c +++ b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/Head_Card/PT100/Head_PT100_ADC.c @@ -124,8 +124,8 @@ uint32_t I2C_Read_SensorId(uint32_t I2C_ID, TEMPERATURE_SENSOR_ID_ENUM SensorId, uint32_t HeadADCPT100_Reset(void) { - #ifndef EVALUATION_BOARD uint32_t status = OK; + #ifndef EVALUATION_BOARD uint8_t i; uint8_t Write_Buf[1]; diff --git a/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/RFID_NFC/PN7150/PN7150.c b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/RFID_NFC/PN7150/PN7150.c index 8489b08a5..b33d7f0c1 100644 --- a/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/RFID_NFC/PN7150/PN7150.c +++ b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/RFID_NFC/PN7150/PN7150.c @@ -18,6 +18,7 @@ F1_GPO_REG2 Reset_NFC; void Reset_NFC_Device(PANEL_BUTTON_OR_CRAT_ID Cart_ID)//reset pin. Set the device in Hard Power Down { assert (Cart_ID<=CART_3); +#ifndef EVALUATION_BOARD switch(Cart_ID) { @@ -35,4 +36,5 @@ void Reset_NFC_Device(PANEL_BUTTON_OR_CRAT_ID Cart_ID)//reset pin. Set the devic } F1_GPO_02_bus = Reset_NFC.ushort; +#endif } diff --git a/Software/Embedded_SW/Embedded/Drivers/Motors/Motor.c b/Software/Embedded_SW/Embedded/Drivers/Motors/Motor.c index 4a5a48f04..d1a3ee958 100644 --- a/Software/Embedded_SW/Embedded/Drivers/Motors/Motor.c +++ b/Software/Embedded_SW/Embedded/Drivers/Motors/Motor.c @@ -90,6 +90,7 @@ uint32_t Motor_ReconfigAllMotors(void) { TimerMotors_t Motor_i; uint32_t status = PASSED; + ReportWithPackageFilter(GeneralFilter,"Motor_ReconfigAllMotors",__FILE__,__LINE__,NUM_OF_MOTORS,RpMessage,0,0); for (Motor_i = 0; Motor_i < NUM_OF_MOTORS ; Motor_i++) { if (isMotorConfigured(Motor_i)) @@ -349,6 +350,7 @@ uint32_t MotorStop(TimerMotors_t _motorId, STOP_TYPE_ENUM StopType) Stop_Command = StopType; Mot_Stop(); #else + //ReportWithPackageFilter(GeneralFilter,"MotorStop",__FILE__,__LINE__,_motorId,RpMessage,StopType,0); MotorDriverRequest[_motorId].Stop = StopType; FPGA_SetMotStop(_motorId); #endif diff --git a/Software/Embedded_SW/Embedded/Drivers/Motors/MotorActions.c b/Software/Embedded_SW/Embedded/Drivers/Motors/MotorActions.c index 3a1d25310..3fe15b300 100644 --- a/Software/Embedded_SW/Embedded/Drivers/Motors/MotorActions.c +++ b/Software/Embedded_SW/Embedded/Drivers/Motors/MotorActions.c @@ -521,7 +521,7 @@ uint32_t MotorMoveToLimitSwitchCallBackFunction(uint32_t IfIndex, uint32_t Limit Task_sleep(200); ActivateHeadMagnet(); // close the lid magnet CloseMagnet=false; - LOG_ERROR(CloseMagnet,"ActivateHeadMagnet"); + ReportWithPackageFilter(GeneralFilter,"calling ActivateHeadMagnet",__FILE__,__LINE__,HARDWARE_MOTOR_TYPE__MOTO_DH_LID,RpMessage,0,0); } } //call the module callback @@ -554,7 +554,7 @@ uint32_t MotorMovetoLimitSwitch (TimerMotors_t MotorId,bool direction, uint32_t { CloseMagnet = true; } - LOG_ERROR(CloseMagnet,"DeActivateHeadMagnet"); + ReportWithPackageFilter(GeneralFilter,"calling DeActivateHeadMagnet",__FILE__,__LINE__,HARDWARE_MOTOR_TYPE__MOTO_DH_LID,RpMessage,0,0); } if (MotorId == HARDWARE_MOTOR_TYPE__MOTO_RDANCER) { @@ -711,6 +711,7 @@ uint32_t MotorMovetoDancerPosition (TimerMotors_t MotorId,bool direction, uint32 uint32_t MotorAbortMovetoLimitSwitch (TimerMotors_t MotorId) { + ReportWithPackageFilter(GeneralFilter,"MotorAbortMovetoLimitSwitch",__FILE__,__LINE__,MotorId,RpMessage,MotorControlId[MotorId],0); if (MotorControlId[MotorId] != 0xFF) { RemoveControlCallback(MotorControlId[MotorId], MotorControlCallback[MotorId] ); diff --git a/Software/Embedded_SW/Embedded/Drivers/USB_Communication/USBCDCD.c b/Software/Embedded_SW/Embedded/Drivers/USB_Communication/USBCDCD.c index b7a6fb67e..e6812d607 100644 --- a/Software/Embedded_SW/Embedded/Drivers/USB_Communication/USBCDCD.c +++ b/Software/Embedded_SW/Embedded/Drivers/USB_Communication/USBCDCD.c @@ -617,7 +617,12 @@ uint32_t ControlHandler(void *pvCBData, uint32_t ui32Event, uint32_t ui32MsgValu return(0); } uint32_t buffId = 0xFF; +/*#define MAX_USB_LOG 3 +uint32_t ULength[MAX_USB_LOG+1] = {0}; +uint32_t UDataLength[MAX_USB_LOG] = {0}; +byte URxIndex = 0; +*/ void handleRx(void) { uint32_t ui32Read; @@ -639,6 +644,7 @@ if (expected_message_size == 0) } while(size_bar < 4); expected_message_size = *(int *)size; + // ULength[URxIndex] = expected_message_size; buffId = initArray( expected_message_size); if (buffId == 0xFF) expected_message_size = 0; @@ -653,11 +659,15 @@ if (expected_message_size == 0) { insertArray(buffId,ui8Char); current_message_size++; +// UDataLength[URxIndex] = current_message_size; } if (current_message_size == expected_message_size) { g_RxCount += current_message_size; +/* UDataLength[URxIndex] = current_message_size; + if (URxIndex++>= MAX_USB_LOG) + URxIndex = 0;*/ CommunicationTaskMessageReceived(buffId,current_message_size); expected_message_size = 0; current_message_size = 0; diff --git a/Software/Embedded_SW/Embedded/Drivers/Valves/Valve.c b/Software/Embedded_SW/Embedded/Drivers/Valves/Valve.c index bc5cb5096..a604f9bc6 100644 --- a/Software/Embedded_SW/Embedded/Drivers/Valves/Valve.c +++ b/Software/Embedded_SW/Embedded/Drivers/Valves/Valve.c @@ -373,7 +373,7 @@ uint32_t Control3WayValvesWithCallback (Valves_t _ValveId, bool direction, callb Valve3WayModuleCallback[_ValveId] = callback; busy = FPGA_GetDispenserValveBusyOCD(_ValveId,0); - Report("Set valve id, dir, busy",__FILE__,_ValveId,(int)direction,RpWarning,(int)busy,0); + //Report("Set valve id, dir, busy",__FILE__,_ValveId,(int)direction,RpWarning,(int)busy,0); Valve3WayControlId[_ValveId] = AddControlCallback("Valve3WayControlId", Valve3WayCallBackFunction, eOneSecond/*eHundredMillisecond*/, FPGA_GetDispenserValveBusyOCD,(IfTypeDisopenser*0x100+_ValveId), _ValveId, 0 ); if (Valve3WayControlId[_ValveId] == 0xFF) Report("Add control callback failed",__FILE__,__LINE__,(int)_ValveId,RpWarning,(int)Valve3WayControlId[_ValveId],0); diff --git a/Software/Embedded_SW/Embedded/Drivers/logi-tag/LT_RFID.c b/Software/Embedded_SW/Embedded/Drivers/logi-tag/LT_RFID.c index 2b340c535..b7683688d 100644 --- a/Software/Embedded_SW/Embedded/Drivers/logi-tag/LT_RFID.c +++ b/Software/Embedded_SW/Embedded/Drivers/logi-tag/LT_RFID.c @@ -944,3 +944,218 @@ int incrementCounterAndCompare( uint32_t readerID, NxpNci_RfIntf_t *tagInfo, int return 1; } +void RFID_Test() +{ + +uint8_t i, readerID = 1; +NxpNci_RfIntf_t tagInfo; +uint8_t addressBlock = 0xE3; // NTAG216 - User memory blocks: 0x04-0xE1 = 222 blocks = 888 bytes +uint8_t tagId[]= {0}; +uint8_t Serial[] = {'1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F', 'G'}; +uint8_t factoryID[] = { '1', '2', '3'}; +uint16_t fillingSystem = 55; +uint8_t workOrder[] = { 'W', 'O', '1', '9', '0', '0', '0', '0', '1', '8'}; +uint8_t colorName[] = { 'C', 'O', 'L', 'O', 'R', '-', 'N', 'A', 'M', 'E', '-', '1', '2', '3'}; +uint8_t catagory[] = { '0', '1'}; +uint32_t type = 1234; +uint32_t cartSize = 1522; +uint32_t inkVolume = 750; +uint8_t inkBatch[] = { 'W', 'O', '1', '9', '0', '0', '0', '1', '0', '8' }; +uint8_t inkMfgDate[] = { '1', '9', '/', '0', '7', '/', '1', '9' }; +uint8_t inkEolDate[] = { '1', '9', '/', '0', '7', '/', '2', '0' }; +uint8_t CartFillDate[] = { '1', '8', '/', '0', '8', '/', '1', '9' }; +uint8_t WasteFillDate[] = { 'S', 'T', 'U', 'V', 'W', 'X', 0, 0 }; +uint32_t Misc = 1234; +uint32_t pluginCounter = 15; +uint8_t inkFill = 1; +uint8_t inkUsed = 2; +uint8_t inkEmpty = 3; +uint8_t wasteEmpty = 4; +uint8_t wasteFilling = 5; +uint8_t wasteFull = 6; +uint8_t blocked = 7; +uint8_t fail = 8; +uint16_t wasteCounter = 14; +uint8_t MachineIdInl[] = { 'A', '1', 'B', '2', 'C', '3', 'D', '4', 'E', '5', 'F', '6', 'G', '7', 'H', '8' }; +uint8_t MachineIdWst[] = { 'H', '8', 'G', '7', 'F', '6', 'E', '5', 'D', '4', 'C', '3', 'B', '2', 'A', '1' }; +uint8_t reserved[] = { 'A', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 0 }; +uint32_t counter = 12; +uint8_t tagValid = 1; +uint8_t uid[7] = {0}; +uint8_t hashValue[16] = {0}; +uint8_t newPACK[] = {0x11, 0x22}; +uint8_t newPwd[] = {0xFF, 0xFF, 0xFF, 0xFF}; +uint8_t startingBlock = 0x04; +uint8_t pwdAddr = 0xE5; +uint8_t tagMemory[1024]; +uint16_t succeededWriteSize = 0; +uint16_t succeededReadSize = 0; +bool firstTime = true; + +uint32_t dummy = 0; +RFID_RETURN_CODE RFIDRetValue; +RFID_HardReset(readerID); +RFID_StartDiscovery(readerID); +InitFields(); +while(1) + { + if(RFID_WaitForDiscoveryNotification(readerID, &tagInfo) == SUCCESS){ + //if(firstTime){ + //firstTime = false; + //RFID_CardModeSend(readerID, &tagInfo, newPwd, pwdAddr, sizeof(newPwd), &succeededWriteSize); + //RFID_CardModeReceive(readerID, &tagInfo, tagMemory, addressBlock, sizeof(tagMemory), &succeededReadSize); + //if(memcmp(dataToWrite, tagMemory, sizeof(dataToWrite)) == 0) + // greenLedBlink(500); + //counter = GetCounter (readerID, &tagInfo); + //isTagValid = IsTagValid(readerID, &tagInfo); + //UID + RFIDRetValue = getUID( readerID, &tagInfo, uid ); + //password update + //if ( setPwdValue( readerID, &tagInfo, newPwd ) == true ) + // i = 0; + + ///if ( activatePwd( readerID, &tagInfo, startingBlock ) == true ) + /// i = 1; + //password authentication + if ( checkPwd( newPwd, newPACK ) == true ) + i = 0; + if ( setPACKValue( readerID, &tagInfo, newPACK ) == true ) + i = 1; + + //RFIDRetValue = getPwd( readerID, &tagInfo, pwd ); + //serial + RFIDRetValue = WriteValue( readerID, &tagInfo, Serial, 0, dummy ); + RFIDRetValue = ReadValue( readerID, &tagInfo, Serial, 0, &dummy ); + //factory id + RFIDRetValue = WriteValue( readerID, &tagInfo, factoryID, 1, dummy ); + RFIDRetValue = ReadValue( readerID, &tagInfo, factoryID, 1, &dummy ); + //filling system + RFIDRetValue = WriteValue( readerID, &tagInfo, tagMemory, 2, fillingSystem ); + RFIDRetValue = ReadValue( readerID, &tagInfo, tagMemory, 2, &fillingSystem ); + //work order + RFIDRetValue = WriteValue( readerID, &tagInfo, workOrder, 3, dummy ); + RFIDRetValue = ReadValue( readerID, &tagInfo, workOrder, 3, &dummy ); + //color name + RFIDRetValue = WriteValue( readerID, &tagInfo, colorName, 4, dummy ); + RFIDRetValue = ReadValue( readerID, &tagInfo, colorName, 4, &dummy ); + //category + RFIDRetValue = WriteValue( readerID, &tagInfo, catagory, 5, dummy ); + RFIDRetValue = ReadValue( readerID, &tagInfo, catagory, 5, &dummy ); + //type + RFIDRetValue = WriteValue( readerID, &tagInfo, tagMemory, 6, type ); + RFIDRetValue = ReadValue( readerID, &tagInfo, tagMemory, 6, &type ); + //cartSize + RFIDRetValue = WriteValue( readerID, &tagInfo, tagMemory, 7, cartSize ); + cartSize = 0; + RFIDRetValue = ReadValue( readerID, &tagInfo, tagMemory, 7, &cartSize ); + //inkVolume + RFIDRetValue = WriteValue( readerID, &tagInfo, tagMemory, 8, inkVolume ); + inkVolume = 0; + RFIDRetValue = ReadValue( readerID, &tagInfo, tagMemory, 8, &inkVolume ); + //inkBatch + RFIDRetValue = WriteValue( readerID, &tagInfo, inkBatch, 9, dummy ); + for ( i = 0; i < sizeof(inkBatch); i++ ) inkBatch[i] = 0; + RFIDRetValue = ReadValue( readerID, &tagInfo, inkBatch, 9, &dummy ); + //inkMfgDate + RFIDRetValue = WriteValue( readerID, &tagInfo, inkMfgDate, 10, dummy ); + for ( i = 0; i < sizeof(inkMfgDate); i++ ) inkMfgDate[i] = 0; + RFIDRetValue = ReadValue( readerID, &tagInfo, inkMfgDate, 10, &dummy ); + //inkEolDate + RFIDRetValue = WriteValue( readerID, &tagInfo, inkEolDate, 11, dummy ); + for ( i = 0; i < sizeof(inkEolDate); i++ ) inkEolDate[i] = 0; + RFIDRetValue = ReadValue( readerID, &tagInfo, inkEolDate, 11, &dummy ); + //CartFillDate + RFIDRetValue = WriteValue( readerID, &tagInfo, CartFillDate, 12, dummy ); + for ( i = 0; i < sizeof(CartFillDate); i++ ) CartFillDate[i] = 0; + RFIDRetValue = ReadValue( readerID, &tagInfo, CartFillDate, 12, &dummy ); + //WasteFillDate + RFIDRetValue = WriteValue( readerID, &tagInfo, WasteFillDate, 13, dummy ); + for ( i = 0; i < sizeof(WasteFillDate); i++ ) WasteFillDate[i] = 0; + RFIDRetValue = ReadValue( readerID, &tagInfo, WasteFillDate, 13, &dummy ); + //Misc + RFIDRetValue = WriteValue( readerID, &tagInfo, tagMemory, 14, Misc ); + Misc = 0; + RFIDRetValue = ReadValue( readerID, &tagInfo, tagMemory, 14, &Misc ); + //pluginCounter + RFIDRetValue = WriteValue( readerID, &tagInfo, tagMemory, 15, pluginCounter ); + pluginCounter = 0; + RFIDRetValue = ReadValue( readerID, &tagInfo, tagMemory, 15, &pluginCounter ); + //inkFill + RFIDRetValue = WriteValue( readerID, &tagInfo, tagMemory, 16, inkFill ); + inkFill = 0; + RFIDRetValue = ReadValue( readerID, &tagInfo, tagMemory, 16, &inkFill ); + //inkUsed + RFIDRetValue = WriteValue( readerID, &tagInfo, tagMemory, 17, inkUsed ); + inkUsed = 0; + RFIDRetValue = ReadValue( readerID, &tagInfo, tagMemory, 17, &inkUsed ); + //inkEmpty + RFIDRetValue = WriteValue( readerID, &tagInfo, tagMemory, 18, inkEmpty ); + inkEmpty = 0; + RFIDRetValue = ReadValue( readerID, &tagInfo, tagMemory, 18, &inkEmpty ); + //wasteEmpty + RFIDRetValue = WriteValue( readerID, &tagInfo, tagMemory, 19, wasteEmpty ); + inkVolume = 0; + RFIDRetValue = ReadValue( readerID, &tagInfo, tagMemory, 19, &wasteEmpty ); + //wasteFilling + RFIDRetValue = WriteValue( readerID, &tagInfo, tagMemory, 20, wasteFilling ); + inkVolume = 0; + RFIDRetValue = ReadValue( readerID, &tagInfo, tagMemory, 20, &wasteFilling ); + //wasteFull + RFIDRetValue = WriteValue( readerID, &tagInfo, tagMemory, 21, wasteFull ); + wasteFull = 0; + RFIDRetValue = ReadValue( readerID, &tagInfo, tagMemory, 21, &wasteFull ); + //blocked + RFIDRetValue = WriteValue( readerID, &tagInfo, tagMemory, 22, blocked ); + inkVolume = 0; + RFIDRetValue = ReadValue( readerID, &tagInfo, tagMemory, 22, &blocked ); + //fail + RFIDRetValue = WriteValue( readerID, &tagInfo, tagMemory, 23, fail ); + wasteFull = 0; + RFIDRetValue = ReadValue( readerID, &tagInfo, tagMemory, 23, &fail ); + //wasteCounter + RFIDRetValue = WriteValue( readerID, &tagInfo, tagMemory, 24, wasteCounter ); + inkVolume = 0; + RFIDRetValue = ReadValue( readerID, &tagInfo, tagMemory, 24, &wasteCounter ); + //MachineIdInl + RFIDRetValue = WriteValue( readerID, &tagInfo, MachineIdInl, 25, dummy ); + for ( i = 0; i < sizeof(MachineIdInl); i++ ) MachineIdInl[i] = 0; + RFIDRetValue = ReadValue( readerID, &tagInfo, MachineIdInl, 25, &dummy ); + //WasteFillDate + RFIDRetValue = WriteValue( readerID, &tagInfo, MachineIdWst, 26, dummy ); + for ( i = 0; i < sizeof(MachineIdWst); i++ ) MachineIdWst[i] = 0; + RFIDRetValue = ReadValue( readerID, &tagInfo, MachineIdWst, 26, &dummy ); + //WasteFillDate + RFIDRetValue = WriteValue( readerID, &tagInfo, reserved, 27, dummy ); + for ( i = 0; i < sizeof(reserved); i++ ) reserved[i] = 0; + RFIDRetValue = ReadValue( readerID, &tagInfo, reserved, 27, &dummy ); + //counter + RFIDRetValue = WriteValue( readerID, &tagInfo, tagMemory, 28, counter ); + counter = 0; + RFIDRetValue = ReadValue( readerID, &tagInfo, tagMemory, 28, &counter ); + //tagValid + RFIDRetValue = WriteValue( readerID, &tagInfo, tagMemory, 29, tagValid ); + tagValid = 0; + RFIDRetValue = ReadValue( readerID, &tagInfo, tagMemory, 29, &tagValid ); + + //hash + calcHash( uid, sizeof(uid), hashValue ); + RFIDRetValue = WriteValue( readerID, &tagInfo, hashValue, 30, dummy ); + for ( i = 0; i < sizeof(hashValue); i++ ) hashValue[i] = 0; + RFIDRetValue = ReadValue( readerID, &tagInfo, hashValue, 30, &dummy ); + //password + + //} + RFID_StopDiscovery(readerID); + RFID_StartDiscovery(readerID); + + ACTIVITY_RED_LED_ON; + ACTIVITY_GREEN_LED_ON; + //greenLedBlink(100); + } + delayms(100); + } + + //---------------------------------------------------------------------------- + +} + diff --git a/Software/Embedded_SW/Embedded/Main.c b/Software/Embedded_SW/Embedded/Main.c index d424c56cc..b118207a3 100644 --- a/Software/Embedded_SW/Embedded/Main.c +++ b/Software/Embedded_SW/Embedded/Main.c @@ -228,8 +228,10 @@ int main(void) PortFunctionInit(); - MCU_E2PromInit(); +#ifndef EVALUATION_BOARD + MCU_E2PromInit(); +#endif #ifdef EVALUATION_BOARD Init_EVB(); #endif @@ -318,7 +320,9 @@ int main(void) //Test_ADS120_Internal_Temperature_Sensor(0); +#ifndef EVALUATION_BOARD Main_EEPROM_Read_Main_Card_SN(); +#endif // Enable interrupts to the processor. // @@ -326,7 +330,6 @@ int main(void) IDLE_TASK_package_init(); - Start_InitSequence(); PowerIdleInit(); BIOS_start(); diff --git a/Software/Embedded_SW/Embedded/Modules/AlarmHandling/AlarmHandling.c b/Software/Embedded_SW/Embedded/Modules/AlarmHandling/AlarmHandling.c index 6d5dc00b2..11d08d45a 100644 --- a/Software/Embedded_SW/Embedded/Modules/AlarmHandling/AlarmHandling.c +++ b/Software/Embedded_SW/Embedded/Modules/AlarmHandling/AlarmHandling.c @@ -1129,26 +1129,27 @@ uint32_t AlarmHandlingLoop(uint32_t tick) if (FPGA_WD_Occurred == true) { Status = false; - break; } - if (isMotorConfigured((TimerMotors_t)AlarmItem[Alarm_i].DeviceId) == false) + else if (isMotorConfigured((TimerMotors_t)AlarmItem[Alarm_i].DeviceId) == false) { Status = false; - break; } - value = MotorGetStatus((TimerMotors_t)AlarmItem[Alarm_i].DeviceId); - if (AlarmItem[Alarm_i].AlarmDirection == true) + else { - if (value && AlarmItem[Alarm_i].AlarmValue) + value = MotorGetStatus((TimerMotors_t)AlarmItem[Alarm_i].DeviceId); + if (AlarmItem[Alarm_i].AlarmDirection == true) { - Status = true; + if (value && AlarmItem[Alarm_i].AlarmValue) + { + Status = true; + } } - } - else - { - if ((value && AlarmItem[Alarm_i].AlarmValue)==false) + else { - Status = true; + if ((value && AlarmItem[Alarm_i].AlarmValue)==false) + { + Status = true; + } } } } diff --git a/Software/Embedded_SW/Embedded/Modules/Control/control.c b/Software/Embedded_SW/Embedded/Modules/Control/control.c index 1f5e008d3..8dad3fa60 100644 --- a/Software/Embedded_SW/Embedded/Modules/Control/control.c +++ b/Software/Embedded_SW/Embedded/Modules/Control/control.c @@ -170,7 +170,7 @@ uint32_t ControlActivityLed( uint32_t Parameter1) if(FPGA_WD_Occurred == true) { ACTIVITY_GREEN_LED_ON; - HWConfigurationInit(); + //Motor_ReconfigAllMotors(); } else ACTIVITY_GREEN_LED_OFF; diff --git a/Software/Embedded_SW/Embedded/Modules/Diagnostics/Diagnostics.c b/Software/Embedded_SW/Embedded/Modules/Diagnostics/Diagnostics.c index ccf5455d4..5c0af7589 100644 --- a/Software/Embedded_SW/Embedded/Modules/Diagnostics/Diagnostics.c +++ b/Software/Embedded_SW/Embedded/Modules/Diagnostics/Diagnostics.c @@ -515,7 +515,7 @@ void Diagnostic100msecCollection(void) return; //DiagnosticLoadSpeedSensor(getSensorSpeedData()); - if (DiagnosticMode == Diagnostic_Extended_Mode) + if (DiagnosticMode == Diagnostic_Extreme_Mode) DiagnosticTenMsecCollection(); //call the 10msec function every 100 msec to reduce transport if (DiagnosticMode >= Diagnostic_Extended_Mode) @@ -553,7 +553,13 @@ void Diagnostic100msecCollection(void) MidTankpressure[i][0] = 1.00-(IDS_Dispenser_Data[i].consumedinnanolitter/5800000); } */ - + if (DiagnosticMode == Diagnostic_Extreme_Mode) + { + for (i=0;itoken, true, &response, &motor_homing_response__pack, &motor_homing_response__get_packed_size); - responseContainer.continuous = true; + 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); diff --git a/Software/Embedded_SW/Embedded/Modules/General/GeneralHardware.c b/Software/Embedded_SW/Embedded/Modules/General/GeneralHardware.c index 7e46d9342..46abd923f 100644 --- a/Software/Embedded_SW/Embedded/Modules/General/GeneralHardware.c +++ b/Software/Embedded_SW/Embedded/Modules/General/GeneralHardware.c @@ -18,13 +18,8 @@ #include "heaters/heaters_ex.h" -//#include "third_party/fatfs/src/ffconf.h" -//#include "third_party/fatfs/src/diskio.h" -//#include "drivers/Flash_Memory/Flash_Memory.h" -//#include "drivers/Flash_Memory/fatfs/ff.h" #include "drivers/Flash_ram/FlashProgram.h" -#include "third_party/fatfs/src/ffconf.h" #include "Common/SWUpdate/FileSystem.h" #include "PMR/common/MessageContainer.pb-c.h" @@ -54,7 +49,7 @@ #include "Drivers/I2C_Communication/Dispenser_Card/EEPROM/Dispenser_EEPROM.h" #include #include "Modules/General/buttons.h" - +#include "Modules/Waste/Waste.h" #include "Drivers/I2C_Communication/Main_Board_EEPROM/Main_EEPROM.h" @@ -153,6 +148,10 @@ uint32_t HWConfigurationInit(void) ADC_MUX_Init(); GeneralHwReady = true; + + //I2C_NFC_Test(); + //RFID_Test(); + return status; } diff --git a/Software/Embedded_SW/Embedded/Modules/General/buttons.h b/Software/Embedded_SW/Embedded/Modules/General/buttons.h index f7dbbb25f..646861bc7 100644 --- a/Software/Embedded_SW/Embedded/Modules/General/buttons.h +++ b/Software/Embedded_SW/Embedded/Modules/General/buttons.h @@ -34,6 +34,7 @@ typedef enum sttDISABLE, sttENABLE, sttJOGGING, + sttLONG_JOGGING, sttRDY, sttPRELOAD, @@ -44,10 +45,10 @@ typedef enum typedef struct Button { - char bttn_name[10]; //option - int bttn_status; // 0=RELEASE 1=PRESS - PBstat Action; // enum : offPB,shortPB,longPB,countPB,replongPB - PBcolor color; // enum : off, blue, blink, bithing + char bttn_name[10]; //option + PB_Status bttn_status; // 0=RELEASE 1=PRESS + PBstat Action; // enum : offPB,shortPB,longPB,countPB,replongPB + PBcolor color; // enum : off, blue, blink, bithing PBmachineState state; // enum : sttOFF, sttON, sttDISABLE, sttENABLE, sttIDLE, sttJOGGING uint32_t count; }button; diff --git a/Software/Embedded_SW/Embedded/Modules/General/process.c b/Software/Embedded_SW/Embedded/Modules/General/process.c index d7de5797d..4305fac0e 100644 --- a/Software/Embedded_SW/Embedded/Modules/General/process.c +++ b/Software/Embedded_SW/Embedded/Modules/General/process.c @@ -20,7 +20,6 @@ #include "drivers/I2C_Communication/ADC_MUX/ADC_MUX.h" #include "modules/ids/ids_ex.h" -#include "third_party/fatfs/src/ffconf.h" #include "Common/SWUpdate/FileSystem.h" #include "StateMachines/Initialization/PowerIdle.h" diff --git a/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_print.c b/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_print.c index 564df6862..b023d592b 100644 --- a/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_print.c +++ b/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_print.c @@ -1182,7 +1182,7 @@ uint32_t DCHeaterControlCBFunction(uint32_t IfIndex, uint32_t readValue) } if (readValue>(HeaterCmd[index].targettemperatue+500)) { - ReportWithPackageFilter(HeatersFilter, "DC OverHeating in progress",__FILE__,readValue,HeaterReady[index],RpError, HeaterAtTemp[index],0); + ReportWithPackageFilter(HeatersFilter, "DC OverHeating in progress",__FILE__,index,readValue,RpError, HeaterReady[index],0); } // check if the read value is within the proportional band diff --git a/Software/Embedded_SW/Embedded/Modules/IDS/IDS_Cleaning.c b/Software/Embedded_SW/Embedded/Modules/IDS/IDS_Cleaning.c index 2a1a8fa31..bdde05b43 100644 --- a/Software/Embedded_SW/Embedded/Modules/IDS/IDS_Cleaning.c +++ b/Software/Embedded_SW/Embedded/Modules/IDS/IDS_Cleaning.c @@ -17,7 +17,7 @@ #include "drivers/valves/valve.h" int SaveLeftRockerSpeed = 50, SaveRightRockerSpeed = 50; -#define CLEANING_DISPENSER_ID 6 + uint32_t IDS_Cleaning_Move_Rockers (int LeftRockerSpeed,int RightRockerSpeed) { uint32_t status = OK; @@ -43,8 +43,8 @@ uint32_t IDS_Cleaning_Center_And_Stop_Rockers (int timeout,callback_fptr callbac uint32_t IDS_Cleaning_Spray_Cleaning_Solution (int dispenserSpeed,callback_fptr callback) { uint32_t status = OK; - status = IDS_Dispenser_Start_Motor_and_Open_Valve(CLEANING_DISPENSER_ID, dispenserSpeed, callback); - Report("IDS_Cleaning_Spray_Cleaning_Solution", __FILE__, __LINE__, CLEANING_DISPENSER_ID, RpWarning, dispenserSpeed, 0); + status = IDS_Dispenser_Start_Motor_and_Open_Valve(CLEANER_DISPENSER, dispenserSpeed, callback); + Report("IDS_Cleaning_Spray_Cleaning_Solution", __FILE__, __LINE__, CLEANER_DISPENSER, RpWarning, dispenserSpeed, 0); return status; @@ -52,8 +52,8 @@ uint32_t IDS_Cleaning_Spray_Cleaning_Solution (int dispenserSpeed,callback_fptr uint32_t IDS_Cleaning_Stop_Cleaning_Solution (callback_fptr callback) { uint32_t status = OK; - status = IDS_Dispenser_Close_Valve_And_Stop_Motor(CLEANING_DISPENSER_ID,callback); - Report("IDS_Cleaning_Stop_Cleaning_Solution", __FILE__, __LINE__, CLEANING_DISPENSER_ID, RpWarning, status, 0); + status = IDS_Dispenser_Close_Valve_And_Stop_Motor(CLEANER_DISPENSER,callback); + Report("IDS_Cleaning_Stop_Cleaning_Solution", __FILE__, __LINE__, CLEANER_DISPENSER, RpWarning, status, 0); return status; diff --git a/Software/Embedded_SW/Embedded/Modules/IDS/IDS_print.c b/Software/Embedded_SW/Embedded/Modules/IDS/IDS_print.c index ca9a15008..55ae7d879 100644 --- a/Software/Embedded_SW/Embedded/Modules/IDS/IDS_print.c +++ b/Software/Embedded_SW/Embedded/Modules/IDS/IDS_print.c @@ -593,7 +593,10 @@ uint32_t InactiveDispenserHome(uint32_t DispenserId, uint32_t ReadValue) } NumOfActiveDispensers = 0; - IDS_StopHomeDispenser(CLEANER_DISPENSER); + if (lubricant_speed > 0.1) + IDS_StopHomeDispenser(LUBRICANT_DISPENSER); + if ((EnableIntersegment == true)&&(IntersegmentLength>0)) + IDS_StopHomeDispenser(CLEANER_DISPENSER); for (i = 0; i < MAX_DYE_DISPENSERS; i++) { if (DispenserUsedInJob[i] == true) //we actually should check for all dispensers @@ -607,11 +610,37 @@ uint32_t InactiveDispenserHome(uint32_t DispenserId, uint32_t ReadValue) } else { - if ((HomingActive[i] == false)&&(PrimingActive == false)) + /**/if (AutoHoming_Config >= AutoHoming_JobEnd_PowerOn_off) + { + if ((HomingActive[i] == false)&&(PrimingActive == false)) + { + Report("Homing Inactive dispenser",__FILE__,i,HomingActive[i],RpWarning,PrimingActive[i],0); + IDS_HomeDispenser (i, 1000 , NULL); + } + else + { + Report("Inactive dispenser already homing",__FILE__,i,HomingActive[i],RpWarning,PrimingActive[i],0); + } + }/**/ + /*if ((HomingActive[i] == false)&&(PrimingActive == false)) { Report("Inactive dispenser open valve",__FILE__,i,HomingActive[i],RpWarning,PrimingActive[i],0); Control3WayValvesWithCallback (i, Dispenser_Mixer, NULL); //direction: MidTank_Dispenser or Dispenser_Mixer - } + Report("Homing Inactive dispenser",__FILE__,i,HomingActive[i],RpWarning,PrimingActive[i],0); + IDS_HomeDispenser (i, 1000 , NULL); + } + else + { + Report("Inactive dispenser already homing",__FILE__,i,HomingActive[i],RpWarning,PrimingActive[i],0); + } + }*/ + //if ((HomingActive[i] == false)&&(PrimingActive == false)) + //{ + // Report("Inactive dispenser open valve",__FILE__,i,HomingActive[i],RpWarning,PrimingActive[i],0); + // Control3WayValvesWithCallback (i, Dispenser_Mixer, NULL); //direction: MidTank_Dispenser or Dispenser_Mixer + //} + //ControlIdtoInactiveDispenserId[Dispenser_i] = AddControlCallback( IDS_Check_Pressure_Callback, eOneMinute,TemplateDataReadCBFunction ,0, 0, 0 ); + } } if (NumOfActiveDispensers) @@ -763,11 +792,13 @@ uint32_t InactiveDispenserHome(uint32_t DispenserId, uint32_t ReadValue) } else { - MotorStop(HW_Motor_Id, Hard_Hiz); - CurrentDispenserSpeed[Dispenser_i] = 0; - usnprintf(IdsMessage, 80,"Presegment Prepare Dispenser %d stopped",DispenserId,(int) segmentfirst_speed); - Report(IdsMessage, __FILE__, __LINE__, Dispenser_i, RpWarning, segmentfirst_speed, 0); - + if (DispenserUsedInJob[DispenserId] == true) + { + MotorStop(HW_Motor_Id, Hard_Hiz); + CurrentDispenserSpeed[Dispenser_i] = 0; + usnprintf(IdsMessage, 80,"Presegment Prepare Dispenser %d stopped",DispenserId,(int) segmentfirst_speed); + Report(IdsMessage, __FILE__, __LINE__, Dispenser_i, RpWarning, segmentfirst_speed, 0); + } } } DispenserBuildTimeCounter = 0; @@ -855,6 +886,8 @@ uint32_t IDS_Cleaning_Stop_Cleaning_Solution (callback_fptr callback); Report("End of Pre-segment Handling",__FILE__,__LINE__,InterSegmentStepsCount,RpWarning,(int)lInterSegmentLength,0); //PreSegmentReady(Module_IDS,ModuleDone); SafeRemoveControlCallback(DispenserPreSegmentControlId,IDSPreSegmentStateCallbackRunner); + if (CurrentDispenserSpeed[CLEANER_DISPENSER]>0) + IDS_Cleaning_Stop_Cleaning_Solution (NULL); setRapidPressureRead(false); } if (EnableCleaning == true) @@ -1145,12 +1178,15 @@ uint32_t IDSPreSegmentState(void *SegmentDetails, int SegmentId) } if ((EnableIntersegment == true)&&(IntersegmentLength>0.1)&&(SegmentId>0)) { - MotorStop(HW_Motor_Id,Soft_Hiz); //26/03/19 test without valves - CurrentDispenserSpeed[DispenserId] = 0; - //MotorSetSpeed(HW_Motor_Id, 5); - //CurrentDispenserSpeed[Dispenser_i] = 5; - DispenserPreSegmentReady[DispenserId] = true; //27/03/19 check if job should be stopped - REPORT_MSG(DispenserId,"Dispenser stopped pre Segment"); + if (DispenserUsedInJob[DispenserId] == true) + { + MotorStop(HW_Motor_Id,Soft_Hiz); //26/03/19 test without valves + CurrentDispenserSpeed[DispenserId] = 0; + //MotorSetSpeed(HW_Motor_Id, 5); + //CurrentDispenserSpeed[Dispenser_i] = 5; + DispenserPreSegmentReady[DispenserId] = true; //27/03/19 check if job should be stopped + REPORT_MSG(DispenserId,"Dispenser stopped pre Segment"); + } } IDS_Valve_PresegmentReady(DispenserId,0); //27/03/19 to be removed when the presegment handler will be added } @@ -1226,8 +1262,11 @@ void IDS_StartBrushStop(int n_dispensers, JobDispenser** Dispensers) { DispenserSegmentReady[DispenserId] = true; //IDS_Dispenser_Close_Valve_And_Stop_Motor(DispenserId,NULL);*/ - MotorStop(HW_Motor_Id, Hard_Hiz); - CurrentDispenserSpeed[DispenserId] = 0; + if (DispenserUsedInJob[DispenserId] == true) + { + MotorStop(HW_Motor_Id, Hard_Hiz); + CurrentDispenserSpeed[DispenserId] = 0; + } //Report("inActive dispenser stopped", __FILE__, __LINE__, DispenserId, RpWarning, segmentfirst_speed, 0); } } @@ -1276,6 +1315,17 @@ uint32_t IDSBrushStopRestartCallback(uint32_t IfIndex, uint32_t readValue) } return OK; } +#define VALVE_DELAY 1 +#ifdef VALVE_DELAY + +uint32_t IDSValveControlId = 0xFF; +uint32_t IDSSegmentStateSetValve(uint32_t IfIndex, uint32_t BusyFlag) +{ + SafeRemoveControlCallback(IDSValveControlId,IDSSegmentStateSetValve); + Valve_Set(VALVE_MIXCHIP_WASTECH, Mixer_Head); + Report("IDSSegmentState set valve after 1 second",__FILE__,__LINE__,(int)0,RpWarning,(int)0,0); +} +#endif //******************************************************************************************************************** uint32_t IDSSegmentState(void *SegmentDetails, int SegmentId) { @@ -1283,8 +1333,11 @@ uint32_t IDSSegmentState(void *SegmentDetails, int SegmentId) JobDispenser **Dispensers; int n_dispensers; +#ifdef VALVE_DELAY + IDSValveControlId = AddControlCallback("VALVE_DELAY",IDSSegmentStateSetValve, eOneSecond,TemplateDataReadCBFunction,0,0,0); +#else Valve_Set(VALVE_MIXCHIP_WASTECH, Mixer_Head); - +#endif IDS_Cleaning_Stop_Cleaning_Solution(NULL); SegmentNumOfBrushStops = Segment->n_brushstops; BrushStopTime = Segment->length/SegmentNumOfBrushStops; //brushstop in meters @@ -1412,7 +1465,7 @@ uint32_t IDSSegmentState(void *SegmentDetails, int SegmentId) { Report("IDS_Valve_EndValveReady start homing",__FILE__,deviceID,(int)AutoHoming_Config,RpWarning,(int)AutoHoming_JobEnd_PowerOn_off,0); - if (deviceID!=LUBRICANT_DISPENSER) + //if (deviceID!=LUBRICANT_DISPENSER) IDS_HomeDispenser (deviceID, 1000 , NULL); } return OK; @@ -1455,8 +1508,8 @@ uint32_t IDSSegmentState(void *SegmentDetails, int SegmentId) } else { - RemoveControlCallback(ControlIdtoInactiveDispenserId[Dispenser_i], IDS_Check_Pressure_Callback ); - ControlIdtoInactiveDispenserId[Dispenser_i] = 0xFF; +// RemoveControlCallback(ControlIdtoInactiveDispenserId[Dispenser_i], IDS_Check_Pressure_Callback ); +// ControlIdtoInactiveDispenserId[Dispenser_i] = 0xFF; IDS_Valve_EndValveReady(Dispenser_i,false); } diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c b/Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c index 856812c12..852c19a1a 100644 --- a/Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c +++ b/Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c @@ -67,6 +67,7 @@ uint8_t CallbackCounter = 0; uint8_t TimeoutsCounter = 0; + uint32_t UnloadingStart = 0; uint8_t NumberOfDrierLoaderCycles = 0; uint32_t status = OK; uint32_t LoadingControlId = 0xFF,PullerControlId = 0xFF,WinderControlId = 0xFF; @@ -184,8 +185,6 @@ { Report("Thread_Load_Set_Load_Arm_To_Start_Position_Callback",__FILE__,__LINE__,LoadStages,RpMessage,CallbackCounter,0); //storeLoadArmParameters(); - MotorMove(HARDWARE_MOTOR_TYPE__MOTO_DRYER_LOADARM,MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_DRYER_LOADARM].directionthreadwize,LoadArmInfo.LoadArmBackLash ); - SetMotHome(HARDWARE_MOTOR_TYPE__MOTO_DRYER_LOADARM); //set this point as the spool home LoadStages++; ThreadLoadStateMachine(LoadStages); @@ -215,6 +214,8 @@ //move to exact location? // Report("Thread Load State Machine Callback.",__FILE__,__LINE__,LoadStages,RpMessage,NumberOfDrierLoaderCycles,0); CallbackCounter = 0; + Report("Thread_Load_Set_Load_Arm_To_Stopper time",__FILE__,msec_millisecondCounter - UnloadingStart,msec_millisecondCounter,RpMessage,UnloadingStart,0); + Report("Thread_Load_Set_Load_Arm_To_Stopper_Callback",__FILE__,__LINE__,LoadStages,RpMessage,CallbackCounter,0); NumberOfDrierLoaderCycles=0; //storeLoadArmParameters(); @@ -614,7 +615,7 @@ LoadArmInfo.LoadArmRounds = 0; //uint32_t numberOfSteps = 0; //Start Feeder Pid, Rotate Loading Arm Counter Thread Direction X Circles According To Rml. Feeder Speed Is 40 - SetOriginMotorSpeed(19); + SetOriginMotorSpeed(30); // OriginalMotorSpd_2PPS[FEEDER_MOTOR] = 1000; // CurrentControlledSpeed[FEEDER_MOTOR] = 1000; @@ -670,14 +671,14 @@ CallbackCounter++; //MotorMoveWithCallback (HARDWARE_MOTOR_TYPE__MOTO_DRYER_LOADARM, MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_DRYER_LOADARM].directionthreadwize, // numberOfSteps, Thread_Load_Dryer_Loading_Callback, 100000); - Report("Thread_Load_Set_Load_Arm_To_Start_Position",__FILE__,__LINE__,LoadStages,RpMessage,NumberOfDrierLoaderCycles,0); + UnloadingStart = msec_millisecondCounter; + Report("Thread_Load_Set_Load_Arm_To_Start_Position",__FILE__,UnloadingStart,LoadStages,RpMessage,NumberOfDrierLoaderCycles,0); LoadArmInfo.LoadArmBackLash = 5; - status |= MotorMoveToStopper(HARDWARE_MOTOR_TYPE__MOTO_DRYER_LOADARM, (1-MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_DRYER_LOADARM].directionthreadwize), - MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_DRYER_LOADARM].pulseperround/4, Thread_Load_Set_Load_Arm_To_Stopper_Callback,LoadArmInfo.LoadArmBackLash,1000); + MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_DRYER_LOADARM].pulseperround/2, Thread_Load_Set_Load_Arm_To_Stopper_Callback,LoadArmInfo.LoadArmBackLash,1000); //Keep Notation How Many Rotations In The Dryer - LoadArmInfo.LoadArmBackLash = 5; + //LoadArmInfo.LoadArmBackLash = 0; LoadArmInfo.LoadArmRounds = (int)dryerbufferlength; load.color = BLINK; return OK; @@ -840,7 +841,7 @@ uint32_t ThreadLoadControlCBFunction(uint32_t IfIndex, uint32_t ReadValue) CurrentControlledSpeed[index] = calculated_speed; MotorSetSpeed(ThreadMotorIdToMotorId[index], calculated_speed); } - if (index == POOLER_MOTOR) + /* if (index == POOLER_MOTOR) { if ((TranslatedReadValue)<(-1200)) { @@ -868,7 +869,7 @@ uint32_t ThreadLoadControlCBFunction(uint32_t IfIndex, uint32_t ReadValue) } - } + }*/ /* LoadCounter++; if ((LoadCounter % 5001) == 0) { diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c index 741fed7af..0d1656301 100644 --- a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c +++ b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c @@ -107,6 +107,8 @@ uint32_t InternalWindingConfigMessage(JobSpool* request) InternalWinderCfg.startoffsetpulses = request->startoffsetpulses; InternalWinderCfg.SpoolBottomBackingRate = request->bottombackingrate; InternalWinderCfg.NumberOfRotationPerPassage = 3.1415926*2;//request->rotationsperpassage; + if (request->rotationsperpassage > 6.1) + InternalWinderCfg.NumberOfRotationPerPassage = request->rotationsperpassage; InternalWinderCfg.diameter = request->diameter; usnprintf(ScrewStr, 150, "WindingConfig start,offset,head,tail {, %d, %d, %d, %d, %d}",InternalWinderCfg.startoffsetpulses,(int)InternalWinderCfg.segmentoffsetpulses, (int)InternalWinderCfg.spoolbackingrate,(int)InternalWinderCfg.SpoolBottomBackingRate); @@ -279,7 +281,7 @@ numOfSteps = InternalWinderCfg.startoffsetpulses*MotorsCfg[HARDWARE_MOTOR_TYPE__ double WinderReferenceSpeed=0; double TotalWinderSpeed=0; bool Add100 = false; -double Rotations = 6.0; +double Rotations = 10.0; int flipflop = 0; uint32_t motspeed; float speedf; @@ -400,11 +402,11 @@ uint32_t Screw100msecDirectionChange(uint32_t deviceID, uint32_t BusyFlag) }*/ //WinderReferenceSpeed = 1000; //ScrewNumberOfSteps = 1000; - screw_horizontal_speed = ScrewNumberOfSteps / Rotations;//InternalWinderCfg.NumberOfRotationPerPassage; + //screw_horizontal_speed = ScrewNumberOfSteps / Rotations;//InternalWinderCfg.NumberOfRotationPerPassage; // if (Rotations > 6.6)//7.0) // Rotations = 6.0; - RotationsPerSecond = WinderReferenceSpeed / (double)MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_WINDER].pulseperround; - tempScrewSpeed = screw_horizontal_speed*RotationsPerSecond; + //RotationsPerSecond = WinderReferenceSpeed / (double)MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_WINDER].pulseperround; + //tempScrewSpeed = screw_horizontal_speed*RotationsPerSecond; //ROM_IntMasterDisable(); tempScrewSpeed = ScrewSpeed; @@ -468,7 +470,6 @@ uint32_t Winder_Presegment(void *SegmentDetails, uint32_t SegmentId) InternalWinderCfg.SpoolBottomBackingRate = 2000; //no cone shape for samples InternalWinderCfg.NumberOfRotationPerPassage = 100; // a very slow movement of the screw JobSegment* Segment = SegmentDetails; - InternalWinderCfg.NumberOfRotationPerPassage = 100; // a very slow movement of the screw ScrewSpeed = InternalWinderCfg.segmentoffsetpulses/(((Segment->length *100)/dyeingspeed)/3); ScrewNumberOfSteps = InternalWinderCfg.segmentoffsetpulses;//*MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_SCREW].microstep; @@ -481,7 +482,6 @@ uint32_t Winder_Presegment(void *SegmentDetails, uint32_t SegmentId) InternalWinderCfg.SpoolBottomBackingRate = 2000; //no cone shape for samples InternalWinderCfg.NumberOfRotationPerPassage = 100; // a very slow movement of the screw JobSegment* Segment = SegmentDetails; - InternalWinderCfg.NumberOfRotationPerPassage = 100; // a very slow movement of the screw ScrewSpeed = InternalWinderCfg.segmentoffsetpulses/(((Segment->length *100)/dyeingspeed)/20); ScrewNumberOfSteps = InternalWinderCfg.segmentoffsetpulses;//*MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_SCREW].microstep; } diff --git a/Software/Embedded_SW/Embedded/Software Release Notes.txt b/Software/Embedded_SW/Embedded/Software Release Notes.txt index 091d74d92..63b06e673 100644 --- a/Software/Embedded_SW/Embedded/Software Release Notes.txt +++ b/Software/Embedded_SW/Embedded/Software Release Notes.txt @@ -12,6 +12,17 @@ IDS: *dispenser data, *improve autofill on job start, *puller_tension from RML a Thread: *real dryer rampup. dancers from EEPROM only. *insure rockers motors voltage value; print: *prevent job on open covers (dryer, head) +Embedded SW Release note - Version 1.4.5.100 (alpha 1 +) +============================================================= +magnet handling improved +sw_ver in report log +mock whs alarms +read midtank every 1 hour (with valves handling) +lubricant homing at half speed +autohoming for lubricant +fix bugs: ifs, stubs, +dryer ramp fixed +out of idle on job start Embedded SW Release note - Version 1.4.5.96 (alpha 1 +) ============================================================= diff --git a/Software/Embedded_SW/Embedded/StateMachines/Printing/JobSTM.c b/Software/Embedded_SW/Embedded/StateMachines/Printing/JobSTM.c index 42f5572cf..651cc636e 100644 --- a/Software/Embedded_SW/Embedded/StateMachines/Printing/JobSTM.c +++ b/Software/Embedded_SW/Embedded/StateMachines/Printing/JobSTM.c @@ -1151,6 +1151,7 @@ Void jobTask(UArg arg0, UArg arg1) JobEndReason = JOB_OK; Report("JobRequestMsg",__FILE__,__LINE__, JobActive,RpMessage,JobResumed,0); JobActive = true; + PowerIdleOutOfIdleState(); SetMachineStatus(MACHINE_STATE__PreparingJob); JobResumed = false; setmachineActive(true); diff --git a/Software/PMR/Messages/Diagnostics/StartThreadLoadingUpdateRequest.proto b/Software/PMR/Messages/Diagnostics/StartThreadLoadingUpdateRequest.proto new file mode 100644 index 000000000..76da2c424 --- /dev/null +++ b/Software/PMR/Messages/Diagnostics/StartThreadLoadingUpdateRequest.proto @@ -0,0 +1,9 @@ +syntax = "proto3"; + +package Tango.PMR.Diagnostics; +option java_package = "com.twine.tango.pmr.diagnostics"; + +message StartThreadLoadingUpdateRequest +{ + +} \ No newline at end of file diff --git a/Software/PMR/Messages/Diagnostics/StartThreadLoadingUpdateResponse.proto b/Software/PMR/Messages/Diagnostics/StartThreadLoadingUpdateResponse.proto new file mode 100644 index 000000000..f0cf33ced --- /dev/null +++ b/Software/PMR/Messages/Diagnostics/StartThreadLoadingUpdateResponse.proto @@ -0,0 +1,11 @@ +syntax = "proto3"; + +import "ThreadLoadingState.proto"; + +package Tango.PMR.Diagnostics; +option java_package = "com.twine.tango.pmr.diagnostics"; + +message StartThreadLoadingUpdateResponse +{ + ThreadLoadingState ThreadLoadingState = 1; +} \ No newline at end of file diff --git a/Software/PMR/Messages/Diagnostics/ThreadLoadingState.proto b/Software/PMR/Messages/Diagnostics/ThreadLoadingState.proto new file mode 100644 index 000000000..19105702e --- /dev/null +++ b/Software/PMR/Messages/Diagnostics/ThreadLoadingState.proto @@ -0,0 +1,25 @@ + +syntax = "proto3"; + +package Tango.PMR.Diagnostics; +option java_package = "com.twine.tango.pmr.diagnostics"; + +enum ThreadLoadingState +{ + ThreadLoadInit = 0; + ThreadLoadReduceHeat = 1; //Heaters Off; Dryer Blower Off; Blower Low; + ThreadLoadSetLoadArmToStartPosition = 2;//Use Notation How Many Rotations In The Dryer; Or Check Against Stopper. Move Slowly + ThreadLoadOpenCovers = 3; //Open Dyeing Head Cover And Dryer Lid + ThreadLoadLiftDancers = 4; + ThreadLoadLiftRockers = 5; //Machine Is Ready. Send Message; Start Timer To Close Lids; Wait For Operator Response + ThreadLoadInitialTension = 6;//Check Spool Presencerun Winder Until Break Sensor Is Identifieing Movement For A Second + ThreadLoadCloseRockers = 7; + ThreadLoadCloseDancers = 8; //Send Dancer Motors To Preset Location; Check That The Dancers Are On The Thread + ThreadLoadCloseLids = 9; + ThreadLoadJogFeederToMiddlePoint = 10;//Jog The Feeder Motor Until The Feeder Dancer Is At Middle Position + ThreadLoadDryerLoading = 11; //Start Feeder Pid Rotate Loading Arm Counter Thread Direction X Circles According To Rml. Feeder Speed Is 40 + //Keep Notation How Many Rotations In The Dryer + ThreadLoadResumeHeating = 12; + ThreadLoadJogThread = 13; //Jog Thread Shortly To Make Sure Spool Is Running. Report End Of Loading + ThreadLoadEnd = 14; +} -- cgit v1.3.1 From 1171059d96c39662cef5c7414cd387048c2372d9 Mon Sep 17 00:00:00 2001 From: Shlomo Hecht Date: Thu, 12 Dec 2019 15:44:30 +0200 Subject: improvements and debugging --- .../Embedded/Common/SWUpdate/FileSystem.c | 2 + .../Embedded_SW/Embedded/Common/SW_Info/SW_Info.c | 2 +- .../Embedded_SW/Embedded/Communication/Container.c | 4 +- .../Embedded/Drivers/Heater/TemperatureSensor.c | 5 +- .../Embedded/Drivers/USB_Communication/USBCDCD.c | 5 +- .../Embedded/Modules/AlarmHandling/AlarmHandling.c | 158 ++------------------- .../Embedded/Modules/Control/MillisecTask.c | 2 + .../Embedded/Modules/Diagnostics/Diagnostics.c | 142 +++++++++--------- .../Embedded/Modules/Diagnostics/Diagnostics.h | 2 + .../Embedded/Modules/General/GeneralHardware.c | 2 +- .../Embedded/Modules/Heaters/Heaters_print.c | 6 +- .../Embedded/Software Release Notes.txt | 36 ++++- 12 files changed, 139 insertions(+), 227 deletions(-) (limited to 'Software/Embedded_SW/Embedded/Common/SWUpdate/FileSystem.c') diff --git a/Software/Embedded_SW/Embedded/Common/SWUpdate/FileSystem.c b/Software/Embedded_SW/Embedded/Common/SWUpdate/FileSystem.c index 5650cbd1b..b23b4361b 100644 --- a/Software/Embedded_SW/Embedded/Common/SWUpdate/FileSystem.c +++ b/Software/Embedded_SW/Embedded/Common/SWUpdate/FileSystem.c @@ -176,6 +176,8 @@ uint32_t FileChunkUploadRequestFunc(MessageContainer* requestContainer) else { FileReceivedLength += WrittenBytes; + ReportWithPackageFilter(CommFilter,"Chunk received", __FILE__,WrittenBytes,FileReceivedLength, RpMessage,msec_millisecondCounter, 0); + //REPORT_MSG (FileReceivedLength,"file upload chunk"); if (FileReceivedLength == FileLength) { 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 92ef02008..fd28180d7 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 = {1,4,8,0}; +TangoVersion_t _gTangoVersion = {1,4,6,0}; #define BUILD_DATE __DATE__ char Dat[50] = BUILD_DATE; char _gTangoName [MAX_STRING_LEN] = "Tango01 ";//d diff --git a/Software/Embedded_SW/Embedded/Communication/Container.c b/Software/Embedded_SW/Embedded/Communication/Container.c index 5ca7a4293..8cc4d883f 100644 --- a/Software/Embedded_SW/Embedded/Communication/Container.c +++ b/Software/Embedded_SW/Embedded/Communication/Container.c @@ -134,10 +134,10 @@ void receive_callback(char* buffer, size_t length) MessageContainer* requestContainer = message_container__unpack(NULL, length, (uint8_t*)buffer); if (requestContainer == NULL) return; - if ((requestContainer->type>= MESSAGE_TYPE__StartDiagnosticsRequest)&&(requestContainer->type != MESSAGE_TYPE__KeepAliveRequest)) //user action resets the idle counter + /*if ((requestContainer->type>= MESSAGE_TYPE__StartDiagnosticsRequest)&&(requestContainer->type != MESSAGE_TYPE__KeepAliveRequest)) //user action resets the idle counter { ReportWithPackageFilter(CommFilter,"Message received", __FILE__,__LINE__,requestContainer->type, RpMessage,length, 0); - } + }*/ if (requestContainer->type != MESSAGE_TYPE__KeepAliveRequest) resetIdleCounter(); KeepAliveOneSecondCounter = 0; diff --git a/Software/Embedded_SW/Embedded/Drivers/Heater/TemperatureSensor.c b/Software/Embedded_SW/Embedded/Drivers/Heater/TemperatureSensor.c index 1fab20d7e..cda7f6db7 100644 --- a/Software/Embedded_SW/Embedded/Drivers/Heater/TemperatureSensor.c +++ b/Software/Embedded_SW/Embedded/Drivers/Heater/TemperatureSensor.c @@ -184,9 +184,10 @@ int TemperatureListString(char* str) len = usnprintf(str, 150, "Prepare H1: %d H2: %d H3: %d H4: %d H5: %d H6: %d D1: %d D2: %d D3: %d M: %d",TempSensorResponse[TEMP_SENSE_ANALOG_DYEINGH_TEMP1].Temperature_C_mult_by_100/100, TempSensorResponse[TEMP_SENSE_ANALOG_DYEINGH_TEMP2].Temperature_C_mult_by_100/100,TempSensorResponse[TEMP_SENSE_ANALOG_DYEINGH_TEMP3].Temperature_C_mult_by_100/100, TempSensorResponse[TEMP_SENSE_ANALOG_DYEINGH_TEMP4].Temperature_C_mult_by_100/100,TempSensorResponse[TEMP_SENSE_ANALOG_DYEINGH_TEMP5].Temperature_C_mult_by_100/100, - TempSensorResponse[TEMP_SENSE_ANALOG_MIXCHIP_TEMP].Temperature_C_mult_by_100/100,TempSensorResponse[TEMP_SENSE_ANALOG_DRYER_TEMP1].Temperature_C_mult_by_100/100, + TempSensorResponse[HEAD6_PT100].Temperature_C_mult_by_100/100,TempSensorResponse[TEMP_SENSE_ANALOG_DRYER_TEMP1].Temperature_C_mult_by_100/100, TempSensorResponse[TEMP_SENSE_ANALOG_DRYER_TEMP2].Temperature_C_mult_by_100/100,TempSensorResponse[TEMP_SENSE_ANALOG_DRYER_TEMP3].Temperature_C_mult_by_100/100 - ,TempSensorResponse[TEMP_SENSE_AN_ENCLOSURETEMP3].Temperature_C_mult_by_100/100); + ,TempSensorResponse[MIXER6_PT100].Temperature_C_mult_by_100/100); + //Prepare H1: 78 H2: 111 H3: 137 H4: 135 H5: 144 H6: 75 D1: 120 D2: 167 D3: 158 M: 129 return len; } #endif diff --git a/Software/Embedded_SW/Embedded/Drivers/USB_Communication/USBCDCD.c b/Software/Embedded_SW/Embedded/Drivers/USB_Communication/USBCDCD.c index e6812d607..22a734781 100644 --- a/Software/Embedded_SW/Embedded/Drivers/USB_Communication/USBCDCD.c +++ b/Software/Embedded_SW/Embedded/Drivers/USB_Communication/USBCDCD.c @@ -82,7 +82,7 @@ static unsigned char UsbRxBuffer[COMM_MAX_BUFFER_SIZE]; static unsigned char transmitBuffer[COMM_MAX_BUFFER_SIZE]; -int expected_message_size; +int expected_message_size,keep_expected_message_size; int current_message_size; static volatile uint32_t g_RxCount; //static GateMutex_Handle gateTxSerial; @@ -647,7 +647,10 @@ if (expected_message_size == 0) // ULength[URxIndex] = expected_message_size; buffId = initArray( expected_message_size); if (buffId == 0xFF) + { + keep_expected_message_size = expected_message_size; expected_message_size = 0; + } } do diff --git a/Software/Embedded_SW/Embedded/Modules/AlarmHandling/AlarmHandling.c b/Software/Embedded_SW/Embedded/Modules/AlarmHandling/AlarmHandling.c index b62b33cc5..2e33bc248 100644 --- a/Software/Embedded_SW/Embedded/Modules/AlarmHandling/AlarmHandling.c +++ b/Software/Embedded_SW/Embedded/Modules/AlarmHandling/AlarmHandling.c @@ -91,7 +91,7 @@ typedef struct AlarmHandlingMessage{ // uint32_t Data; }AlarmHandlingMessageStruc; -#define MAX_SYSTEM_ALARMS 300+1 +#define MAX_SYSTEM_ALARMS 400+1 /*typedef enum { TemperatureAlarm, @@ -586,7 +586,7 @@ JobEndReasonEnum getEndReason(uint32_t AlarmId) } else { - usnprintf(AlarmReasonStr, 100, "Alarm %d caused a job stop",AlarmId); + usnprintf(AlarmReasonStr, 100, "Alarm %d type %d caused a job stop",AlarmId,AlarmItem[AlarmId].EventType); return JOB_OTHER_ALARM; } default: @@ -988,6 +988,9 @@ uint32_t AlarmHandlingStop(void) } return OK; } +uint32_t Save_Alarm_i; +void *Save_Alarm_ptr; +EventType Save_Alarm_Type; uint32_t AlarmHandlingLoop(uint32_t tick) { @@ -1105,10 +1108,10 @@ uint32_t AlarmHandlingLoop(uint32_t tick) { if (AlarmItem[Alarm_i].AlarmDirection == true) { - if ((doubleValue >= (AlarmItem[Alarm_i].AlarmValue*CurrentAlarmHighLimit)) || (doubleValue <= (AlarmItem[Alarm_i].AlarmValue*CurrentAlarmLowLimit))) + if ((doubleValue >= (float)(AlarmItem[Alarm_i].AlarmValue*CurrentAlarmHighLimit)) || (doubleValue <= (float)(AlarmItem[Alarm_i].AlarmValue*CurrentAlarmLowLimit))) { Status = true; - //ReportWithPackageFilter(AlarmFilter,"OverCurrent Alarm ON ", __FILE__,AlarmItem[Alarm_i].DeviceId,AlarmItem[Alarm_i].EventType, RpMessage, (int)doubleValue, 0); + ReportWithPackageFilter(AlarmFilter,"OverCurrent Alarm ON ", __FILE__,AlarmItem[Alarm_i].DeviceId,AlarmItem[Alarm_i].EventType, RpMessage, (int)doubleValue, 0); } } else @@ -1116,7 +1119,7 @@ uint32_t AlarmHandlingLoop(uint32_t tick) if (doubleValue <= 0.1) { Status = true; - //ReportWithPackageFilter(AlarmFilter,"llop break Alarm ON ", __FILE__,AlarmItem[Alarm_i].DeviceId,AlarmItem[Alarm_i].EventType, RpMessage, (int)doubleValue, 0); + ReportWithPackageFilter(AlarmFilter,"loop break Alarm ON ", __FILE__,AlarmItem[Alarm_i].DeviceId,AlarmItem[Alarm_i].EventType, RpMessage, (int)doubleValue, 0); } } @@ -1189,7 +1192,7 @@ uint32_t AlarmHandlingLoop(uint32_t tick) case ALARM_SOURCE_TYPE__TachoAlarm: // add by shai Status = false; - if (CheckTamperAlarms) + if (CheckCurrentAlarms) { // ReportWithPackageFilter(AlarmFilter,"------------FANS_RPM[Alarm_i]----------------", __FILE__,__LINE__,Alarm_i, RpMessage, value, 0); @@ -1365,16 +1368,19 @@ uint32_t AlarmHandlingLoop(uint32_t tick) } else // alarm off { + ReportWithPackageFilter(AlarmFilter,"Alarm OFF ", __FILE__,__LINE__,AlarmItem[Alarm_i].EventType, RpMessage, 0, Alarm_i); if (AlarmState[Alarm_i].EventPtr) { //ROM_IntMasterDisable(); + Save_Alarm_i = Alarm_i; + Save_Alarm_ptr = AlarmState[Alarm_i].EventPtr; + Save_Alarm_Type = AlarmItem[Alarm_i].EventType; my_free(AlarmState[Alarm_i].EventPtr); AlarmState[Alarm_i].EventPtr = NULL; //ROM_IntMasterEnable(); } AlarmState[Alarm_i].Status = false; AlarmHandlingConsequentActions(Alarm_i, DEBUG_LOG_CATEGORY__Info); - ReportWithPackageFilter(AlarmFilter,"Alarm OFF ", __FILE__,__LINE__,AlarmItem[Alarm_i].EventType, RpMessage, 0, Alarm_i); } } } @@ -1579,143 +1585,7 @@ uint32_t StopEventsNotificationRequestFunc(MessageContainer* requestContainer) my_free(responseContainer.data.data); SendChars(container_buffer, container_size); -return OK; - - -/* function : - * ------------- - * DrawerFansStatus // uint32_t getDrawerFansStatus(void) 5 fans OK or NotOK - * SystemFansStatus // uint32_t getSystemFansStatus(void) 2 fans OK or NotOK - * Fans_Speed_RPM[MAX_FANS] // - * - * Read_Dryer_Fan_Tacho // uint32_t Read_Dryer_Fan_Tacho() - * Control_Dryer_Fan(bool StartStop, uint8_t PWM_Command_Precent) //uint32_t Control_Dryer_Fan(bool StartStop, uint8_t PWM_Command_Precent); - * - * excell alarm ver9 from Nadav - * ---------------------------- - * 2009 MACHINE_FANS_RPM_TOO_LOW Warning - * 2010 MACHINE_FANS_STOPPED Critical - * 2011 ELECTRICAL_CABINET_FANS_RPM_TOO_LOW Warning - * 2012 ELECTRICAL_CABINET_FANS_STOPPED Critical - * 4015 DRYER_FAN_RPM_TOO_LOW Warning - * 4016 DRYER_FAN_STOPPED Critical - * - * - * - * - - - - - #define MACHINE_FANS_MIN_RPM 1000 - #define MACHINE_FANS_STOP 0 - #define ELECTRICAL_CABINET_FANS_MIN_RPM 1000 - #define ELECTRICAL_CABINET_FANS_STOP 0 - #define DRYER_FAN_MIN_RPM 1000 - #define DRYER_FAN_STOP 0 - - typedef enum - { - MACHINE_FANS, - ELECTRICAL_CABINET_FANS, -// ELECTRICAL_CABINET_FAN_BIG, -// ELECTRICAL_CABINET_FAN_SMALL1, -// ELECTRICAL_CABINET_FAN_SMALL2, -// ELECTRICAL_CABINET_FAN_SMALL3, -// ELECTRICAL_CABINET_FAN_SMALL4, - DRYER_FAN, - NUM_OF_FANS, - } Fans_t; - - - ----- 2009 : ------- - {eOneSecond, // uint16_t Frequency; - ALARM_SOURCE_TYPE__TachoAlarm, // AlarmSourceType AlarmSource; - MACHINE_FANS , // uint16_t DeviceId; - MACHINE_FANS , // uint8_t ModuleDeviceId; - MACHINE_FANS_MIN_RPM , // uint16_t AlarmValue; - FALSE , // bool AlarmDirection; - DEBUG_LOG_CATEGORY__Warning , // DebugLogCategory Severity; - 0xFF , // uint16_t Predecessor; - 5 , // uint8_t DebounceValue; - EVENT_TYPE__MACHINE_FANS_RPM_TOO_LOW // EventType EventType; - }, - - ----- 2010 : ------- - {eOneSecond, // uint16_t Frequency; - ALARM_SOURCE_TYPE__TachoAlarm, // AlarmSourceType AlarmSource; - MACHINE_FANS , // uint16_t DeviceId; - MACHINE_FANS , // uint8_t ModuleDeviceId; - MACHINE_FANS_STOP , // uint16_t AlarmValue; - FALSE , // bool AlarmDirection; - DEBUG_LOG_CATEGORY__Critical , // DebugLogCategory Severity; - 0xFF , // uint16_t Predecessor; - 5 , // uint8_t DebounceValue; - EVENT_TYPE__MACHINE_FANS_STOPPED // EventType EventType; - }, - - ----- 2011 : ------- - {eOneSecond, // uint16_t Frequency; - ALARM_SOURCE_TYPE__TachoAlarm, // AlarmSourceType AlarmSource; - ELECTRICAL_CABINET_FANS , // uint16_t DeviceId; - ELECTRICAL_CABINET_FANS , // uint8_t ModuleDeviceId; - ELECTRICAL_CABINET_FANS_MIN_RPM , // uint16_t AlarmValue; - FALSE , // bool AlarmDirection; - DEBUG_LOG_CATEGORY__Warning , // DebugLogCategory Severity; - 0xFF , // uint16_t Predecessor; - 5 , // uint8_t DebounceValue; - EVENT_TYPE__ELECTRICAL_CABINET_FANS_RPM_TOO_LOW // EventType EventType; - }, - - ----- 2012 : ------- - {eOneSecond, // uint16_t Frequency; - ALARM_SOURCE_TYPE__TachoAlarm, // AlarmSourceType AlarmSource; - ELECTRICAL_CABINET_FANS , // uint16_t DeviceId; - ELECTRICAL_CABINET_FANS , // uint8_t ModuleDeviceId; - ELECTRICAL_CABINET_FANS_STOP , // uint16_t AlarmValue; - FALSE , // bool AlarmDirection; - DEBUG_LOG_CATEGORY__Critical , // DebugLogCategory Severity; - 0xFF , // uint16_t Predecessor; - 5 , // uint8_t DebounceValue; - EVENT_TYPE__ELECTRICAL_CABINET_FANS_STOPPED // EventType EventType; - }, - - - ----- 2015 : ------- - {eOneSecond, // uint16_t Frequency; - ALARM_SOURCE_TYPE__TachoAlarm, // AlarmSourceType AlarmSource; - DRYER_FAN , // uint16_t DeviceId; - DRYER_FAN , // uint8_t ModuleDeviceId; - DRYER_FAN_MIN_RPM , // uint16_t AlarmValue; - FALSE , // bool AlarmDirection; - DEBUG_LOG_CATEGORY__Warning , // DebugLogCategory Severity; - 0xFF , // uint16_t Predecessor; - 5 , // uint8_t DebounceValue; - EVENT_TYPE__DRYER_FAN_RPM_TOO_LOW // EventType EventType; - }, - - ----- 2016 : ------- - {eOneSecond, // uint16_t Frequency; - ALARM_SOURCE_TYPE__TachoAlarm, // AlarmSourceType AlarmSource; - DRYER_FAN , // uint16_t DeviceId; - DRYER_FAN , // uint8_t ModuleDeviceId; - DRYER_FAN_STOP , // uint16_t AlarmValue; - FALSE , // bool AlarmDirection; - DEBUG_LOG_CATEGORY__Critical , // DebugLogCategory Severity; - 0xFF , // uint16_t Predecessor; - 5 , // uint8_t DebounceValue; - EVENT_TYPE__DRYER_FAN_STOPPED // EventType EventType; - }, - - {eOneSecond, ALARM_SOURCE_TYPE__TachoAlarm,MACHINE_FANS , MACHINE_FANS , MACHINE_FANS_MIN_RPM , FALSE , DEBUG_LOG_CATEGORY__Warning , 0xFF, 5, EVENT_TYPE__MACHINE_FANS_RPM_TOO_LOW }, - {eOneSecond, ALARM_SOURCE_TYPE__TachoAlarm,MACHINE_FANS , MACHINE_FANS , MACHINE_FANS_STOP , FALSE , DEBUG_LOG_CATEGORY__Critical, 0xFF, 5, EVENT_TYPE__MACHINE_FANS_STOPPED }, - {eOneSecond, ALARM_SOURCE_TYPE__TachoAlarm, ELECTRICAL_CABINET_FANS, ELECTRICAL_CABINET_FANS, ELECTRICAL_CABINET_FANS_MIN_RPM, FALSE , DEBUG_LOG_CATEGORY__Warning , 0xFF, 5, EVENT_TYPE__ELECTRICAL_CABINET_FANS_RPM_TOO_LOW }, - {eOneSecond, ALARM_SOURCE_TYPE__TachoAlarm, ELECTRICAL_CABINET_FANS, ELECTRICAL_CABINET_FANS, ELECTRICAL_CABINET_FANS_STOP , FALSE , DEBUG_LOG_CATEGORY__Critical, 0xFF, 5, EVENT_TYPE__ELECTRICAL_CABINET_FANS_STOPPED }, - {eOneSecond, ALARM_SOURCE_TYPE__TachoAlarm, DRYER_FAN , DRYER_FAN , DRYER_FAN_MIN_RPM , FALSE , DEBUG_LOG_CATEGORY__Warning , 0xFF, 5, EVENT_TYPE__DRYER_FAN_RPM_TOO_LOW }, - {eOneSecond, ALARM_SOURCE_TYPE__TachoAlarm, DRYER_FAN , DRYER_FAN , DRYER_FAN_STOP , FALSE , DEBUG_LOG_CATEGORY__Critical, 0xFF, 5, EVENT_TYPE__DRYER_FAN_STOPPED }, - - -* */ + return OK; } diff --git a/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c b/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c index 8897dfdbb..76b7aa7a1 100644 --- a/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c +++ b/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c @@ -567,6 +567,8 @@ float MillisecGetPressures (int SensorId) void setRapidPressureRead(bool value) { RapidPressureRead = value; + if (GetDiagnosticMode() == Diagnostic_Extreme_Mode) + RapidPressureRead = true; } uint16_t PumpCounter = 0; diff --git a/Software/Embedded_SW/Embedded/Modules/Diagnostics/Diagnostics.c b/Software/Embedded_SW/Embedded/Modules/Diagnostics/Diagnostics.c index 6e8b50c02..43a7b779f 100644 --- a/Software/Embedded_SW/Embedded/Modules/Diagnostics/Diagnostics.c +++ b/Software/Embedded_SW/Embedded/Modules/Diagnostics/Diagnostics.c @@ -70,7 +70,7 @@ DiagnosticsMonitors DiagnosticsMonitor = DIAGNOSTICS_MONITORS__INIT; #define DIAGNOSTICS_LIMIT 3 #define DIAGNOSTICS_DANCER_LIMIT 30 int DiagnosticsIndex = 0; -int DiagnosticCollectionLimit = 2; //number of data samples to collect before sending to the host +int DiagnosticCollectionLimit = 3; //number of data samples to collect before sending to the host //int DiagnosticLimit = eHundredMillisecond; //frequency of data collection //int DiagnosticFastLimit = eTenMillisecond; //frequency of data collection int DiagnosticLimit =eHundredMillisecond; //frequency of data collection @@ -221,6 +221,11 @@ void SetDiagnosticMode(Diagnostic_Mode Mode) DiagnosticMode = Mode; REPORT_MSG(Mode,"Diagnostic Mode set"); } +Diagnostic_Mode GetDiagnosticMode(void) +{ + return DiagnosticMode; +} + void SetDiagnosticCollectionLimit(int limit) { @@ -228,11 +233,12 @@ void SetDiagnosticCollectionLimit(int limit) DiagnosticCollectionLimit = limit; DiagnosticLimit =eHundredMillisecond; //frequency of data collection - if (DiagnosticMode <= Diagnostic_Normal_Mode) + /*if (DiagnosticMode <= Diagnostic_Normal_Mode) { DiagnosticCollectionLimit = 1; //overrule - send at least once every second DiagnosticLimit =eOneSecond; //frequency of data collection - } + }*/ + REPORT_MSG(DiagnosticCollectionLimit,"Diagnostic limit set"); } uint8_t HeaterCounterIndex[HEATER_TYPE_MAX_HEATERS]= {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; @@ -496,6 +502,21 @@ void DiagnosticOneMinuteCollection(void) void DiagnosticOneSecCollection(void) { int i; +#ifdef Use_Head_Card + DiagnosticLoadTemperature(HEATER_TYPE__MixerHeater, MillisecGetTemperatures( HEAD_PT100_MIXER_0X8E_0)); + DiagnosticLoadTemperature(HEATER_TYPE__HeaterZone1, MillisecGetTemperatures(HEAD_PT100_ZONE_1_0X80_0)); + DiagnosticLoadTemperature(HEATER_TYPE__HeaterZone2, MillisecGetTemperatures(HEAD_PT100_ZONE_2_0X80_1)); + DiagnosticLoadTemperature(HEATER_TYPE__HeaterZone3, MillisecGetTemperatures(HEAD_PT100_ZONE_3_0X82_0)); + DiagnosticLoadTemperature(HEATER_TYPE__HeaterZone4, MillisecGetTemperatures(HEAD_PT100_ZONE_4_0X82_1)); + DiagnosticLoadTemperature(HEATER_TYPE__HeaterZone5, MillisecGetTemperatures(HEAD_PT100_ZONE_5_0X84_0)); + DiagnosticLoadTemperature(HEATER_TYPE__HeaterZone6, MillisecGetTemperatures(HEAD_PT100_ZONE_6_0X84_1)); + DiagnosticLoadTemperature(HEATER_TYPE__HeaterZone7, MillisecGetTemperatures(HEAD_PT100_ZONE_7_0X86_0)); + DiagnosticLoadTemperature(HEATER_TYPE__HeaterZone8, MillisecGetTemperatures(HEAD_PT100_ZONE_8_0X86_1)); + DiagnosticLoadTemperature(HEATER_TYPE__HeaterZone9, MillisecGetTemperatures(HEAD_PT100_ZONE_9_0X88_0)); + DiagnosticLoadTemperature(HEATER_TYPE__HeaterZone10, MillisecGetTemperatures(HEAD_PT100_ZONE_10_0X88_1)); + DiagnosticLoadTemperature(HEATER_TYPE__HeaterZone11, MillisecGetTemperatures(HEAD_PT100_ZONE_11_0X8A_0)); + DiagnosticLoadTemperature(HEATER_TYPE__HeaterZone12, MillisecGetTemperatures(HEAD_PT100_ZONE_12_0X8A_1)); +#else DiagnosticLoadTemperature(HARDWARE_PID_CONTROL_TYPE__MixerHeater, MillisecGetTemperatures( MIXER_PT100)); DiagnosticLoadTemperature(HARDWARE_PID_CONTROL_TYPE__HeadHeaterZ1, MillisecGetTemperatures(TEMP_SENSE_ANALOG_DYEINGH_TEMP1)); DiagnosticLoadTemperature(HARDWARE_PID_CONTROL_TYPE__HeadHeaterZ2, MillisecGetTemperatures(TEMP_SENSE_ANALOG_DYEINGH_TEMP2)); @@ -503,7 +524,7 @@ void DiagnosticOneSecCollection(void) DiagnosticLoadTemperature(HARDWARE_PID_CONTROL_TYPE__HeadHeaterZ4, MillisecGetTemperatures(TEMP_SENSE_ANALOG_DYEINGH_TEMP4)); DiagnosticLoadTemperature(HARDWARE_PID_CONTROL_TYPE__HeadHeaterZ5, MillisecGetTemperatures(TEMP_SENSE_ANALOG_DYEINGH_TEMP5)); DiagnosticLoadTemperature(HARDWARE_PID_CONTROL_TYPE__HeadHeaterZ6, MillisecGetTemperatures(HEAD6_PT100)); - +#endif DiagnosticLoadTemperature(HARDWARE_PID_CONTROL_TYPE__DryerAirTemperature, MillisecGetTemperatures(TEMP_SENSE_ANALOG_DRYER_TEMP1)); DiagnosticLoadTemperature(HARDWARE_PID_CONTROL_TYPE__DryerHeaterMain, MillisecGetTemperatures(TEMP_SENSE_ANALOG_DRYER_TEMP2)); DiagnosticLoadTemperature(HARDWARE_PID_CONTROL_TYPE__DryerHeaterSecondary, MillisecGetTemperatures(TEMP_SENSE_ANALOG_DRYER_TEMP3)); @@ -512,9 +533,9 @@ void DiagnosticOneSecCollection(void) dispensermotorfrequency[i][DiagnosticsIndex] = IdsGetMotorSpeed(i); //dispensermotorfrequency[i][DiagnosticsIndex] = IDS_Dispenser_Data[i].consumedinnanolitter; - dispenserspressure[i][DiagnosticsIndex] = GetDispenserPressure(i); //Read_MidTank_Pressure_Sensor - - MidTankpressure[i][0] = Get_MidTank_Pressure_Sensor(i); + if (DiagnosticMode < Diagnostic_Extended_Mode) + dispenserspressure[i][DiagnosticsIndex] = GetDispenserPressure(i); //Read_MidTank_Pressure_Sensor + MidTankpressure[i][0] = Get_MidTank_Pressure_Sensor(i); } } void Diagnostic100msecCollection(void) @@ -537,31 +558,11 @@ void Diagnostic100msecCollection(void) DiagnosticLoadMotor(WINDER_MOTOR, ThreadGetMotorSpeed (WINDER_MOTOR)); DiagnosticLoadMotor(SCREW_MOTOR, ThreadGetMotorSpeed (SCREW_MOTOR)); } + for (i=0;ibreaksensorlimit = 10; EmbeddedParameters->has_diagnosticcollectionlimit = true; - EmbeddedParameters->diagnosticcollectionlimit = 1; + EmbeddedParameters->diagnosticcollectionlimit = 3; EmbeddedParameters->has_overheatcountlimit = true; EmbeddedParameters->overheatcountlimit = 3; EmbeddedParameters->has_underheatcountlimit = true; diff --git a/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_print.c b/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_print.c index 51498dc04..b879a1404 100644 --- a/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_print.c +++ b/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_print.c @@ -216,6 +216,8 @@ uint32_t InternalId2PT100Id[MAX_INTERNAL_ALARMS] = {TEMP_SENSE_AN_ENCLOSURETEMP1 int32_t InternalOverHeatCounter [MAX_INTERNAL_ALARMS] = {0,0,0}; bool InternalAlarmActive[MAX_INTERNAL_ALARMS] = {false,false,false}; uint32_t ControlIdtoInternalId[MAX_INTERNAL_ALARMS] = {0xFF,0xFF,0xFF}; +EventType InternalTempEventType[MAX_INTERNAL_ALARMS] = {EVENT_TYPE__MACHINE_INTERNAL_OVERTEMPERATURE,EVENT_TYPE__ELECTRICAL_CABINET_OVERTEMPERATURE,EVENT_TYPE__MACHINE_INTERNAL_OVERTEMPERATURE_2}; + uint32_t HeatersTestInternalAlarmsCBFunction(uint32_t IfIndex, uint32_t readValue) { int index=HEATER_TYPE_MAX_HEATERS; @@ -250,7 +252,7 @@ uint32_t HeatersTestInternalAlarmsCBFunction(uint32_t IfIndex, uint32_t readValu InternalAlarmActive[index] = true; ReportWithPackageFilter(HeatersFilter,"Internal Over the max temperature, turned off",__FILE__,index,readValue,RpWarning, 0,0); - AlarmHandlingSetAlarm(EVENT_TYPE__MACHINE_INTERNAL_OVERTEMPERATURE, true); + AlarmHandlingSetAlarm(InternalTempEventType[index], true); } } } @@ -264,7 +266,7 @@ uint32_t HeatersTestInternalAlarmsCBFunction(uint32_t IfIndex, uint32_t readValu InternalAlarmActive[index] = true; ReportWithPackageFilter(HeatersFilter,"Internal Over the max temperature, turned off",__FILE__,index,readValue,RpWarning, 0,0); - AlarmHandlingSetAlarm(EVENT_TYPE__MACHINE_INTERNAL_OVERTEMPERATURE, false); + AlarmHandlingSetAlarm(InternalTempEventType[index], false); } } diff --git a/Software/Embedded_SW/Embedded/Software Release Notes.txt b/Software/Embedded_SW/Embedded/Software Release Notes.txt index 8e4424747..6a00adf48 100644 --- a/Software/Embedded_SW/Embedded/Software Release Notes.txt +++ b/Software/Embedded_SW/Embedded/Software Release Notes.txt @@ -1,17 +1,39 @@ Embedded SW Release note - Version 1.4.6.0 ============================================================= +Common: +logs: better control (filter messages and priorities) + +Drivers: I2C reading task for better handling of slow I2C interactions (head etc) +observe and handle FPGA watchdog reset (report, reinitialize motors) + +Modules: textual names for control calls to help debuggng add midtank and dispenser ink content to diagnostics -*observe and handle FPGA watchdog reset (reinitialize motors) +alarm handling: + 7midtamk overflow, + *fix current alarms, + *consequent actions and job verification, + *critical alarms, + *use alarms file (remote update) +IDS: + *dispenser data, + *improve autofill on job start, + *puller_tension from RML as cleaner speed, + *handle inactive dispenser pressure, + *dispensers PID preparation, + *bring dispensers to first segment pressures before job +Thread: + *real dryer rampup. + *dancers from EEPROM only. + *insure rockers motors voltage value; -alarm handling: midtamk overflow, fix current alarms, consequent actions and job verification, critical alrms. -diagnostics: improved -*heaters: band alarm fixed -IDS: *dispenser data, *improve autofill on job start, *puller_tension from RML as cleaner speed -Thread: *real dryer rampup. dancers from EEPROM only. *insure rockers motors voltage value; -print: *prevent job on open covers (dryer, head) +State machines: +print: *prevent job on open covers (dryer, head) (suspended until new head) +preparation for new head: +I2C scheduling (control, task) +larger number of heaters (heaters module, control, diagnostics, alarms. Embedded SW Release note - Version 1.4.5.104 (alpha 1 ++) ============================================================= -- cgit v1.3.1 From 1b92f30f6dfa27392ffd8460ebeb17c17550db7b Mon Sep 17 00:00:00 2001 From: Shlomo Hecht Date: Wed, 18 Dec 2019 09:00:24 +0200 Subject: version 1.4.6.1 PMR: thread load and power down reporting. fix USB driver large files bug. ids pressure relief. some looking into the thread load sequence --- Software/Embedded_SW/Embedded/.cproject | 4 +- .../Embedded/Common/SWUpdate/FileSystem.c | 25 ++- .../Embedded/Common/SWUpdate/FileSystem.h | 2 + .../Embedded/Communication/CommunicationTask.c | 39 +++-- .../Embedded/Communication/CommunicationTask.h | 2 +- .../Embedded_SW/Embedded/Communication/Container.c | 14 ++ .../Communication/PMR/Common/MessageType.pb-c.c | 28 ++- .../Communication/PMR/Common/MessageType.pb-c.h | 10 +- .../StartThreadLoadingUpdateRequest.pb-c.c | 72 -------- .../StartThreadLoadingUpdateRequest.pb-c.h | 70 -------- .../StartThreadLoadingUpdateResponse.pb-c.c | 92 ---------- .../StartThreadLoadingUpdateResponse.pb-c.h | 73 -------- .../PMR/Diagnostics/ThreadLoadingState.pb-c.c | 63 ------- .../PMR/Diagnostics/ThreadLoadingState.pb-c.h | 56 ------ .../FirmwareUpgrade/VersionFileDescriptor.pb-c.c | 19 +- .../FirmwareUpgrade/VersionFileDescriptor.pb-c.h | 4 +- .../PMR/Power/AbortPowerDownRequest.pb-c.c | 72 ++++++++ .../PMR/Power/AbortPowerDownRequest.pb-c.h | 70 ++++++++ .../PMR/Power/AbortPowerDownResponse.pb-c.c | 72 ++++++++ .../PMR/Power/AbortPowerDownResponse.pb-c.h | 70 ++++++++ .../Communication/PMR/Power/PowerDownState.pb-c.c | 65 +++++++ .../Communication/PMR/Power/PowerDownState.pb-c.h | 57 ++++++ .../PMR/Power/StartPowerDownRequest.pb-c.c | 72 ++++++++ .../PMR/Power/StartPowerDownRequest.pb-c.h | 70 ++++++++ .../PMR/Power/StartPowerDownResponse.pb-c.c | 118 +++++++++++++ .../PMR/Power/StartPowerDownResponse.pb-c.h | 76 ++++++++ .../ContinueThreadLoadingRequest.pb-c.c | 92 ++++++++++ .../ContinueThreadLoadingRequest.pb-c.h | 72 ++++++++ .../ContinueThreadLoadingResponse.pb-c.c | 105 +++++++++++ .../ContinueThreadLoadingResponse.pb-c.h | 74 ++++++++ .../ThreadLoading/StartThreadLoadingRequest.pb-c.c | 72 ++++++++ .../ThreadLoading/StartThreadLoadingRequest.pb-c.h | 70 ++++++++ .../StartThreadLoadingResponse.pb-c.c | 105 +++++++++++ .../StartThreadLoadingResponse.pb-c.h | 74 ++++++++ .../PMR/ThreadLoading/ThreadLoadingState.pb-c.c | 47 +++++ .../PMR/ThreadLoading/ThreadLoadingState.pb-c.h | 48 +++++ .../Embedded/Drivers/Motors/MotorActions.c | 1 + .../Embedded/Drivers/USB_Communication/USBCDCD.c | 96 ++++++---- .../Embedded/Drivers/flash_ram/MCU_E2Prom.c | 21 +++ .../Embedded/Drivers/flash_ram/MCU_E2Prom.h | 5 + .../Embedded/Modules/AlarmHandling/AlarmHandling.c | 1 - .../Embedded/Modules/Control/MillisecTask.c | 1 - .../Embedded_SW/Embedded/Modules/Control/control.c | 2 + .../Embedded/Modules/Diagnostics/Diagnostics.c | 23 ++- .../Embedded_SW/Embedded/Modules/IDS/IDS_maint.c | 5 +- .../Embedded_SW/Embedded/Modules/Thread/Thread.h | 1 + .../Embedded/Modules/Thread/ThreadLoad.c | 195 ++++++++++++++++++++- .../Embedded/Modules/Thread/Thread_ex.h | 3 + .../Embedded/Modules/Thread/Thread_print.c | 34 ++-- .../StateMachines/Initialization/InitSequence.c | 6 +- .../Initialization/PowerOffSequence.c | 147 +++++++++++++++- .../Initialization/PowerOffSequence.h | 4 + 52 files changed, 2068 insertions(+), 551 deletions(-) delete mode 100644 Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/StartThreadLoadingUpdateRequest.pb-c.c delete mode 100644 Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/StartThreadLoadingUpdateRequest.pb-c.h delete mode 100644 Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/StartThreadLoadingUpdateResponse.pb-c.c delete mode 100644 Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/StartThreadLoadingUpdateResponse.pb-c.h delete mode 100644 Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/ThreadLoadingState.pb-c.c delete mode 100644 Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/ThreadLoadingState.pb-c.h create mode 100644 Software/Embedded_SW/Embedded/Communication/PMR/Power/AbortPowerDownRequest.pb-c.c create mode 100644 Software/Embedded_SW/Embedded/Communication/PMR/Power/AbortPowerDownRequest.pb-c.h create mode 100644 Software/Embedded_SW/Embedded/Communication/PMR/Power/AbortPowerDownResponse.pb-c.c create mode 100644 Software/Embedded_SW/Embedded/Communication/PMR/Power/AbortPowerDownResponse.pb-c.h create mode 100644 Software/Embedded_SW/Embedded/Communication/PMR/Power/PowerDownState.pb-c.c create mode 100644 Software/Embedded_SW/Embedded/Communication/PMR/Power/PowerDownState.pb-c.h create mode 100644 Software/Embedded_SW/Embedded/Communication/PMR/Power/StartPowerDownRequest.pb-c.c create mode 100644 Software/Embedded_SW/Embedded/Communication/PMR/Power/StartPowerDownRequest.pb-c.h create mode 100644 Software/Embedded_SW/Embedded/Communication/PMR/Power/StartPowerDownResponse.pb-c.c create mode 100644 Software/Embedded_SW/Embedded/Communication/PMR/Power/StartPowerDownResponse.pb-c.h create mode 100644 Software/Embedded_SW/Embedded/Communication/PMR/ThreadLoading/ContinueThreadLoadingRequest.pb-c.c create mode 100644 Software/Embedded_SW/Embedded/Communication/PMR/ThreadLoading/ContinueThreadLoadingRequest.pb-c.h create mode 100644 Software/Embedded_SW/Embedded/Communication/PMR/ThreadLoading/ContinueThreadLoadingResponse.pb-c.c create mode 100644 Software/Embedded_SW/Embedded/Communication/PMR/ThreadLoading/ContinueThreadLoadingResponse.pb-c.h create mode 100644 Software/Embedded_SW/Embedded/Communication/PMR/ThreadLoading/StartThreadLoadingRequest.pb-c.c create mode 100644 Software/Embedded_SW/Embedded/Communication/PMR/ThreadLoading/StartThreadLoadingRequest.pb-c.h create mode 100644 Software/Embedded_SW/Embedded/Communication/PMR/ThreadLoading/StartThreadLoadingResponse.pb-c.c create mode 100644 Software/Embedded_SW/Embedded/Communication/PMR/ThreadLoading/StartThreadLoadingResponse.pb-c.h create mode 100644 Software/Embedded_SW/Embedded/Communication/PMR/ThreadLoading/ThreadLoadingState.pb-c.c create mode 100644 Software/Embedded_SW/Embedded/Communication/PMR/ThreadLoading/ThreadLoadingState.pb-c.h (limited to 'Software/Embedded_SW/Embedded/Common/SWUpdate/FileSystem.c') diff --git a/Software/Embedded_SW/Embedded/.cproject b/Software/Embedded_SW/Embedded/.cproject index b1d8a3283..7463c7147 100644 --- a/Software/Embedded_SW/Embedded/.cproject +++ b/Software/Embedded_SW/Embedded/.cproject @@ -170,7 +170,7 @@ - + @@ -288,7 +288,7 @@ - +