Index: firmware/App/Tasks/TaskGeneral.c =================================================================== diff -u -ra7bf3ca23ea37a61000379facae628a31b3ecc59 -rd4481dd44bcc98172e785f812aa0c543c5385252 --- firmware/App/Tasks/TaskGeneral.c (.../TaskGeneral.c) (revision a7bf3ca23ea37a61000379facae628a31b3ecc59) +++ firmware/App/Tasks/TaskGeneral.c (.../TaskGeneral.c) (revision d4481dd44bcc98172e785f812aa0c543c5385252) @@ -27,6 +27,13 @@ #include "SystemCommMessages.h" #include "WatchdogMgmt.h" #include "TaskGeneral.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 taskGeneral @@ -36,18 +43,20 @@ * @details * Inputs : none * Outputs : Executive for the TBD called. - * @param none * @return none *************************************************************************/ void taskGeneral( void ) { +#ifdef TASK_TIMING_OUTPUT_ENABLED +// SET_TASK_ON(); // TODO - uncomment and define TASK_TIMING_OUTPUT_ENABLED to monitor this tasks timing +#endif + // check in with watchdog manager checkInWithWatchdogMgmt( TASK_GENERAL ); // do this first to keep timing consistent with watchdog management // manage data received from other sub-systems execSystemCommRx(); -#ifndef CAN_TEST // manage RO pump execROPumpController(); @@ -64,33 +73,14 @@ // Trimmer heater state machine execTrimmerHeater(); #endif -#endif // run operation mode state machine execOperationModes(); -#ifdef CAN_TEST - { // send test msg every 100ms - static U32 canTestCtr = 0; - static U32 canTestMsgCtr = 0; - if ( ++canTestCtr >= 2 ) - { - if ( ++canTestMsgCtr <= 23076) - { - broadcastCANTest1LargeFrequentMessage(); - } - else - { - canTestMsgCtr = 23076+1; - } - canTestCtr = 0; - } - } -#endif - // manage data to be transmitted to other sub-systems execSystemCommTx(); - // toggle GPIO to indicate general task has executed -// gioToggleBit( gioPORTB, 1 ); +#ifdef TASK_TIMING_OUTPUT_ENABLED +// SET_TASK_OFF(); // TODO - uncomment and define TASK_TIMING_OUTPUT_ENABLED to monitor this tasks timing +#endif }