diff options
| author | Shlomo Hecht <shlomo@twine-s.com> | 2020-12-21 12:40:15 +0200 |
|---|---|---|
| committer | Shlomo Hecht <shlomo@twine-s.com> | 2020-12-21 12:40:15 +0200 |
| commit | 60da85ec2924da6f8681170b94f9286d13538672 (patch) | |
| tree | 81193456ed9bdffa102e48667d1f6a240147462c /Software/Embedded_SW/Embedded | |
| parent | 3f3d743a3f93c17571b681df94d4d9d1848614fa (diff) | |
| download | Tango-60da85ec2924da6f8681170b94f9286d13538672.tar.gz Tango-60da85ec2924da6f8681170b94f9286d13538672.zip | |
comments removed, brushstop size from job file
Diffstat (limited to 'Software/Embedded_SW/Embedded')
5 files changed, 55 insertions, 38 deletions
diff --git a/Software/Embedded_SW/Embedded/Common/SWUpdate/FileSystem.c b/Software/Embedded_SW/Embedded/Common/SWUpdate/FileSystem.c index 17c1f164b..7b7d4c3c2 100644 --- a/Software/Embedded_SW/Embedded/Common/SWUpdate/FileSystem.c +++ b/Software/Embedded_SW/Embedded/Common/SWUpdate/FileSystem.c @@ -646,11 +646,11 @@ uint32_t GetFilesRequestFunc(MessageContainer* requestContainer) GetFilesResponse response = GET_FILES_RESPONSE__INIT; //struct tm RTC_time; - #define MAX_NUM_OF_FILES 20 + #define MAX_NUM_OF_FILES 40 DIR dir; FILINFO* fno[MAX_NUM_OF_FILES]; char FullPath[MAX_NUM_OF_FILES][60]; - int i,NumOfFiles = 0; + int i,NumOfFiles = 0, ListedFiles = 0; FRESULT Fresult = FR_OK; FileInfo **FilesInfo = (FileInfo**)my_malloc(sizeof(FileInfo *)*(MAX_NUM_OF_FILES)); FileInfo Data[MAX_NUM_OF_FILES]; @@ -699,26 +699,33 @@ uint32_t GetFilesRequestFunc(MessageContainer* requestContainer) { for (i = 0;i < NumOfFiles;i++) { - file_info__init(&Data[i]); - FilesInfo[i] = &Data[i]; - Data[i].has_attribute = true; - Data[i].attribute = fno[i]->fattrib; - Data[i].name = fno[i]->fname; - Data[i].has_length = true; - Data[i].length = fno[i]->fsize; - Data[i].has_lastmodifieddate = true; - Data[i].lastmodifieddate = fno[i]->fdate; - Data[i].has_lastmodifiedtime = true; - Data[i].lastmodifiedtime = fno[i]->ftime; - - if (i==0) - usnprintf(&FullPath[i], 50, "%s", request->path); + if (i==0) + usnprintf(&FullPath[ListedFiles], 50, "%s", request->path); + else + if (strlen(request->path)==1) //info under the root + usnprintf(&FullPath[ListedFiles], 50, "%s%s", request->path, fno[i]->fname); + else + usnprintf(&FullPath[ListedFiles], 50, "%s%s%s", request->path,"/", fno[i]->fname); + if (fno[i]->fattrib != 0xFF) //garbage + { + file_info__init(&Data[ListedFiles]); + FilesInfo[ListedFiles] = &Data[ListedFiles]; + Data[ListedFiles].has_attribute = true; + Data[ListedFiles].attribute = fno[i]->fattrib; + Data[ListedFiles].name = fno[i]->fname; + Data[ListedFiles].has_length = true; + Data[ListedFiles].length = fno[i]->fsize; + Data[ListedFiles].has_lastmodifieddate = true; + Data[ListedFiles].lastmodifieddate = fno[i]->fdate; + Data[ListedFiles].has_lastmodifiedtime = true; + Data[ListedFiles].lastmodifiedtime = fno[i]->ftime; + Data[ListedFiles].fullpath = &FullPath[i][0]; + ListedFiles++; + } else - if (strlen(request->path)==1) //info under the root - usnprintf(&FullPath[i], 50, "%s%s", request->path, fno[i]->fname); - else - usnprintf(&FullPath[i], 50, "%s%s%s", request->path,"/", fno[i]->fname); - Data[i].fullpath = &FullPath[i][0]; + { + f_unlink(Data[ListedFiles].fullpath); + } /*RTC_time.tm_year=(fno[i]->fdate>>9)+1980;//populate the time struct (FAT start==1980, RTC.year==0) RTC_time.tm_mon=(fno[i]->fdate>>5)&0x000F; RTC_time.tm_mday=fno[i]->fdate&0x001F; @@ -728,7 +735,7 @@ uint32_t GetFilesRequestFunc(MessageContainer* requestContainer) } - response.n_items = NumOfFiles; + response.n_items = ListedFiles; response.items = FilesInfo; } else diff --git a/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/RFID_NFC/NFC.c b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/RFID_NFC/NFC.c index 33f154492..1e989d4d1 100644 --- a/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/RFID_NFC/NFC.c +++ b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/RFID_NFC/NFC.c @@ -118,15 +118,14 @@ RFID_RETURN_CODE RFID_Status = 0; uint8_t Connect_to_RFID_Reder(uint8_t readerID)//2 { RFID_RETURN_CODE RFIDRetValue; - bool isTagValid; uint8_t Status = OK; - - +/* + bool isTagValid; uint32_t newPwd; uint32_t newPACK; uint32_t counter; - int PwdRetVal; +*/ static uint32_t nop = 0; RFID_StartDiscovery(readerID); @@ -187,7 +186,7 @@ NFC_Tag NFC_Tag_U[Max_Readers];//read with updates RFID_RETURN_CODE TagWriteData(RFID_READER_ID readerID) { - uint8_t index = 0; + //uint8_t index = 0; uint32_t dummy = 0; uint32_t Tuint32 = 0; //uint16_t Tuint16 = 0; @@ -375,7 +374,7 @@ RFID_RETURN_CODE TagWriteData(RFID_READER_ID readerID) RFIDRetValue = WriteValue( readerID, &tagInfo, tagMemory, 31, Tuint32 ); - return SUCCESS; + return RFIDRetValue; } diff --git a/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/RFID_NFC/logi-tag/LT_RFID.c b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/RFID_NFC/logi-tag/LT_RFID.c index 7035d172e..6d6425172 100644 --- a/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/RFID_NFC/logi-tag/LT_RFID.c +++ b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/RFID_NFC/logi-tag/LT_RFID.c @@ -1209,13 +1209,13 @@ uint32_t crc_ccitt_update(unsigned char * buf, int len) } -void RFID_Test() +RFID_RETURN_CODE 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 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; @@ -1250,12 +1250,12 @@ 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 startingBlock = 0x04; uint8_t pwdAddr = 0xE5; -uint8_t tagMemory[1024]; uint16_t succeededWriteSize = 0; uint16_t succeededReadSize = 0; -bool firstTime = true; +bool firstTime = true;*/ +uint8_t tagMemory[1024]; uint32_t dummy = 0; RFID_RETURN_CODE RFIDRetValue; @@ -1421,6 +1421,6 @@ while(1) } //---------------------------------------------------------------------------- - + return RFIDRetValue; } diff --git a/Software/Embedded_SW/Embedded/Modules/IDS/IDS_print.c b/Software/Embedded_SW/Embedded/Modules/IDS/IDS_print.c index fb7529b46..2d371595c 100644 --- a/Software/Embedded_SW/Embedded/Modules/IDS/IDS_print.c +++ b/Software/Embedded_SW/Embedded/Modules/IDS/IDS_print.c @@ -1523,7 +1523,7 @@ uint32_t IDSPreSegmentState(void *SegmentDetails, int SegmentId) //******************************************************************************************************************** uint32_t SegmentNumOfBrushStops = 0; -double BrushStopTime = 0; +double BrushStopTime = 0,BrushStopOffset = 0,PrevBrushStopOffset = 0; uint32_t BrushStopCounter = 0; uint32_t BrushStopStartTime = 0,BrushStopLength = 0; @@ -1532,7 +1532,16 @@ void IDS_StartBrushStop(int n_dispensers, JobDispenser** Dispensers) int Dispenser_i,DispenserId; TimerMotors_t HW_Motor_Id; double segmentfirst_speed; + double tempBrushStopTime = 0; //ReportWithPackageFilter(IDSFilter,"IDS_StartBrushStop",__FILE__,__LINE__,(int)JobBrushStopId,RpWarning,(int)0,0); + PrevBrushStopOffset = BrushStopOffset; + BrushStopOffset = FileBrushStop->offsetmeters; + tempBrushStopTime = (BrushStopOffset-PrevBrushStopOffset); //length in meters + tempBrushStopTime = ((tempBrushStopTime*100)/dyeingspeed);//brushstop in seconds (length in cetimeters/ centimeters per second) + tempBrushStopTime *= 1000; // milliseconds + if (tempBrushStopTime > 100) + BrushStopTime = tempBrushStopTime; + ReportWithPackageFilter(IDSFilter,"IDS_StartBrushStop offset", __FILE__, tempBrushStopTime,(int)(BrushStopOffset*100), RpWarning,(int)(PrevBrushStopOffset*100), 0); if (n_dispensers) { @@ -1611,7 +1620,7 @@ void IDS_StartBrushStop(int n_dispensers, JobDispenser** Dispensers) //usnprintf(IdMessage, 80,"IDS_StartBrushStop %d/%d K %d,C %d,M %d,Y %d,TI %d",FileBrushStop->index,SegmentNumOfBrushStops,CurrentDispenserSpeed[0], // CurrentDispenserSpeed[1],CurrentDispenserSpeed[2],CurrentDispenserSpeed[3],CurrentDispenserSpeed[4]); if (BuildIdsJobPrintString(IdMessage,"IDS_StartBrushStop ",FileBrushStop->index)) - ReportWithPackageFilter(IDSFilter,IdMessage, __FILE__, SegmentNumOfBrushStops, FileBrushStop->index, RpWarning,(int)FileBrushStop->offsetmeters, 0); + ReportWithPackageFilter(IDSFilter,IdMessage, __FILE__, SegmentNumOfBrushStops, FileBrushStop->index, RpWarning,(int)(FileBrushStop->offsetmeters*100), 0); } uint32_t IDSBrushStopRestartCallback(uint32_t IfIndex, uint32_t readValue) @@ -1714,6 +1723,8 @@ uint32_t IDSSegmentState(void *SegmentDetails, int SegmentId) if (CurrentDispenserSpeed[CLEANER_DISPENSER]>0) IDS_Cleaning_Stop_Cleaning_Solution(NULL); #endif + BrushStopOffset = 0; + PrevBrushStopOffset = 0; SegmentNumOfBrushStops = Segment->n_brushstops; BrushStopTime = Segment->length*1000/(double)SegmentNumOfBrushStops; //brushstop in meters //brushstop in millisecond BrushStopTime = ((BrushStopTime*100)/dyeingspeed);//brushstop in seconds diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c index 8b72c1a30..87ad612ba 100644 --- a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c +++ b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c @@ -581,7 +581,7 @@ uint32_t ThreadControlCBFunction(uint32_t IfIndex, uint32_t ReadValue) } index = IfIndex&0xFF; - if (index == POOLER_MOTOR) //move break sensor handling up to ensure handling even if tiing control is > 1 msec + if (index == WINDER_MOTOR) //move break sensor handling up to ensure handling even if tiing control is > 1 msec { if (checkBreakSensor(index) == ERROR) return OK; |
