diff options
| author | Shlomo Hecht <shlomo@twine-s.com> | 2018-05-29 19:12:36 +0300 |
|---|---|---|
| committer | Shlomo Hecht <shlomo@twine-s.com> | 2018-05-29 19:12:36 +0300 |
| commit | 9dd3be045888ea7da9d2a6effca826ac4f090b75 (patch) | |
| tree | 6bd7a3b35014af2472858d5c591cbc40f84171fc /Software/Embedded_SW/Embedded/Modules | |
| parent | 5e67333d1231c2020e8d4ea062fc74418be9f3e5 (diff) | |
| download | Tango-9dd3be045888ea7da9d2a6effca826ac4f090b75.tar.gz Tango-9dd3be045888ea7da9d2a6effca826ac4f090b75.zip | |
added the third PT100 call in the millisecond task
Diffstat (limited to 'Software/Embedded_SW/Embedded/Modules')
| -rw-r--r-- | Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c b/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c index 19537aaa6..c9be1219f 100644 --- a/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c +++ b/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c @@ -41,6 +41,7 @@ typedef struct MillisecMotorData { bool WaitForData; bool DataRequired; + bool SyncRequired; MSecFptr Callback; unsigned long Data; int Length; @@ -165,6 +166,7 @@ int32_t MillisecReadFromTempSensor(uint32_t TempSensorId, MSecFptr Callback) if (TempSensorId >= MAX_TEMPERATURE_SENSOR_ID) return -1; PT100Activity++; //read request PT100Activity++; //get response + PT100Activity++; //read request PT100Data[TempSensorId].Callback = Callback; PT100Data[TempSensorId].DataRequired = true; PT100Data[TempSensorId].Active = true; @@ -287,7 +289,23 @@ uint32_t MillisecLoop(uint32_t tick) { //if (TempDriverDriverResponse[Sensor_i].Busy == true) // continue; - if (PT100Data[Sensor_i].WaitForData == true) //Read request sent, data is waiting + if (PT100Data[Sensor_i].SyncRequired == true) + { + TemperatureSendSensorDummyClk((TEMPERATURE_SENSOR_ID_ENUM)Sensor_i); + PT100Data[Sensor_i].SyncRequired = false; + if (PT100Data[Sensor_i].DataRequired == true) + { + PT100Data[Sensor_i].WaitForData = true; // mark the motor for data request next round + } + else + { + if (PT100Data[Sensor_i].Callback) + PT100Data[Sensor_i].Callback(Sensor_i,0); // call the callback to report execution + } + PT100Activity--; + + } + else if (PT100Data[Sensor_i].WaitForData == true) //Read request sent, data is waiting { if (TemperatureSensorReadFromFPGA_Res((TEMPERATURE_SENSOR_ID_ENUM)Sensor_i) == OK) //got the data from the FPGA { @@ -303,7 +321,7 @@ uint32_t MillisecLoop(uint32_t tick) PT100Data[Sensor_i].Active = false; if (PT100Data[Sensor_i].DataRequired == true) { - PT100Data[Sensor_i].WaitForData = true; // mark the motor for data request next round + PT100Data[Sensor_i].SyncRequired = true; // mark the motor for data request next round } else { |
