Skip to content
Snippets Groups Projects
Commit 528a36ef authored by Leo's avatar Leo :shark:
Browse files

minor serial changes

parent 602afdac
No related branches found
No related tags found
No related merge requests found
......@@ -52,7 +52,6 @@ void ls(void) {
}
void cat(String catFile) {
myFile = SD.open(catFile);
while (myFile.available()) {
VirtSerial.print((char)myFile.read());
......@@ -65,6 +64,8 @@ void cd(String nextDir) { curDir = SD.open(nextDir); }
void printLogoSerial() {
root = SD.open("/");
myFile = SD.open("logo", FILE_READ);
VirtSerial.println("\e[1;96m");
// VirtSerial.println("\e[5m");
if (myFile) {
while (myFile.available()) {
......@@ -73,6 +74,7 @@ void printLogoSerial() {
} else {
VirtSerial.println("can't open logo");
}
VirtSerial.print("\e[0m");
}
int initSDCard(int verbose) {
......@@ -100,8 +102,6 @@ void removepassword() {
}
void start_console(void) {
VirtSerial.begin(9600);
delay(1000);
// for (size_t i = 0; i < sizeof(BANNER); i++)
// {
......@@ -119,11 +119,11 @@ void start_console(void) {
VirtSerial.read((uint8*)&buf, 1);
if (buf != '\r') {
if (buf == '\t')
{
VirtSerial.println("ls cd remove password new password cat");
if (buf == '\t') {
VirtSerial.println(
"ls cd remove password new password cat");
}
cmdbuf[i] = buf;
VirtSerial.write(buf);
chars_read++;
......@@ -208,6 +208,7 @@ void start_console(void) {
void setup(void) {
VirtSerial.begin(9600);
// while (!USBComposite);
// HID.begin(HID_BOOT_KEYBOARD);
......@@ -216,16 +217,30 @@ void setup(void) {
initOled();
printLogoDisplay();
delay(2000);
delay(500);
initSDCard(1);
printLogoSerial();
delay(200);
printDebugString("wait for serial");
while (!VirtSerial.available()) {
if (millis()%100==0)
{
VirtSerial.print('\t');
}
}
printDebugString("serial done");
delay(200);
VirtSerial.flush();
printLogoSerial();
curDir = SD.open("/");
start_console();
}
void loop(void) {}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment