diff options
| author | Shlomo Hecht <shlomo@twine-s.com> | 2020-11-24 00:24:35 +0200 |
|---|---|---|
| committer | Shlomo Hecht <shlomo@twine-s.com> | 2020-11-24 00:24:35 +0200 |
| commit | 3c167a3414556b0d0d1d463f5345077afc127cfb (patch) | |
| tree | 0b7784bf4f820c8c33829e72b49045c74882f0b0 /Software/Embedded_SW | |
| parent | f03b41ba1a66de2860bc0c273a5a2f662a235d82 (diff) | |
| download | Tango-3c167a3414556b0d0d1d463f5345077afc127cfb.tar.gz Tango-3c167a3414556b0d0d1d463f5345077afc127cfb.zip | |
some 4 winders inmprovements, some RFID trace
Diffstat (limited to 'Software/Embedded_SW')
6 files changed, 44 insertions, 5 deletions
diff --git a/Software/Embedded_SW/Embedded/Common/SWUpdate/FileSystem.c b/Software/Embedded_SW/Embedded/Common/SWUpdate/FileSystem.c index 77efa1cfd..f3d42b01a 100644 --- a/Software/Embedded_SW/Embedded/Common/SWUpdate/FileSystem.c +++ b/Software/Embedded_SW/Embedded/Common/SWUpdate/FileSystem.c @@ -119,7 +119,7 @@ uint32_t FileUploadRequestFunc(MessageContainer* requestContainer) CommRxTaskHandle = Task_self(); CommRxpri = Task_getPri(CommRxTaskHandle); Task_setPri(CommRxTaskHandle, 11); - Report("Task_setPri", __FILE__, __LINE__, 4, RpWarning, (int)CommRxTaskHandle, 0); + Report("Task_setPri", __FILE__, __LINE__, 11, 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) 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 080522d0d..c37bbc437 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 @@ -1136,9 +1136,10 @@ uint8_t Init_Machine_Leds() bool Is_AnyCartridge_presence() { bool IsAnyCartPresent = true; + uint16_t cartridgesPresence = BIT5 | BIT6 | BIT7; #ifndef EVALUATION_BOARD - if(F3_CARTx_PRES_02_Direct & (BIT5 | BIT6 | BIT7)) + if(F3_CARTx_PRES_02_Direct & (cartridgesPresence)==cartridgesPresence) IsAnyCartPresent = false; #endif diff --git a/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/I2C_RFID_Dispenser_Task/I2C_RFID_Disp_Task.c b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/I2C_RFID_Dispenser_Task/I2C_RFID_Disp_Task.c index 79d31393b..5cfb7cf6c 100644 --- a/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/I2C_RFID_Dispenser_Task/I2C_RFID_Disp_Task.c +++ b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/I2C_RFID_Dispenser_Task/I2C_RFID_Disp_Task.c @@ -317,6 +317,7 @@ void DispRFID_Task(UArg arg0, UArg arg1) while(1) { Mailbox_pend(RFID_ReadingMsgQ , &RFID_ReadingMessage, BIOS_WAIT_FOREVER); + Report("RFID task message",__FILE__,__LINE__,RFID_ReadingMessage.messageId ,RpWarning,(int) msec_millisecondCounter,0); /* select the correct I2C bus */ if (RFID_ReadingMessage.messageId < RFID_End) @@ -428,6 +429,8 @@ void DispRFID_Task(UArg arg0, UArg arg1) default: break; } + Report("RFID message end",__FILE__,__LINE__,RFID_ReadingMessage.messageId ,RpWarning,(int) msec_millisecondCounter,0); + } } 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 ef38f2b24..33f154492 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 @@ -762,7 +762,7 @@ uint32_t RFIDTagComm_StateMachine(RFID_READER_ID readerID, StateMachineMode Mode - }while(RFIDRetValue != SUCCESS); + }while((RFIDRetValue != SUCCESS)&&(counterd_dis<10)); if(RFIDRetValue == SUCCESS) { @@ -775,6 +775,7 @@ uint32_t RFIDTagComm_StateMachine(RFID_READER_ID readerID, StateMachineMode Mode { follow_stages[TagStage[readerID]] = ERROR; RFID_Status_Words[readerID].errors.TagDiscovery = S_FAILED; + TagStage[readerID] = Tag_Idle; } delayms(1); if(Mode == OneStep) diff --git a/Software/Embedded_SW/Embedded/Main.c b/Software/Embedded_SW/Embedded/Main.c index 6c40b7916..3485a1de2 100644 --- a/Software/Embedded_SW/Embedded/Main.c +++ b/Software/Embedded_SW/Embedded/Main.c @@ -25,6 +25,7 @@ #include "drivers/Motors/Motor.h" #include "Communication/CommunicationTask.h" +#include "Drivers/I2C_Communication/Head_Card/IO_Ports/Head_IO.h" #include <xdc/runtime/Error.h> #include <xdc/runtime/System.h> @@ -148,6 +149,10 @@ Void errHook(Error_Block *eb) STATUS_GREEN_LED_OFF; ACTIVITY_GREEN_LED_OFF; COMM_GREEN_LED_OFF; + Head_I2C_EXP1_0x40.ushort = 0; + Head_I2C_EXP2_0x42.ushort = 0; + Head_Write_IO_Reg(0x40,LOW_AND_HIGH); + Head_Write_IO_Reg(0x42,LOW); STATUS_RED_LED_ON; ACTIVITY_RED_LED_ON; @@ -335,7 +340,8 @@ int main(void) I2C_DispRFIDTask_Init();//I2C Task for dispensers & RFID #if defined(USE_RFID_LOGIC) || defined(USE_RFID_STUB) - Trigger_RFID_Init(); //Init_IFS();//must be done after FPGA_Init + //Trigger_RFID_Init(); //Init_IFS();//must be done after FPGA_Init + Init_IFS(); #else Check_IFS_Availability(); #endif diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c index 8ecb3f404..011488c49 100644 --- a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c +++ b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c @@ -221,6 +221,7 @@ uint32_t Winder_Prepare(void *JobDetails) { //REPORT_MSG(LIMIT, "Winder_Prepare at limit"); Winder_PrepareStage2(0,0); + Screw_wait_counter=1; } else { @@ -229,15 +230,42 @@ uint32_t Winder_Prepare(void *JobDetails) //REPORT_MSG(MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_SCREW].directionthreadwize, "Winder_Prepare move to limit"); Screw_wait_counter=1; status = MotorMovetoLimitSwitch (HARDWARE_MOTOR_TYPE__MOTO_SCREW,MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_SCREW].directionthreadwize, ScrewSpeed, GPI_LS_SCREW_RIGHT, Winder_PrepareStage2,2000); + } #ifdef FOUR_WINDERS + if (FPGA_Read_limit_Switches(GPI_LS_SPARE2_2)==LIMIT) + { + Winder_PrepareStage2(0,0); + Screw_wait_counter++; + } + else + { + Winder_ScrewHoming = true; Screw_wait_counter++; status = MotorMovetoLimitSwitch (SCREW_2_Motor,MotorsCfg[SCREW_2_Motor].directionthreadwize, ScrewSpeed, GPI_LS_SPARE2_2, Winder_PrepareStage2,2000); + } + if (FPGA_Read_limit_Switches(GPI_LS_SPARE1_2)==LIMIT) + { + Winder_PrepareStage2(0,0); + Screw_wait_counter++; + } + else + { + Winder_ScrewHoming = true; Screw_wait_counter++; status = MotorMovetoLimitSwitch (SCREW_3_Motor,MotorsCfg[SCREW_3_Motor].directionthreadwize, ScrewSpeed, GPI_LS_SPARE1_2, Winder_PrepareStage2,2000); + } + if (FPGA_Read_limit_Switches(GPI_LS_RDANCER_UP)==LIMIT) + { + Winder_PrepareStage2(0,0); + Screw_wait_counter++; + } + else + { + Winder_ScrewHoming = true; Screw_wait_counter++; status = MotorMovetoLimitSwitch (SCREW_4_Motor,MotorsCfg[SCREW_4_Motor].directionthreadwize, ScrewSpeed, GPI_LS_RDANCER_UP, Winder_PrepareStage2,2000); -#endif } +#endif return status; } /* |
