/******************************************************************************* System Tasks File File Name: system_tasks.c Summary: This file contains source code necessary to maintain system's polled state machines. Description: This file contains source code necessary to maintain system's polled state machines. It implements the "SYS_Tasks" function that calls the individual "Tasks" functions for all the MPLAB Harmony modules in the system. Remarks: This file requires access to the systemObjects global data structure that contains the object handles to all MPLAB Harmony module objects executing polled in the system. These handles are passed into the individual module "Tasks" functions to identify the instance of the module to maintain. *******************************************************************************/ // DOM-IGNORE-BEGIN /******************************************************************************* Copyright 2017 Microchip Technology Incorporated and its subsidiaries. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE *******************************************************************************/ // DOM-IGNORE-END // ***************************************************************************** // ***************************************************************************** // Section: Included Files // ***************************************************************************** // ***************************************************************************** #include "system_config.h" #include "system_definitions.h" //#include "app.h" // ***************************************************************************** // ***************************************************************************** // Section: Local Prototypes // ***************************************************************************** // ***************************************************************************** static void _SYS_Tasks ( void ); // ***************************************************************************** // ***************************************************************************** // Section: System "Tasks" Routine // ***************************************************************************** // ***************************************************************************** /******************************************************************************* Function: void SYS_Tasks ( void ) Remarks: See prototype in system/common/sys_module.h. */ void SYS_Tasks ( void ) { /* Create OS Thread for Sys Tasks. */ xTaskCreate((TaskFunction_t) _SYS_Tasks, "Sys Tasks", 1024, NULL, 1, NULL); } /******************************************************************************* Function: void _SYS_Tasks ( void ) Summary: Maintains state machines of system modules. */ static void _SYS_Tasks ( void) { while(1) { SYS_TMR_Tasks(sysObj.sysTmr); /* Maintain system services */ SYS_CONSOLE_Tasks(sysObj.sysConsole0); /* SYS_COMMAND layer tasks routine */ SYS_CMD_Tasks(); /* Maintain Device Drivers */ DRV_MIIM_Tasks (sysObj.drvMiim); /* Maintain Middleware */ SYS_CMD_READY_TO_READ(); /* Task Delay */ vTaskDelay(1 / portTICK_PERIOD_MS); } } /******************************************************************************* End of File */