add spi e-ink display

This commit is contained in:
Adolfo Reyna
2025-11-26 12:29:21 -05:00
parent d07901835e
commit 7ad7e03a01
5 changed files with 164 additions and 48 deletions

22
commands/echo.cpp Normal file
View 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("> ");
}

14
commands/echo.h Normal file
View File

@@ -0,0 +1,14 @@
#ifndef COMMANDS_ECHO_H
#define COMMANDS_ECHO_H
#ifdef __cplusplus
extern "C" {
#endif
void echo_and_reset(char* buffer, int* index_ptr);
#ifdef __cplusplus
}
#endif
#endif // COMMANDS_ECHO_H