diff options
| author | Shlomo Hecht <shlomo@twine-s.com> | 2019-07-24 14:03:35 +0300 |
|---|---|---|
| committer | Shlomo Hecht <shlomo@twine-s.com> | 2019-07-24 14:03:35 +0300 |
| commit | 1a4e2e8a731c7d4c6150de73b36b7c40d6422cd7 (patch) | |
| tree | a211d3fdbe6dc8e98a14a50b4d7d2161bbc91a4f /Software/Embedded_SW | |
| parent | 17a32af2a2500d6da0e59d3085ddfd43d0ee5270 (diff) | |
| download | Tango-1a4e2e8a731c7d4c6150de73b36b7c40d6422cd7.tar.gz Tango-1a4e2e8a731c7d4c6150de73b36b7c40d6422cd7.zip | |
Version 1.4.2.5 firmware upgrade works, improved thread load. (works????)
Diffstat (limited to 'Software/Embedded_SW')
9 files changed, 29 insertions, 32 deletions
diff --git a/Software/Embedded_SW/Embedded/Common/SWUpdate/FileSystem.c b/Software/Embedded_SW/Embedded/Common/SWUpdate/FileSystem.c index 05b118c90..1e02283e0 100644 --- a/Software/Embedded_SW/Embedded/Common/SWUpdate/FileSystem.c +++ b/Software/Embedded_SW/Embedded/Common/SWUpdate/FileSystem.c @@ -53,7 +53,7 @@ FIL *UploadFileHandle = 0; //the system supports a single active file FIL *DownloadFileHandle = 0; //the system supports a single active file char FileHandleChar[5]; char ErrorMsg[100]; -#define MAX_CHUNK_LENGTH 4000 +#define MAX_CHUNK_LENGTH 5500 int32_t FileLength = 0; int32_t FileReceivedLength = 0; int32_t FileSentLength = 0; diff --git a/Software/Embedded_SW/Embedded/Common/SWUpdate/FirmwareUpgrade.c b/Software/Embedded_SW/Embedded/Common/SWUpdate/FirmwareUpgrade.c index dabd5ff44..139b452dc 100644 --- a/Software/Embedded_SW/Embedded/Common/SWUpdate/FirmwareUpgrade.c +++ b/Software/Embedded_SW/Embedded/Common/SWUpdate/FirmwareUpgrade.c @@ -71,6 +71,7 @@ uint32_t ActivateVersionCallBackFunction(uint32_t IfIndex, uint32_t BusyFlag) if (Reboot == true) { + LOG_ERROR(255,"Update successful, Rebooting in 5 seconds"); Task_sleep (120000000*5); Power_Reset(); } @@ -186,10 +187,6 @@ uint32_t ActivateVersionRequestFunc(MessageContainer* requestContainer) activate_version_request__free_unpacked(request,NULL); SendChars(container_buffer, container_size); - if (Reboot == true) - { - Power_Reset(); - } return OK; } diff --git a/Software/Embedded_SW/Embedded/Common/SWUpdate/FirmwareUpgrade.h b/Software/Embedded_SW/Embedded/Common/SWUpdate/FirmwareUpgrade.h index 1d11a84b6..2b0a9bff9 100644 --- a/Software/Embedded_SW/Embedded/Common/SWUpdate/FirmwareUpgrade.h +++ b/Software/Embedded_SW/Embedded/Common/SWUpdate/FirmwareUpgrade.h @@ -9,6 +9,7 @@ #define COMMON_SWUPDATE_FIRMWAREUPGRADE_H_ extern int CurrentFileSize; +extern int CurrentRunningFile; uint32_t ActivateVersionRequestFunc(MessageContainer* requestContainer); uint32_t ValidateVersionRequestFunc(MessageContainer* requestContainer); 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 9c02e609e..5b0944ab9 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,2,5}; +TangoVersion_t _gTangoVersion = {1,4,2,6}; #define BUILD_DATE __DATE__ char Dat[50] = BUILD_DATE; char _gTangoName [MAX_STRING_LEN] = "Tango01 ";//d diff --git a/Software/Embedded_SW/Embedded/Drivers/FPGA/Full_Vme/FPGA_Programming_Up.c b/Software/Embedded_SW/Embedded/Drivers/FPGA/Full_Vme/FPGA_Programming_Up.c index 931044f82..11ba12c32 100644 --- a/Software/Embedded_SW/Embedded/Drivers/FPGA/Full_Vme/FPGA_Programming_Up.c +++ b/Software/Embedded_SW/Embedded/Drivers/FPGA/Full_Vme/FPGA_Programming_Up.c @@ -96,6 +96,7 @@ FRESULT FPGA_Programming_Up(FPGA_ID FPGA_Id, char * FullPath, bool IncludeReboot Report(FullPath,__FILE__,__LINE__,CurrentFileSize,RpWarning,0,0); fresult = main_vme(); + CurrentRunningFile++; } @@ -158,6 +159,8 @@ void FPGALoadTask(UArg arg0, UArg arg1) case OneFPGALoad: //ControlStop(); //MillisecStop(); + Report(FPGALoadMessage.FullPath,__FILE__,__LINE__,CurrentRunningFile,RpWarning,0,0); + FPGA_Programming_Up(FPGALoadMessage.FPGA_Id,FPGALoadMessage.FullPath,FPGALoadMessage.IncludeReboot); //ControlStart(); //MillisecStart(); diff --git a/Software/Embedded_SW/Embedded/Drivers/Motors/MotorActions.c b/Software/Embedded_SW/Embedded/Drivers/Motors/MotorActions.c index 911b31eed..83e041591 100644 --- a/Software/Embedded_SW/Embedded/Drivers/Motors/MotorActions.c +++ b/Software/Embedded_SW/Embedded/Drivers/Motors/MotorActions.c @@ -343,7 +343,7 @@ uint32_t MotorMovetoEncoderPosition (TimerMotors_t MotorId, callback_fptr callb } MotorSetDirection( MotorId, direction); - MotorSetSpeed (MotorId, 5); + MotorSetSpeed (MotorId, 15); MotorControlId[MotorId] = AddControlCallback( MotorMoveToDrierPositionCallBackFunction, eTenMillisecond,Control_Read_Dryer_Position,(IfTypeMotors*0x100+MotorId), MotorId, 0 ); MotorControlCallback[MotorId] = MotorMoveToDrierPositionCallBackFunction; return MotorControlId[MotorId]; diff --git a/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c b/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c index c1fcd4030..e3955793d 100644 --- a/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c +++ b/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c @@ -426,10 +426,8 @@ uint32_t MillisecLoop(uint32_t tick) { #ifdef Use_Head_Card HeadADCPT100_SendReadDataCommand(Sensor_i); - #else - TemperatureSensorReadFromFPGA_Res(Sensor_i); //got the data from the FPGA #endif - + TemperatureSensorReadFromFPGA_Res(Sensor_i); //got the data from the FPGA PT100Data[Sensor_i].WaitForData = false; PT100Data[Sensor_i].SyncRequired = true; if (PT100Data[Sensor_i].Callback) @@ -440,9 +438,8 @@ uint32_t MillisecLoop(uint32_t tick) { #ifdef Use_Head_Card HeadADCPT100_StartSync(Sensor_i); - #else - TemperatureSensorSync(Sensor_i); #endif + TemperatureSensorSync(Sensor_i); PT100Data[Sensor_i].SyncRequired = false; PT100Activity--; diff --git a/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_init.c b/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_init.c index faf6022d6..350236708 100644 --- a/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_init.c +++ b/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_init.c @@ -63,11 +63,10 @@ uint32_t Heaters_Init(void) int i; //ROM_TimerDisable(Heater_timerBase, TIMER_A); - #ifdef Use_Head_Card - HeadADCPT100_SensorInitConfig(); - #else - FPGA_SensorInitConfig(); - #endif +#ifdef Use_Head_Card + HeadADCPT100_SensorInitConfig(); +#endif + FPGA_SensorInitConfig(); memset(HeaterControl,0,sizeof(HeaterControl)); for (i = 0;i<MAX_HEATERS_NUM; i++) diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c b/Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c index d2f6170cf..837221274 100644 --- a/Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c +++ b/Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c @@ -146,7 +146,7 @@ Control_Voltage_To_Blower(BlowerCfg.voltage-500); Control_Dryer_Fan(STOP,75);//use START or STOP, 0 - 100% LoadStages++; - //ThreadLoadStateMachine(LoadStages); + ThreadLoadStateMachine(LoadStages); } return OK; } @@ -167,7 +167,7 @@ //storeLoadArmParameters(); SetMotHome(HARDWARE_MOTOR_TYPE__MOTO_DRYER_LOADARM); //set this point as the spool home LoadStages++; - //ThreadLoadStateMachine(LoadStages); + ThreadLoadStateMachine(LoadStages); } return OK; } @@ -198,7 +198,7 @@ LoadStages++; SetMotHome(HARDWARE_MOTOR_TYPE__MOTO_DRYER_LOADARM); //set this point as the spool home - //ThreadLoadStateMachine(LoadStages); + ThreadLoadStateMachine(LoadStages); return OK; } uint32_t Thread_Load_Set_Load_Arm_To_Start_Position(void) @@ -258,7 +258,7 @@ } if (LoadStages != THREAD_LOAD_INITIAL_TENSION) //on this stage we should wait for user call { - //ThreadLoadStateMachine(LoadStages); + ThreadLoadStateMachine(LoadStages); } } } @@ -379,7 +379,7 @@ { Control_Dryer_Fan(START,75);//use START or STOP, 0 - 100% LoadStages++; - //ThreadLoadStateMachine(LoadStages); + ThreadLoadStateMachine(LoadStages); } return OK; } @@ -394,14 +394,7 @@ uint32_t Thread_Load_Dryer_MovetoEncoderPosition_Callback(uint32_t MotorId, uint32_t ReadValue) { - if(ControlId != 0xFF) - { - MotorStop(ThreadMotorIdToMotorId[FEEDER_MOTOR],Hard_Hiz); - RemoveControlCallback(ControlId, ThreadLoadControlCBFunction ); - MotorSetMaxSpeed (HARDWARE_MOTOR_TYPE__MOTO_DRYER_LOADARM, MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_DRYER_LOADARM].pulseperround); - - ControlId = 0xFF; - } + MotorSetMaxSpeed (HARDWARE_MOTOR_TYPE__MOTO_DRYER_LOADARM, 200); if (CallbackCounter) { CallbackCounter--; @@ -410,7 +403,7 @@ LoadStages++; if (LoadStages != THREAD_LOAD_INITIAL_TENSION) //on this satge we should wait for user call { - //ThreadLoadStateMachine(LoadStages); + ThreadLoadStateMachine(LoadStages); } } } @@ -421,6 +414,12 @@ uint32_t Thread_Load_Dryer_Loading_Callback(uint32_t MotorId, uint32_t ReadValue) { Report("Thread Load State Machine Callback.",__FILE__,__LINE__,LoadStages,RpMessage,NumberOfDrierLoaderCycles,0); + if(ControlId != 0xFF) + { + MotorStop(ThreadMotorIdToMotorId[FEEDER_MOTOR],Hard_Hiz); + RemoveControlCallback(ControlId, ThreadLoadControlCBFunction ); + ControlId = 0xFF; + } //REPORT_MSG(MotorId, "Thread_Load_Dryer_Loading_Callback Motor Id"); MotorMovetoEncoderPosition(HARDWARE_MOTOR_TYPE__MOTO_DRYER_LOADARM,Thread_Load_Dryer_MovetoEncoderPosition_Callback,10000); return OK; @@ -477,7 +476,7 @@ ControlId = 0xFF; ThreadAbortJoggingFunc(); LoadStages++; - //ThreadLoadStateMachine(LoadStages); + ThreadLoadStateMachine(LoadStages); return OK; } uint32_t Thread_Load_Jog_Thread(void) @@ -632,6 +631,7 @@ Thread_Load_Jog_Thread(); break; case THREAD_LOAD_END: + LoadStages = THREAD_LOAD_END; Thread_Load_End(); break; default: |
