2 * cmd_proc_freertos_tms570.c
7 * Implementation of main task for processing commands.
10 #include "cmd_proc_freertos_tms570.h"
12 xTaskHandle processCmdHandler;
14 extern cmd_des_t const *cmd_list_main[]; // Main list of commands
15 extern cmd_io_t cmd_io_std_line; // IO stack
18 void initCmdProc(unsigned portBASE_TYPE priority, uint8_t * introText, uint8_t * promptText) {
21 if (promptText != NULL) {
22 prompt = (uint8_t *)pvPortMalloc(strlen((char*)promptText));
23 strcpy((char *)prompt, (const char*)promptText);
26 if ((taskRetVal = xTaskCreate(processCmd, (const signed char *)"processCmd", 1000, NULL, priority, processCmdHandler)) != pdPASS) {
27 uint8_t taskCreateError[]="FreeRTOS: Creating task processCmd failed. Error code: ";
28 print(taskCreateError);
30 i2str(buf, taskRetVal, 1, 0);
31 print((uint8_t *)buf);
32 print((uint8_t *)"\r\n");
33 /* An error occurred, block program */
37 if (introText != NULL)
38 print((uint8_t *)introText);
40 print((uint8_t *)prompt);
41 sciReceive(sciREG, 1, NULL);
44 void processCmd(void *pvParameters ) {
46 cmd_processor_run(&cmd_io_std_line, cmd_list_main);
48 print((uint8_t *)prompt);