2 * Copyright (C) 2012-2015 Czech Technical University in Prague
9 * This document contains proprietary information belonging to Czech
10 * Technical University in Prague. Passing on and copying of this
11 * document, and communication of its contents is not permitted
12 * without prior written authorization.
14 * File : cmd_proc_freertos.c
17 * This file contains main command processor task function and initialization of CMDPROC
22 #include "cmdproc_freertos.h"
25 /** cmdProc task handler */
26 xTaskHandle processCmdHandler;
28 /** Main list of commands */
29 extern cmd_des_t const *cmd_list_main[];
31 extern cmd_io_t cmd_io_std_line;
35 * @brief Entry function to start main CMDPROC
36 * @param priority Priority of CMDPROC task (0 is the highest priority)
37 * @param introText Text which will be printed when CMDPROC launches
38 * @param promptText Text printed when CMDPROC is ready to read new command
41 void initCmdProc(unsigned portBASE_TYPE priority)
45 if ((taskRetVal = xTaskCreate(processCmd, "processCmd", 1000, NULL, priority, processCmdHandler)) != pdPASS) {
46 rpp_sci_printf("FreeRTOS: Creating task processCmd failed. Error code: %d", taskRetVal);
47 /* An error occurred, block program */
54 * @brief CMDPROC task procedure
55 * @param pvParameters Not used, task receives no parameters
57 void processCmd(void *pvParameters )
60 rpp_sci_printf("--> ");
61 cmd_processor_run(&cmd_io_std_line, cmd_list_main);