If no UART is available for command input, the CodeComposer input can be used to enter commands. Since all stdin functions are blocking, gets() can not be used in DSP systems when a continuous processing of main is required. To avoid a permanent blocking of main a GEL-input is used to enter the blocking stdin function on demand.
Load gel file user_input.gel
This installs a new GEL dialog function:
Add function process_user_input() to your applications code and call it regularly from main
Open GEL dialog UserInput
Enter 1 into the new opened dialog and press "Execute"
The standard input dialog opens and waits for the user input. Note that this action is blocking.
Enter a new command, e.g. dir, and press OK or enter key:
The new command is processed by the application and the main loop is processed regularly again:
CCS4/CCS5 does not open an input dialog. Instead the Debug window shows a message "Running - Waiting for user input in Console"
Set the cursor into the Console window
... and type a command:
If you hit enter, this command is received by fgets() function and the command is issued: