* @param[in] introText string shown once after initialization before prompt is shown. Can be NULL.
* @param[in] promptText string shown when software is ready to read command from RS-232. Can be NULL.
*/
-void initCmdProc(unsigned portBASE_TYPE printPriority, uint8_t * intro, uint8_t * prompt);
+void initCmdProc(unsigned portBASE_TYPE printPriority);
/** Procedure for task processCmd. Infinite loop that reads and process commands.
*/
/** cmdProc task handler */
xTaskHandle processCmdHandler;
-/** string prompt */
-uint8_t* prompt;
+
/** Main list of commands */
extern cmd_des_t const *cmd_list_main[];
/** IO stack */
* @param promptText Text printed when CMDPROC is ready to read new command
*
*/
-void initCmdProc(unsigned portBASE_TYPE priority, uint8_t * introText, uint8_t * promptText) {
- prompt = NULL;
- if (promptText != NULL) {
- prompt = (uint8_t *)pvPortMalloc(strlen((char*)promptText));
- strcpy((char *)prompt, (const char*)promptText);
- }
+void initCmdProc(unsigned portBASE_TYPE priority) {
int taskRetVal;
if ((taskRetVal = xTaskCreate(processCmd, (const signed char *)"processCmd", 1000, NULL, priority, processCmdHandler)) != pdPASS) {
rpp_sci_printf("FreeRTOS: Creating task processCmd failed. Error code: %d", taskRetVal);
while(1)
;
}
- if (introText != NULL)
- rpp_sci_printf("%s", introText);
- if (prompt != NULL)
- rpp_sci_printf("%s", prompt);
}
/**
*/
void processCmd(void *pvParameters ) {
for (;;) {
+ rpp_sci_printf("--> ");
cmd_processor_run(&cmd_io_std_line, cmd_list_main);
- if (prompt != NULL)
- rpp_sci_printf("%s", prompt);
}
}
rpp_sci_setup(115200);\r
\r
_enable_IRQ();\r
- initCmdProc(0, "\r\n----\r\n Rapid Prototyping Platform v00.01-001\r\n SW ver " GIT_VERSION " \r\n Porsche Engineering 06/2013\r\n----\r\n", (uint8_t *)"\r\n--> ");\r
+\r
+ rpp_sci_printf("\nRapid Prototyping Platform v00.01-001\n");\r
+ rpp_sci_printf("Test Software version " GIT_VERSION "\n");\r
+ rpp_sci_printf("Porsche Engineering 06/2013\n");\r
+\r
+ initCmdProc(0);\r
vTaskStartScheduler();\r
\r
//We should never get here\r