diff options
| author | Shlomo Hecht <shlomo@twine-s.com> | 2020-10-19 17:15:51 +0300 |
|---|---|---|
| committer | Shlomo Hecht <shlomo@twine-s.com> | 2020-10-19 17:15:51 +0300 |
| commit | d158d2e52229c221d1d475ced6b1ff048d6519ad (patch) | |
| tree | acd1b09d50ce9c6356b17fe73a02ceec66279178 /Software/Embedded_SW/Embedded | |
| parent | b732167cbc51f0b19447d67687af5c514cf4f65a (diff) | |
| download | Tango-d158d2e52229c221d1d475ced6b1ff048d6519ad.tar.gz Tango-d158d2e52229c221d1d475ced6b1ff048d6519ad.zip | |
change RAM FLASH SIZE and location. some progress on the machine
Diffstat (limited to 'Software/Embedded_SW/Embedded')
11 files changed, 50 insertions, 74 deletions
diff --git a/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/I2C_Task.c b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/I2C_Task.c index 29c44eac1..6a902f89d 100644 --- a/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/I2C_Task.c +++ b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/I2C_Task.c @@ -616,7 +616,7 @@ void I2C_ReadingTask_Init(void) I2C_ReadingMsgQ = Mailbox_create(sizeof(I2C_ReadingMessageStruc), 40, NULL,NULL); Task_Params_init(&taskParams); taskParams.instance->name = "I2C_Reading"; - taskParams.priority = 8; + taskParams.priority = 17; taskParams.stackSize = 2048; I2C_Task_Handle = Task_create((Task_FuncPtr)I2C_ReadingTask, &taskParams, NULL); } diff --git a/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/WHS_Card/D_MAX11614_ADC/WHS_MAX11614_A2D.c b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/WHS_Card/D_MAX11614_ADC/WHS_MAX11614_A2D.c index fff11f493..26c3d0b4f 100644 --- a/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/WHS_Card/D_MAX11614_ADC/WHS_MAX11614_A2D.c +++ b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/WHS_Card/D_MAX11614_ADC/WHS_MAX11614_A2D.c @@ -353,44 +353,10 @@ bool SetWriteDisplayView(WHS_Left_Display_View view ) double GetWHSAirFlow(uint8_t OR_Id) { - uint16_t value = 0; double Q_value = 0 ; - switch (OR_Id) - { - case DRIER_FLOW_METER: - - /*if (display_view == AVERAGE) - { - Q_value = get_average_Q(DRIER_FLOW_METER); - } - else // CURRENT - { - //get_orf_3(&value); - //Q_value = get_Q(value-orf3V0Value); - Q_value = get_CurrentQ(DRIER_FLOW_METER); - }*/ - Q_value = get_CurrentQ(DRIER_FLOW_METER); - //Q_value = get_average_Q(HEAD_FLOW_METER); - break; - case NU_FLOW_METER: - get_orf_2(&value); - break; - case HEAD_FLOW_METER: - /*if (display_view == AVERAGE) - { - Q_value = get_average_Q(HEAD_FLOW_METER); - } - else //CURRENT - { - //get_orf_1(&value); - Q_value = get_CurrentQ(HEAD_FLOW_METER); - }*/ - Q_value = get_CurrentQ(HEAD_FLOW_METER); - break; - default: - break; - } - ReportWithPackageFilter(WasteFilter,"------------ GetWHSAirFlow -----------------",__FILE__, OR_Id, (int)value, RpWarning, (int) Orf_zero_value[OR_Id], 0); + assert (OR_Id<=DRIER_FLOW_METER); + Q_value = get_CurrentQ(OR_Id); + ReportWithPackageFilter(WasteFilter,"------------ GetWHSAirFlow -----------------",__FILE__, OR_Id, (int)Q_value, RpWarning, (int) Orf_zero_value[OR_Id], 0); return Q_value ; } diff --git a/Software/Embedded_SW/Embedded/Drivers/flash_ram/FlashProgram.c b/Software/Embedded_SW/Embedded/Drivers/flash_ram/FlashProgram.c index c1a5bcc9f..10f65db1d 100644 --- a/Software/Embedded_SW/Embedded/Drivers/flash_ram/FlashProgram.c +++ b/Software/Embedded_SW/Embedded/Drivers/flash_ram/FlashProgram.c @@ -131,10 +131,19 @@ uint32_t ReadAppAndProgram(uint32_t ui32FlashStart,uint32_t ui32FileSize,void* b // return(1); } +int base_flashErased = false; uint32_t EraseFlashSection(uint32_t ui32FlashStart) { volatile uint32_t ui32Idx = ui32FlashStart; uint32_t status; + if (ui32FlashStart<GENHWCFG_SECTION_FLASH) + { + if (base_flashErased == true) + return ERROR; + else + base_flashErased = true; //once in a run + + } #ifdef FLASH_DEBUG Address[RxIndex] = ui32FlashStart; Size[RxIndex] = ui32FileSize; diff --git a/Software/Embedded_SW/Embedded/Drivers/flash_ram/FlashProgram.h b/Software/Embedded_SW/Embedded/Drivers/flash_ram/FlashProgram.h index 983c3954c..655a980db 100644 --- a/Software/Embedded_SW/Embedded/Drivers/flash_ram/FlashProgram.h +++ b/Software/Embedded_SW/Embedded/Drivers/flash_ram/FlashProgram.h @@ -8,23 +8,23 @@ #ifndef DRIVERS_FLASH_RAM_FLASHPROGRAM_H_ #define DRIVERS_FLASH_RAM_FLASHPROGRAM_H_ -#define FLASH_RAM_BASE 0x000F0000 +#define FLASH_RAM_BASE 0x000F8000 -#define EMBEDDED_PARAMETERS_SECTION_FLASH (FLASH_RAM_BASE + 0X0000 ) -#define PROCESS_PARAMETERS_SECTION_FLASH (FLASH_RAM_BASE + 0X0000 ) +#define EMBEDDED_PARAMETERS_SECTION_FLASH (FLASH_RAM_BASE + 0X0000 ) //512 +#define PROCESS_PARAMETERS_SECTION_FLASH (FLASH_RAM_BASE + 0X0000 )//512 #define DANCERS_SECTION_FLASH (FLASH_RAM_BASE + 0X0000) -#define DISPENSERS_SECTION_FLASH (FLASH_RAM_BASE + 0X4000) -#define ALARM_SECTION_FLASH (FLASH_RAM_BASE + 0XC000 ) -#define GENHWCFG_SECTION_FLASH (FLASH_RAM_BASE + 0X8000) +#define DISPENSERS_SECTION_FLASH (FLASH_RAM_BASE + 0X0000) +#define GENHWCFG_SECTION_FLASH (FLASH_RAM_BASE + 0X2000) +#define ALARM_SECTION_FLASH (FLASH_RAM_BASE + 0X4000 ) #define EMBEDDED_PARAMETERS_MAP_IN_FLASH (FLASH_RAM_BASE + 0X0000 ) -#define PROCESS_PARAMETERS_MAP_IN_FLASH (FLASH_RAM_BASE + 0X0400 ) -#define DANCERS_MAP_IN_FLASH (FLASH_RAM_BASE + 0X0500) -#define DISPENSERS_MAP_IN_FLASH (FLASH_RAM_BASE + 0X4000) -#define ALARM_MAP_IN_FLASH (FLASH_RAM_BASE + 0XC000 ) -#define GENHWCFG_MAP_IN_FLASH (FLASH_RAM_BASE + 0X8000) +#define PROCESS_PARAMETERS_MAP_IN_FLASH (FLASH_RAM_BASE + 0X0200 ) +#define DANCERS_MAP_IN_FLASH (FLASH_RAM_BASE + 0X0400) +#define DISPENSERS_MAP_IN_FLASH (FLASH_RAM_BASE + 0X500) +#define GENHWCFG_MAP_IN_FLASH (FLASH_RAM_BASE + 0X2000) +#define ALARM_MAP_IN_FLASH (FLASH_RAM_BASE + 0X4000 ) -#define FLASH_SIZE 0X10000 +#define FLASH_SIZE 0X8000 //***************************************************************************** // diff --git a/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c b/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c index 2428ef465..62a52bcf3 100644 --- a/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c +++ b/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c @@ -593,7 +593,7 @@ void setRapidPressureRead(bool value) if (GetDiagnosticMode() == Diagnostic_Extreme_Mode) RapidPressureRead = true; } -bool Shinko_Read = true; +bool Shinko_Read = false; uint16_t PumpCounter = 0; uint16_t realtimetest[101]; uint32_t MillisecLowLoop(uint32_t tick) @@ -727,12 +727,12 @@ uint32_t MillisecLowLoop(uint32_t tick) WHS_Shinko_Communication(R_SETUP); } else - if(0)//TBD - need stop condition to write only once (all the steps) , Read_Setup != setup, Read_Setup != 0, Read_Setup != Prev_Read_Setup + /*if(0)//TBD - need stop condition to write only once (all the steps) , Read_Setup != setup, Read_Setup != 0, Read_Setup != Prev_Read_Setup { // option to wrte + read setup and stop when read = write WHS_Shinko_Communication(W_SETUP); } - else + else*/ { //finish reading the setup before start reading the value WHS_Shinko_Communication(R_Value); // Reading every fourth cycle (Set HW, Request, Set HW, Response) diff --git a/Software/Embedded_SW/Embedded/Modules/Diagnostics/Diagnostics.c b/Software/Embedded_SW/Embedded/Modules/Diagnostics/Diagnostics.c index d27ab05f7..36bcc0c3b 100644 --- a/Software/Embedded_SW/Embedded/Modules/Diagnostics/Diagnostics.c +++ b/Software/Embedded_SW/Embedded/Modules/Diagnostics/Diagnostics.c @@ -129,8 +129,8 @@ double OverallTemperature; DoubleArray DispenserFreq[MAX_SYSTEM_DISPENSERS]; DoubleArray DiagnosticsDispenserPressure[MAX_SYSTEM_DISPENSERS]; -DoubleArray DispenserInkLevel[MAX_SYSTEM_DISPENSERS]; -DoubleArray DiagnosticsMidTankInkLevel[MAX_SYSTEM_DISPENSERS]; +//DoubleArray DispenserInkLevel[MAX_SYSTEM_DISPENSERS]; +//DoubleArray DiagnosticsMidTankInkLevel[MAX_SYSTEM_DISPENSERS]; HeaterState **heatersstates; HeaterState HeaterInfo[HEATER_TYPE_MAX_HEATERS]; @@ -426,9 +426,9 @@ void LoadChillerState(HeaterType HeaterType,HeaterState *HeaterState) HeaterState->has_heatertype = true; HeaterState->heatertype = HeaterType; HeaterState->has_setpoint = true; - HeaterState->setpoint = ShinkoTempDeg.Read_Setup; + HeaterState->setpoint = (float)(ShinkoTempDeg.Read_Setup)/10; HeaterState->has_currentvalue = true; - HeaterState->currentvalue = ShinkoTempDeg.Read_value;//Shinko_Temperature;//MillisecGetTemperatures(HeaterId2PT100Id[HeaterId])/100; + HeaterState->currentvalue = (float)(ShinkoTempDeg.Read_value)/10; return; } @@ -926,7 +926,7 @@ void DiagnosticOneSecCollection(void) } else { - DiagnosticsMonitor.chillertemperature = &ShinkoTempDeg.Read_value;//Shinko_Temperature; + DiagnosticsMonitor.chillertemperature = ShinkoTempDeg.Read_value;//Shinko_Temperature; } DiagnosticsMonitor.n_chillertemperature = 1; DiagnosticsMonitor.n_wastelevel = 1; diff --git a/Software/Embedded_SW/Embedded/Modules/IDS/IDS_Cleaning.c b/Software/Embedded_SW/Embedded/Modules/IDS/IDS_Cleaning.c index 2e3d61f0c..0e28134c4 100644 --- a/Software/Embedded_SW/Embedded/Modules/IDS/IDS_Cleaning.c +++ b/Software/Embedded_SW/Embedded/Modules/IDS/IDS_Cleaning.c @@ -160,7 +160,7 @@ uint32_t IDS_Cleaning_Stop_Cleaning_Solution (callback_fptr callback) } if(Head_Type == HEAD_TYPE_ARC) { - MotorMovetoLimitSwitch(MotorId,1-MotorsCfg[MotorId].directionthreadwize, 50, Motor_Id_to_LS_IdDown[MotorId], cleaningMotorCBFunction,30000); + MotorMovetoLimitSwitch(MotorId,1-MotorsCfg[MotorId].directionthreadwize, 30, Motor_Id_to_LS_IdDown[MotorId], cleaningMotorCBFunction,30000); } ReportWithPackageFilter(IDSFilter,"IDS_Cleaning_Motor_Homing", __FILE__, __LINE__, 1, RpWarning, CleaningStageCounter, 0); diff --git a/Software/Embedded_SW/Embedded/Modules/IDS/IDS_print.c b/Software/Embedded_SW/Embedded/Modules/IDS/IDS_print.c index e6d45daa9..cd3feb624 100644 --- a/Software/Embedded_SW/Embedded/Modules/IDS/IDS_print.c +++ b/Software/Embedded_SW/Embedded/Modules/IDS/IDS_print.c @@ -65,7 +65,7 @@ uint32_t IDS_Valve_PresegmentReady(uint32_t deviceID, uint32_t ReadValue); uint32_t IDSBrushStopRestartCallback(uint32_t IfIndex, uint32_t readValue); //bool IDS_isDispenserUsedNextSegment(void *JobDetails,int DispenserId, int SegmentId); /******************** GLOBAL PARAMETERS ********************************************/ -DispenserControlConfig_t DispenserControlConfig[MAX_SYSTEM_DISPENSERS]; +//DispenserControlConfig_t DispenserControlConfig[MAX_SYSTEM_DISPENSERS]; uint32_t ControlIdtoDispenserId [MAX_SYSTEM_DISPENSERS] = {0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF}; int OriginalDispenserSpd_2PPS[MAX_SYSTEM_DISPENSERS] = {0,0,0,0,0,0,0,0}; bool DispenserPreSegmentReady[MAX_SYSTEM_DISPENSERS] = {true,true,true,true,true,true,true,true}; @@ -182,7 +182,7 @@ uint32_t IDS_DispenserPidRequestMessage(HardwarePidControl* request) return OK; } uint32_t DispenserPidControlId[MAX_SYSTEM_DISPENSERS] = {0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF}; -uint32_t IDS_Pid_Testing_Func(uint32_t DispenserId, uint32_t ReadValue) +/*uint32_t IDS_Pid_Testing_Func(uint32_t DispenserId, uint32_t ReadValue) { float calculated_speed; DispenserControlConfig[DispenserId].m_mesuredParam = MillisecGetPressures(DispenserId); @@ -205,7 +205,7 @@ void IDS_Stop_Pid_Testing(int DispenserId) RemoveControlCallback(DispenserPidControlId[DispenserId], IDS_Pid_Testing_Func ); DispenserPidControlId[DispenserId] = 0xFF; ReportWithPackageFilter(IDSFilter,"IDS_Stop_Pid_Testing ",__FILE__,__LINE__,DispenserId,RpWarning,(int)DispenserPidControlId[DispenserId],0); -} +}*/ /* * IDS Printing support * Prepare: build pressure in all participating dispensers diff --git a/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Progress.c b/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Progress.c index 706aa5bce..fb8e97898 100644 --- a/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Progress.c +++ b/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Progress.c @@ -969,7 +969,7 @@ void Stub_ProgressRequest(MessageContainer* requestContainer) response.progress = (double)OK; response.has_progress = true; } - else + /*else if(request->amount == 0xE1) //fast refresh for pressure { LOG_ERROR(request->delay,"Starting Dispenser PID"); @@ -984,7 +984,7 @@ void Stub_ProgressRequest(MessageContainer* requestContainer) IDS_Stop_Pid_Testing(request->delay); response.progress = (double)OK; response.has_progress = true; - } + }*/ else if(request->amount == 0xE3) //fast refresh for pressure { diff --git a/Software/Embedded_SW/Embedded/StateMachines/Initialization/InitSequence.c b/Software/Embedded_SW/Embedded/StateMachines/Initialization/InitSequence.c index 92d6d586b..f747a9efc 100644 --- a/Software/Embedded_SW/Embedded/StateMachines/Initialization/InitSequence.c +++ b/Software/Embedded_SW/Embedded/StateMachines/Initialization/InitSequence.c @@ -437,14 +437,14 @@ uint32_t InitSequenceInitialBlowerActivation(void) WHS_enable_control_loop(false); if (WHS_Type == WHS_TYPE_NEW) { - Control_Voltage_To_Blower(1); //stop the blower - Task_sleep (1000); - Trigger_WHS_MAX11614_Read_allADC(); - Task_sleep (10); if (ResetReason & SYSCTL_CAUSE_POR) { + Control_Voltage_To_Blower(1); //stop the blower + Task_sleep (1000); for (i=0;i<8;i++) { + Trigger_WHS_MAX11614_Read_allADC(); + Task_sleep (100); get_orf_1(&value); total1+=value; get_orf_2(&value); @@ -473,14 +473,14 @@ uint32_t InitSequenceInitialBlowerActivation(void) else total3 = ZeroValue; ReportWithPackageFilter(InitFilter,"store initial orifice 3 value", __FILE__,EEPROM_ORIFICE3_ZERO_VALUE,total3, RpMessage, ZeroValue, 0); - WHS_MAX11614_Load_OrificeZeroValue(total1,total3,total3); + WHS_MAX11614_Load_OrificeZeroValue(total1,total2,total3); } else { MCU_E2PromRead(EEPROM_ORIFICE1_ZERO_VALUE,&total1); MCU_E2PromRead(EEPROM_ORIFICE3_ZERO_VALUE,&total3); ReportWithPackageFilter(InitFilter,"load initial values from EEPROM", __FILE__,0,total3, RpMessage, total1, 0); - WHS_MAX11614_Load_OrificeZeroValue(total1,0,total3); + WHS_MAX11614_Load_OrificeZeroValue(total1,total1,total3); } } HeadBlowersInit(); @@ -620,8 +620,9 @@ uint32_t InitSequenceStartHeating(void) TimerMotors_t MotorId = HARDWARE_MOTOR_TYPE__MOTO_DH_LID; SetMachineReadyForHeating(true); + Shinko_Read = true; if(Head_Type == HEAD_TYPE_ARC) { - MotorMovetoLimitSwitch(MotorId,1-MotorsCfg[MotorId].directionthreadwize, 50, Motor_Id_to_LS_IdDown[MotorId], cleaningMotorCBFunction,30000); + MotorMovetoLimitSwitch(MotorId,1-MotorsCfg[MotorId].directionthreadwize, 30, Motor_Id_to_LS_IdDown[MotorId], cleaningMotorCBFunction,30000); } else if(Head_Type == HEAD_TYPE_FLAT){ HeadCard_Actuators_Relocate(); } diff --git a/Software/Embedded_SW/Embedded/tm4c129xnczad.cmd b/Software/Embedded_SW/Embedded/tm4c129xnczad.cmd index 7bdb8efdf..be42101c4 100644 --- a/Software/Embedded_SW/Embedded/tm4c129xnczad.cmd +++ b/Software/Embedded_SW/Embedded/tm4c129xnczad.cmd @@ -34,7 +34,7 @@ /* The starting address of the application. Normally the interrupt vectors */ /* must be located at the beginning of the application. */ #define APP_BASE 0x00000000 -#define FLASH_RAM_BASE 0x000F0000 +#define FLASH_RAM_BASE 0x000F8000 #define RAM_BASE 0x20000000 /* System memory map */ @@ -42,9 +42,9 @@ MEMORY { /* Application stored in and executes from internal flash */ - FLASH (RX) : origin = APP_BASE, length = 0x000F0000 + FLASH (RX) : origin = APP_BASE, length = 0x000F8000 /* Application stored in and executes from internal flash */ - FLASH_RAM (RWX) : origin = FLASH_RAM_BASE, length = 0x00010000 + FLASH_RAM (RWX) : origin = FLASH_RAM_BASE, length = 0x00008000 /* Application uses internal RAM for data */ SRAM (RWX) : origin = 0x20000000, length = 0x00040000 } |
