Index: firmware/App/Tasks/TaskPriority.c =================================================================== diff -u -ra7bf3ca23ea37a61000379facae628a31b3ecc59 -rf308cc4c35eab630ebbbde405cfe47d049afeafb --- firmware/App/Tasks/TaskPriority.c (.../TaskPriority.c) (revision a7bf3ca23ea37a61000379facae628a31b3ecc59) +++ firmware/App/Tasks/TaskPriority.c (.../TaskPriority.c) (revision f308cc4c35eab630ebbbde405cfe47d049afeafb) @@ -7,8 +7,8 @@ * * @file TaskPriority.c * -* @author (last) Sean Nash -* @date (last) 10-Jun-2020 +* @author (last) Quang Nguyen +* @date (last) 13-Jul-2020 * * @author (original) Dara Navaei * @date (original) 05-Nov-2019 @@ -17,6 +17,7 @@ #include "gio.h" +#include "Accel.h" #include "DrainPump.h" #include "FPGA.h" #include "InternalADC.h" @@ -27,9 +28,17 @@ #include "TemperatureSensors.h" #include "Valves.h" #include "WatchdogMgmt.h" -#include "TemperatureSensors.h" +#include "TemperatureSensors.h" +#include "ConductivitySensors.h" #include "Heaters.h" - + +#ifdef TASK_TIMING_OUTPUT_ENABLED + #include "mibspi.h" + #define TASK_TIMING_TEST_PIN_SPI1_PORT_MASK 0x00000020 // (CS5 - re-purposed as output GPIO) + #define SET_TASK_ON() { mibspiREG3->PC3 |= TASK_TIMING_TEST_PIN_SPI1_PORT_MASK; } + #define SET_TASK_OFF() { mibspiREG3->PC3 &= ~TASK_TIMING_TEST_PIN_SPI1_PORT_MASK; } +#endif + /************************************************************************* * @brief taskPriority * The taskPriority function handles the scheduled Priority Task interrupt. @@ -40,13 +49,16 @@ *************************************************************************/ void taskPriority( void ) { +#ifdef TASK_TIMING_OUTPUT_ENABLED +// SET_TASK_ON(); // TODO - uncomment and define TASK_TIMING_OUTPUT_ENABLED to monitor this tasks timing +#endif + // 1st pass for FPGA execFPGAIn(); // monitor internal ADC channels execInternalADC(); -#ifndef CAN_TEST // monitor pressures execPressures(); @@ -56,11 +68,19 @@ #ifndef DISABLE_HEATERS_AND_TEMPS // Temperature sensors read execTemperatureSensors(); -#endif +#endif + + // conductivity sensors read + execConductivitySensors(); // control valves execValves(); - + +#ifndef DISABLE_ACCELS + // monitor accelerometer + execAccel(); +#endif + // monitor RO pump execROPumpMonitor(); @@ -69,15 +89,15 @@ // Heaters monitor execHeatersMonitor(); -#endif // 2nd pass for FPGA execFPGAOut(); // check in with watchdog manager checkInWithWatchdogMgmt( TASK_PRIORITY ); - // toggle GPIO to indicate priority task has executed - //gioToggleBit( gioPORTB, 3 ); +#ifdef TASK_TIMING_OUTPUT_ENABLED +// SET_TASK_OFF(); // TODO - uncomment and define TASK_TIMING_OUTPUT_ENABLED to monitor this tasks timing +#endif }