aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Embedded_SW/Embedded/Modules
diff options
context:
space:
mode:
authorRoy Ben-Shabat <Roy@Twine-s.com>2018-07-24 18:01:29 +0300
committerRoy Ben-Shabat <Roy@Twine-s.com>2018-07-24 18:01:29 +0300
commitb2031a1f090aa9d08445e4140c1afe2ec8a72fa4 (patch)
tree6041b29e3b66f3c4365821d152c3fa0de5fae6dc /Software/Embedded_SW/Embedded/Modules
parent336f3ce6e755465ad3033428bb4794acfdfc052a (diff)
parent6509a45db0a72d65ce84078b8ad2096e224895fc (diff)
downloadTango-b2031a1f090aa9d08445e4140c1afe2ec8a72fa4.tar.gz
Tango-b2031a1f090aa9d08445e4140c1afe2ec8a72fa4.zip
Merge branch 'master' of https://twinetfs.visualstudio.com/_git/Tango
Diffstat (limited to 'Software/Embedded_SW/Embedded/Modules')
-rw-r--r--Software/Embedded_SW/Embedded/Modules/AlarmHandling/Diagnostics.c21
-rw-r--r--Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_print.c6
-rw-r--r--Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Stub_ExtFlash.c44
-rw-r--r--Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c10
4 files changed, 51 insertions, 30 deletions
diff --git a/Software/Embedded_SW/Embedded/Modules/AlarmHandling/Diagnostics.c b/Software/Embedded_SW/Embedded/Modules/AlarmHandling/Diagnostics.c
index 19fe66611..e67fe68bb 100644
--- a/Software/Embedded_SW/Embedded/Modules/AlarmHandling/Diagnostics.c
+++ b/Software/Embedded_SW/Embedded/Modules/AlarmHandling/Diagnostics.c
@@ -123,16 +123,16 @@ void DiagnosticCollection(void)
pollermotor[DiagnosticsIndex] = MotorGetSpeed (HARDWARE_MOTOR_TYPE__MOTO_LDRIVING);
windermotor[DiagnosticsIndex] = MotorGetSpeed (HARDWARE_MOTOR_TYPE__MOTO_WINDER);
screwmotor[DiagnosticsIndex] = MotorGetSpeed (HARDWARE_MOTOR_TYPE__MOTO_SCREW);
- mixertemperature[DiagnosticsIndex] = TemperatureSensorRead(TEMP_SENSE_ANALOG_MIXCHIP_TEMP);
- headzone1temperature[DiagnosticsIndex] = TemperatureSensorRead(TEMP_SENSE_ANALOG_DYEINGH_TEMP1);
- headzone2temperature[DiagnosticsIndex] = TemperatureSensorRead(TEMP_SENSE_ANALOG_DYEINGH_TEMP2);
- headzone3temperature[DiagnosticsIndex] = TemperatureSensorRead(TEMP_SENSE_ANALOG_DYEINGH_TEMP3);
- headzone4temperature[DiagnosticsIndex] = TemperatureSensorRead(TEMP_SENSE_ANALOG_DYEINGH_TEMP4);
- headzone5temperature[DiagnosticsIndex] = TemperatureSensorRead(TEMP_SENSE_ANALOG_DYEINGH_TEMP5);
- headzone6temperature[DiagnosticsIndex] = TemperatureSensorRead(TEMP_SENSE_AN_ENCLOSURETEMP3);
- dryerzone1temperature[DiagnosticsIndex] = TemperatureSensorRead(TEMP_SENSE_ANALOG_DRYER_TEMP1);
- dryerzone2temperature[DiagnosticsIndex] = TemperatureSensorRead(TEMP_SENSE_ANALOG_DRYER_TEMP2);
- dryerzone3temperature[DiagnosticsIndex] = TemperatureSensorRead(TEMP_SENSE_ANALOG_DRYER_TEMP3);
+ mixertemperature[DiagnosticsIndex] = TemperatureSensorRead(TEMP_SENSE_ANALOG_MIXCHIP_TEMP)/100;
+ headzone1temperature[DiagnosticsIndex] = TemperatureSensorRead(TEMP_SENSE_ANALOG_DYEINGH_TEMP1)/100;
+ headzone2temperature[DiagnosticsIndex] = TemperatureSensorRead(TEMP_SENSE_ANALOG_DYEINGH_TEMP2)/100;
+ headzone3temperature[DiagnosticsIndex] = TemperatureSensorRead(TEMP_SENSE_ANALOG_DYEINGH_TEMP3)/100;
+ headzone4temperature[DiagnosticsIndex] = TemperatureSensorRead(TEMP_SENSE_ANALOG_DYEINGH_TEMP4)/100;
+ headzone5temperature[DiagnosticsIndex] = TemperatureSensorRead(TEMP_SENSE_ANALOG_DYEINGH_TEMP5)/100;
+ headzone6temperature[DiagnosticsIndex] = TemperatureSensorRead(TEMP_SENSE_AN_ENCLOSURETEMP3)/100;
+ dryerzone1temperature[DiagnosticsIndex] = TemperatureSensorRead(TEMP_SENSE_ANALOG_DRYER_TEMP1)/100;
+ dryerzone2temperature[DiagnosticsIndex] = TemperatureSensorRead(TEMP_SENSE_ANALOG_DRYER_TEMP2)/100;
+ dryerzone3temperature[DiagnosticsIndex] = TemperatureSensorRead(TEMP_SENSE_ANALOG_DRYER_TEMP3)/100;
for (i=0;i<MAX_SYSTEM_DISPENSERS;i++)
{
@@ -263,6 +263,7 @@ uint32_t DiagnosticsEmptyCBFunction(uint32_t IfIndex, uint32_t ReadValue)
}
uint32_t DiagnosticsStart()
{
+
if ( DiagnosticsActive == false)
{
if (DiagnosticRequestAccepted == true)
diff --git a/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_print.c b/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_print.c
index 4c25aa508..c12066eee 100644
--- a/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_print.c
+++ b/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_print.c
@@ -48,7 +48,7 @@ uint32_t DryerHeaterMaxTempControl = 0xFF;
#warning the PT100 id for the dryer control is number2 - dryer internal ambient sensor.
uint32_t HeaterId2PT100Id[MAX_HEATERS_NUM] = {TEMP_SENSE_ANALOG_DRYER_TEMP2,TEMP_SENSE_ANALOG_DRYER_TEMP1,TEMP_SENSE_ANALOG_DRYER_TEMP3,TEMP_SENSE_ANALOG_DYEINGH_TEMP1,TEMP_SENSE_ANALOG_DYEINGH_TEMP2,TEMP_SENSE_ANALOG_DYEINGH_TEMP3,TEMP_SENSE_ANALOG_DYEINGH_TEMP4,TEMP_SENSE_ANALOG_DYEINGH_TEMP5,TEMP_SENSE_ANALOG_MIXCHIP_TEMP,TEMP_SENSE_ANALOG_MIXCHIP_TEMP};
-uint32_t DryerInternalPT100Id = TEMP_SENSE_ANALOG_DRYER_TEMP3;
+uint32_t DryerInternalPT100Id = TEMP_SENSE_ANALOG_DRYER_TEMP1;
bool HeatersRestart = false;
bool HeaterMaxTempFlag[MAX_HEATERS_NUM] = {false,false,false,false,false,false,false,false,false,false};
@@ -523,7 +523,7 @@ void EightMilliSecondHeatersInterrupt(UArg arg0)
ROM_TimerIntClear(Heater_timerBase, TIMER_TIMA_TIMEOUT); // Clear the timer interrupt
- ROM_IntMasterDisable();
+ //ROM_IntMasterDisable();
HeatersControlMessageStruc Message;
//bool retcode = false;
@@ -544,7 +544,7 @@ void EightMilliSecondHeatersInterrupt(UArg arg0)
//
// Enable all interrupts.
//
- ROM_IntMasterEnable();
+ //ROM_IntMasterEnable();
return ;
}
diff --git a/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Stub_ExtFlash.c b/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Stub_ExtFlash.c
index b19b0e00f..eb58c48ac 100644
--- a/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Stub_ExtFlash.c
+++ b/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Stub_ExtFlash.c
@@ -169,7 +169,7 @@ void Stub_ExtFlashReadRequest(MessageContainer* requestContainer)
}
//-------------------------------------------------------------------------------------
-#define MaxFlashWords 1050
+#define MaxFlashWords 1024
#define MaxFlashBytes MaxFlashWords*4
typedef union
@@ -178,16 +178,24 @@ typedef union
uint8_t Bytes[MaxFlashBytes];
}Flash_Union;
-Flash_Union Flash_W;
-Flash_Union Flash_R;
+Flash_Union Flash_RW;
+//Flash_Union Flash_R;
+
+uint32_t WriteBuf[MaxFlashBytes];
+uint32_t ReadBuf[MaxFlashBytes];
+
+#define MaxBytesForAddress 256;// The addresses to be programmed must not span a 256-byte boundary
+
//---------------------------------------------------------------------------------------------
void Stub_ExtFlashWriteWordsRequest(MessageContainer* requestContainer)
{
- uint32_t WriteBuf[MaxFlashWords];
+
uint32_t status = PASSED;
+
+
uint32_t i;
uint32_t No_Words,No_Bytes;
@@ -203,14 +211,17 @@ void Stub_ExtFlashWriteWordsRequest(MessageContainer* requestContainer)
No_Words = request->n_wordtwrite;
No_Bytes = request->n_wordtwrite *4;
+ memset(&Flash_RW,0,sizeof(Flash_RW));
+
for(i = 0; i < No_Words;i++)
{
- Flash_W.DWords[i] = request->wordtwrite[i];
+ Flash_RW.DWords[i] = request->wordtwrite[i];
}
+
for(i = 0; i < No_Bytes;i++)
{
- WriteBuf[i] = Flash_W.Bytes[i];
+ WriteBuf[i] = Flash_RW.Bytes[i];
}
if(No_Bytes >256)
@@ -222,7 +233,10 @@ void Stub_ExtFlashWriteWordsRequest(MessageContainer* requestContainer)
{
Ext_Flash_Operation(0X00 + (0X100*i) , TX, 256 , WriteBuf+ (256*i), NULL );
}
- Ext_Flash_Operation(0X00 + (0X100*i) , TX, Remainder , WriteBuf+ (256*i), NULL );
+ if(Remainder)
+ {
+ Ext_Flash_Operation(0X00 + (0X100*i) , TX, Remainder , WriteBuf+ (256*i), NULL );
+ }
}
else
{
@@ -251,12 +265,15 @@ void Stub_ExtFlashReadWordsRequest(MessageContainer* requestContainer)
{
uint32_t status = PASSED;
MessageContainer responseContainer;
+
+ memset(&Flash_RW,0,sizeof(Flash_RW));
+
uint32_t i;
StubExtFlashReadWordsRequest* request = stub_ext_flash_read_words_request__unpack(NULL, requestContainer->data.len, requestContainer->data.data);
uint32_t No_Words,No_Bytes;
- uint32_t ReadBuf[MaxFlashWords];
+
No_Words = request->number_of_words;
No_Bytes = request->number_of_words *4;
@@ -270,7 +287,10 @@ void Stub_ExtFlashReadWordsRequest(MessageContainer* requestContainer)
{
Ext_Flash_Operation(0X00 + (0X100*i), RX, 256, NULL, ReadBuf + (256*i) );
}
- Ext_Flash_Operation(0X00 + (0X100*i), RX, Remainder, NULL, ReadBuf + (256*i) );
+ if(Remainder)
+ {
+ Ext_Flash_Operation(0X00 + (0X100*i), RX, Remainder, NULL, ReadBuf + (256*i) );
+ }
}
else
{
@@ -279,13 +299,13 @@ void Stub_ExtFlashReadWordsRequest(MessageContainer* requestContainer)
for(i = 0; i < No_Bytes;i++)
{
- Flash_W.Bytes[i] = ReadBuf[i];
+ Flash_RW.Bytes[i] = ReadBuf[i];
}
StubExtFlashReadWordsResponse response = STUB_EXT_FLASH_READ_WORDS_RESPONSE__INIT;
- response.readbytes = Flash_W.DWords;//ReadBuf;
- response.n_readbytes = request->number_of_words;
+ response.readbytes = Flash_RW.DWords;
+ response.n_readbytes = No_Words;
status_response(status,&response.status, &response.statusword ,&response.has_statusword);
diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c
index 45ea660c3..4bc21773b 100644
--- a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c
+++ b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c
@@ -352,10 +352,10 @@ uint32_t ThreadControlCBFunction(uint32_t IfIndex, uint32_t ReadValue)
for (i=0;i<MotorsControl[index].pvinputfilterfactormode;i++)
avreageSampleValue += MotorSamples[index][i];
avreageSampleValue = avreageSampleValue / MotorsControl[index].pvinputfilterfactormode;
- /*
+
if (index == POOLER_MOTOR)
{
- if (JobCounter > eOneSecond)
+ if (JobCounter > eHundredMillisecond)
{
if (ReadBreakSensor()==ERROR)
{
@@ -365,7 +365,7 @@ uint32_t ThreadControlCBFunction(uint32_t IfIndex, uint32_t ReadValue)
}
}
}
- */
+
//Stop Execution if the dancer moves too much
if ((abs(avreageSampleValue)> DancerStopActivityLimit[index])&&(JobCounter > eOneSecond))
{
@@ -560,10 +560,10 @@ uint32_t ThreadPreSegmentState(void *JobDetails)
//#warning rocker disabled
if (MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_RLOADING].has_directionthreadwize)
MotorSetDirection((TimerMotors_t)HARDWARE_MOTOR_TYPE__MOTO_RLOADING,MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_RLOADING].directionthreadwize);
- MotorSetSpeed(HARDWARE_MOTOR_TYPE__MOTO_RLOADING, 5);
+ MotorSetSpeed(HARDWARE_MOTOR_TYPE__MOTO_RLOADING, 2);
if (MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_LLOADING].has_directionthreadwize)
MotorSetDirection((TimerMotors_t)HARDWARE_MOTOR_TYPE__MOTO_LLOADING,MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_LLOADING].directionthreadwize);
- MotorSetSpeed(HARDWARE_MOTOR_TYPE__MOTO_LLOADING, 5);
+ MotorSetSpeed(HARDWARE_MOTOR_TYPE__MOTO_LLOADING, 2);
//#warning rocker disabled
// MotorMovetoLimitSwitch (HARDWARE_MOTOR_TYPE__MOTO_RDRIVING,MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_RDRIVING].directionthreadwize, 0, GPI_LS_RLOADMOTOR_UP, EndState); //TODO