Index: App/Tasks/TaskGeneral.c =================================================================== diff -u -r765d2c35118e202444e737c66c77faf9678cc87e -ra87b6b9e253c6c0fcc84bca6f5de71959ce18bcc --- App/Tasks/TaskGeneral.c (.../TaskGeneral.c) (revision 765d2c35118e202444e737c66c77faf9678cc87e) +++ App/Tasks/TaskGeneral.c (.../TaskGeneral.c) (revision a87b6b9e253c6c0fcc84bca6f5de71959ce18bcc) @@ -1,31 +1,35 @@ -/************************************************************************* -* -* Copyright Diality, Inc. 2019-2020. All Rights Reserved. -* 181 Technology, Ste. 150 -* Irvine, CA 92618 -* -* Project Denali -* -* @file TaskGeneral.c -* -* @brief General task handler. -* -* @date 19-Sep-2019 -* -*************************************************************************/ +/************************************************************************** + * + * Copyright (c) 2019-2019 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. + * + **************************************************************************/ #include "gio.h" #include "lin.h" +#include "Common.h" #include "AlarmLamp.h" #include "OperationModes.h" +#include "SystemComm.h" #include "WatchdogMgmt.h" #include "TaskGeneral.h" -// private data +#ifdef RM46_EVAL_BOARD_TARGET + #include "CPLD.h" + #include "SystemCommMessages.h" + static BOOL lastUserPress = FALSE; +#endif -static int ledCounter = 0; - /************************************************************************* * @brief taskGeneral * The taskGeneral function handles the scheduled General Task interrupt.\n @@ -36,27 +40,41 @@ * Outputs : Executive for the TBD called. * @param none * @return none -*************************************************************************/ + *************************************************************************/ void taskGeneral( void ) { - // run operation mode state machine - execOperationModes(); +#ifdef RM46_EVAL_BOARD_TARGET + if ( getUserButtonState() == PIN_SIGNAL_LOW ) + { + if ( lastUserPress == FALSE ) + { + lastUserPress = TRUE; + setUserLED( FALSE ); + sendOffButtonMsgToUI(); + } + } + else + { + lastUserPress = FALSE; + } +#endif - // control alarm lamp - ExecuteAlarmLamp(); + // check in with watchdog manager + checkInWithWatchdogMgmt( TASK_GENERAL ); // do this first to keep timing consistent with watchdog management - // check in with watchdog manager - checkInWithWatchdogMgmt( TASK_GENERAL ); + // manage data received from other sub-systems + execSystemCommRx(); - // toggle GPIO to indicate general task has executed - gioToggleBit( gioPORTA, 0 ); - ledCounter++; + // run operation mode state machine + execOperationModes(); - // Temporary LED blinking for now - TODO: Remove this - if ( ledCounter >= 10 ) - { - ledCounter = 0; - gioToggleBit( gioPORTB, 1 ); - } + // control alarm lamp + execAlarmLamp(); + + // manage data to be transmitted to other sub-systems + execSystemCommTx(); + + // toggle GPIO to indicate general task has executed +// gioToggleBit( gioPORTB, 1 ); }