Index: firmware/App/Tasks/TaskGeneral.c =================================================================== diff -u -r9b262ba08e3180f121c3cf19d8d25e565183f87d -rd5c5b1d2bc42b166f1ccff1aa4b2441db8f06d4b --- firmware/App/Tasks/TaskGeneral.c (.../TaskGeneral.c) (revision 9b262ba08e3180f121c3cf19d8d25e565183f87d) +++ firmware/App/Tasks/TaskGeneral.c (.../TaskGeneral.c) (revision d5c5b1d2bc42b166f1ccff1aa4b2441db8f06d4b) @@ -1,29 +1,29 @@ -/************************************************************************** - * - * Copyright (c) 2019-2020 Diality Inc. - All Rights Reserved. - * - * THIS CODE MAY NOT BE COPIED OR REPRODUCED IN ANY FORM, IN PART OR IN - * WHOLE, WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER. - * - * @file TaskGeneral.c - * - * @date 19-Sep-2019 - * @author S. Nash - * - * @brief General task handler. - * - **************************************************************************/ +/************************************************************************** +* +* Copyright (c) 2019-2020 Diality Inc. - All Rights Reserved. +* +* THIS CODE MAY NOT BE COPIED OR REPRODUCED IN ANY FORM, IN PART OR IN +* WHOLE, WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER. +* +* @file TaskGeneral.c +* +* @author (last) Dara Navaei +* @date (last) 30-Sep-2020 +* +* @author (original) Dara Navaei +* @date (original) 05-Nov-2019 +* +***************************************************************************/ -//#include "gio.h" - #include "AlarmLamp.h" -#include "BloodFlow.h" +#include "BloodFlow.h" +#include "CPLD.h" #include "DialInFlow.h" #include "DialOutFlow.h" #include "OperationModes.h" #include "PresOccl.h" #include "SystemComm.h" -#include "SystemCommMessages.h" +#include "SystemCommMessages.h" #include "WatchdogMgmt.h" #include "TaskGeneral.h" #include "RTC.h" @@ -34,21 +34,30 @@ static BOOL lastUserPress = FALSE; #endif +/** + * @addtogroup TaskGeneral + * @{ + */ + // ********** private data ********** -/************************************************************************* - * @brief taskGeneral - * The taskGeneral function handles the scheduled General Task interrupt.\n - * Calls the executive functions for most monitors and controllers, the\n - * operation modes, the system communications, and alarms.\n +/*********************************************************************//** + * @brief + * The taskGeneral function handles the scheduled General Task interrupt. + * Calls the executive functions for most monitors and controllers, the + * operation modes, the system communications, and alarms. * @details * Inputs : none * Outputs : Executive for the TBD called. - * @param none * @return none *************************************************************************/ void taskGeneral( void ) { +#ifdef TASK_TIMING_OUTPUT_ENABLED + // set GPIO high to indicate general task has begun executing + setCPLDLampGreen( PIN_SIGNAL_HIGH ); +#endif + // check in with watchdog manager checkInWithWatchdogMgmt( TASK_GENERAL ); // do this first to keep timing consistent with watchdog management @@ -60,24 +69,12 @@ if ( TRUE == uiCommunicated() ) #endif { -#ifndef CAN_TEST // monitor pressure/occlusion sensors execPresOccl(); -#endif // run operation mode state machine execOperationModes(); -#ifdef CAN_TEST - { - static U32 canTestCtr = 0; - if ( ++canTestCtr >= 2 ) - { - broadcastCANTest1LargeFrequentMessage(); - canTestCtr = 0; - } - } -#else // control blood pump execBloodFlowController(); @@ -95,7 +92,6 @@ // control alarm lamp execAlarmLamp(); -#endif #ifdef RM46_EVAL_BOARD_TARGET if ( getUserButtonState() == PIN_SIGNAL_LOW ) @@ -117,7 +113,10 @@ execSystemCommTx(); } - // toggle GPIO to indicate general task has executed -// gioToggleBit( gioPORTB, 1 ); +#ifdef TASK_TIMING_OUTPUT_ENABLED + // set GPIO low to indicate general task has finished executing + setCPLDLampGreen( PIN_SIGNAL_LOW ); +#endif } - + +/**@}*/