Skip to content

Commit

Permalink
chore(arduino-modules): Fix mixed whitespace by removing random tab c…
Browse files Browse the repository at this point in the history
…hars (#448)

Fixes mixed whitespace in the eepromWriter script.
  • Loading branch information
morefigs authored Nov 6, 2023
1 parent 3ffeb07 commit ebc4bcf
Showing 1 changed file with 22 additions and 22 deletions.
44 changes: 22 additions & 22 deletions arduino-modules/eepromWriter/eepromWriter.ino
Original file line number Diff line number Diff line change
Expand Up @@ -26,42 +26,42 @@ void clear_port() {
}

void setup() {
Serial.begin(115200);
Serial.begin(115200);
Serial.setTimeout(30);
clear_port();
}

void loop() {
if (Serial.available() > 0) {
if (Serial.available() > 0) {
serial = "";
model = "";
reading_in_serial = true;
char val;
while (Serial.available() > 0) {
reading_in_serial = true;
char val;
while (Serial.available() > 0) {
delay(2);
val = Serial.read();
val = Serial.read();
if (val == '&') {
print_data();
clear_port();
return;
}
else if (val == ':'){
reading_in_serial = false;
}
else if (val == '\r' || val == '\n') {
// ignore newline and return characters
}
else if (reading_in_serial) {
serial += val;
}
else {
model += val;
}
}
else if (val == ':') {
reading_in_serial = false;
}
else if (val == '\r' || val == '\n') {
// ignore newline and return characters
}
else if (reading_in_serial) {
serial += val;
}
else {
model += val;
}
}
if (serial.length() && model.length()) {
memory.write_serial(serial);
memory.write_model(model);
memory.write_serial(serial);
memory.write_model(model);
}
Serial.println(); // acknowledgement
}
}
}

0 comments on commit ebc4bcf

Please sign in to comment.