#if rppCONFIG_DRV == 1
#include "drv/drv.h"
-#elif defined(FREERTOS_POSIX)
-#include <stdlib.h> // malloc()
+#endif
+
+#ifndef FREERTOS_POSIX
+#define echo(x) rpp_sci_putc(x)
+#else
+#define echo(x) (void)(x)
#endif
static const char* prompt = "--> ";
(rpp_sdr_available() / 1024)
);
rpp_sci_printf((const char*)
- "========================================\r\n"
+ "===========================================================\r\n"
);
rpp_sci_printf((const char*)"%s", prompt);
if(input == 8 || input == 127) {
if(buff_index > 0) {
buff_index--;
+ echo('\b');
+ echo(' ' );
+ echo('\b');
}
// Line feed or Carriage return
} else if(input == 10 || input == 13) {
flush = TRUE;
+ echo('\r');
+ echo('\n');
// If is any printable character
} else if(isprint(input)) {
// Store character and increment buffer index
in_buffer[buff_index] = input;
buff_index++;
+ echo(input);
// Check if buffer is full and force flush
if(buff_index == BUF_SIZE - 1) {
// Help command
} else if(strncmp(in_buffer, "help", BUF_SIZE) == 0) {
+
+ rpp_sci_printf((const char*)
+ "Available commands:\r\n"
+ );
+ rpp_sci_printf((const char*)
+ "\tlog - Show the log.\r\n"
+ );
+ rpp_sci_printf((const char*)
+ "\tclear - Clear the log.\r\n"
+ );
+ rpp_sci_printf((const char*)
+ "\tavailable - Display amount of memory left.\r\n"
+ );
rpp_sci_printf((const char*)
- "Available commands: \r\n"
- "\tlog\r\n"
- "\tclear\r\n"
- "\tavailable\r\n"
- "\texit\r\n"
+ "\texit - Exit this command processor.\r\n"
);
rpp_sci_printf((const char*)"%s", newline);
// Startup is requested
} else {
- if(xTaskCreate(rpp_sdr_showtask, (const signed char*)"rpp_sdr_showtask",
+ if(xTaskCreate(rpp_sdr_showtask,
+ (const signed char*)"rpp_sdr_showtask",
256, NULL, 2, &show_handle) != pdPASS) {
return FAILURE;
}
tasks_running++;
- if(xTaskCreate(rpp_sdr_cmdproc , (const signed char*)"rpp_sdr_cmdproc" ,
+ if(xTaskCreate(rpp_sdr_cmdproc ,
+ (const signed char*)"rpp_sdr_cmdproc" ,
512, NULL, 2, &cmdproc_handle) != pdPASS) {
wait_tasks_to_finish();
return FAILURE;