add spi e-ink display
This commit is contained in:
22
commands/echo.cpp
Normal file
22
commands/echo.cpp
Normal file
@@ -0,0 +1,22 @@
|
||||
#include <stdio.h>
|
||||
#include <ctype.h>
|
||||
#include <cstring>
|
||||
|
||||
#include "echo.h"
|
||||
|
||||
// Helper function to handle the echoing and resetting of the buffer
|
||||
void echo_and_reset(char* buffer, int* index_ptr) {
|
||||
if (*index_ptr > 0) {
|
||||
buffer[*index_ptr] = '\0';
|
||||
// Print to USB serial (ALL CAPS)
|
||||
printf("\nEchoed (ALL CAPS): ");
|
||||
for (int i = 0; buffer[i] != '\0'; i++) {
|
||||
char ch = toupper(buffer[i]);
|
||||
printf("%c", ch);
|
||||
}
|
||||
printf("\n");
|
||||
}
|
||||
|
||||
*index_ptr = 0;
|
||||
printf("> ");
|
||||
}
|
||||
Reference in New Issue
Block a user