diff options
| author | Avi Levkovich <avi@twine-s.com> | 2018-06-18 14:07:59 +0300 |
|---|---|---|
| committer | Avi Levkovich <avi@twine-s.com> | 2018-06-18 14:07:59 +0300 |
| commit | 247899ef27f6dec54f49876cb66c5749aa8d27fb (patch) | |
| tree | 346d89738e3ee134679f8b9340b37cdeddb867bf /Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c | |
| parent | 1fd773deb7bba088c5f1c13a1b9ccab85f927ddc (diff) | |
| parent | 3640afb74b3e7b3e232f56a14104866690495c9a (diff) | |
| download | Tango-247899ef27f6dec54f49876cb66c5749aa8d27fb.tar.gz Tango-247899ef27f6dec54f49876cb66c5749aa8d27fb.zip | |
conflict merge
Diffstat (limited to 'Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c')
| -rw-r--r-- | Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c b/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c index b9079919c..67de0271f 100644 --- a/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c +++ b/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c @@ -16,6 +16,7 @@ /////////////////////////////////////////////////////////////////////////////////////////// #include "include.h" #include "Modules/General/GeneralHardware.h" +#include "Modules/AlarmHandling/AlarmHandling.h" #include "MillisecTask.h" #include <driverlib/timer.h> @@ -29,11 +30,9 @@ #include "drivers/Heater/TemperatureSensor.h" #include "drivers/FPGA/FPGA_SPI_Comm.h" #include "drivers/FPGA/FPGA.h" -#include "drivers/Valves/Valve.h" #include "modules/thread/thread_ex.h" -#include "Drivers/Peripheral_GPIO/GPIO.h" -#include "drivers/FPGA/FPGA_GPIO/FPGA_GPIO.h" +#include "modules/ids/ids_ex.h" Task_Handle Millisecond_Task_Handle; /******************** Definitions ********************************************/ @@ -137,7 +136,7 @@ void MillisecStart(void) ADCAcquireStart(0,1); } - +uint32_t msec_millisecondCounter = 0; void OneMilliSecondMillisecInterrupt(UArg arg0) { MillisecMessageStruc Message; @@ -151,7 +150,7 @@ void OneMilliSecondMillisecInterrupt(UArg arg0) //send message to the Millisec task Message.messageId = OneMillisec; - Message.tick = UsersysTickGet(); + Message.tick = msec_millisecondCounter++;; Message.msglen = sizeof(MillisecMessageStruc); if (MillisecMsgQ != NULL) Mailbox_post(MillisecMsgQ , &Message, BIOS_NO_WAIT); @@ -229,17 +228,18 @@ uint32_t MillisecLoop(uint32_t tick) //call all modules Millisec functions //test dancers and speed encoders //check all callback units (state machine waiting for completion of a change) - bool Ten_msTick, Hundred_msTick, Onesecond_Tick; + bool Ten_msTick, Hundred_msTick, Onesecond_Tick,O900Millisecond_Tick; Ten_msTick = (tick%eTenMilliSecond == 0) ?true:false; Hundred_msTick = (tick%eHundredMillisecond == 0) ?true:false; + O900Millisecond_Tick = (tick%eOneSecond == 900) ?true:false; Onesecond_Tick = (tick%eOneSecond == 0) ?true:false; //gather Motor data from FPGA #ifndef EVALUATION_BOARD FPGA_GetBusy(); //load the busy motor information to all motors FPGA_Read_limit_Switches_Registers(); //Read_FPGA_GPI_Rgisters();//FPGA_Read_limit_Switches(); - //FPGA_GetDispenserValveBusyOCD(); #endif + temp += MotorActivity; if (MotorActivity) { @@ -341,15 +341,20 @@ uint32_t MillisecLoop(uint32_t tick) Dancer_Data[WINDER_DANCER] = Read_Dancer_Position(WINDER_DANCER); if (Hundred_msTick) { - ACTIVITY_RED_LED_CHANGE_MODE; for (Sensor_i = 0;Sensor_i < MAX_TEMPERATURE_SENSOR_ID;Sensor_i++) MillisecReadFromTempSensor(Sensor_i, NULL); + AlarmHandler_SendDiagnostics(); } - if (Onesecond_Tick) + if (O900Millisecond_Tick) { ADC_TriggerCollection(); } + if (Onesecond_Tick) + { + for (Sensor_i = 0;Sensor_i < MAX_SYSTEM_DISPENSERS;Sensor_i++) + CalculateDispenserPressure(Sensor_i); + } /* OLD CODE MotorStatus_Data[MOTOR_DRYER_DRIVING] = MotorGetStatusFromFPGA(MOTOR_DRYER_DRIVING); |
