2 * Copyright (C) 2012-2013 Czech Technical University in Prague
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program. If not, see <http://www.gnu.org/licenses/>.
22 * File : cmd_proc_freertos_tms570.c
25 * This file contains main command processor task function and initialization of CMDPROC
30 #include "cmdproc_freertos_tms570.h"
33 /** cmdProc task handler */
34 xTaskHandle processCmdHandler;
36 /** Main list of commands */
37 extern cmd_des_t const *cmd_list_main[];
39 extern cmd_io_t cmd_io_std_line;
43 * @brief Entry function to start main CMDPROC
44 * @param priority Priority of CMDPROC task (0 is the highest priority)
45 * @param introText Text which will be printed when CMDPROC launches
46 * @param promptText Text printed when CMDPROC is ready to read new command
49 void initCmdProc(unsigned portBASE_TYPE priority)
53 if ((taskRetVal = xTaskCreate(processCmd, (const signed char *)"processCmd", 1000, NULL, priority, processCmdHandler)) != pdPASS) {
54 rpp_sci_printf("FreeRTOS: Creating task processCmd failed. Error code: %d", taskRetVal);
55 /* An error occurred, block program */
62 * @brief CMDPROC task procedure
63 * @param pvParameters Not used, task receives no parameters
65 void processCmd(void *pvParameters )
68 rpp_sci_printf("--> ");
69 cmd_processor_run(&cmd_io_std_line, cmd_list_main);