mirror of
https://github.com/esp8266/Arduino.git
synced 2025-07-27 18:02:17 +03:00
Migrate from astyle to clang-format (#8464)
This commit is contained in:
committed by
Max Prokhorov
parent
46190b61f1
commit
19b7a29720
@ -48,9 +48,7 @@ void loop() {
|
||||
for (int analogPin = 0; analogPin < 3; analogPin++) {
|
||||
int sensor = analogRead(analogPin);
|
||||
dataString += String(sensor);
|
||||
if (analogPin < 2) {
|
||||
dataString += ",";
|
||||
}
|
||||
if (analogPin < 2) { dataString += ","; }
|
||||
}
|
||||
|
||||
// open the file. note that only one file can be open at a time,
|
||||
@ -65,16 +63,5 @@ void loop() {
|
||||
Serial.println(dataString);
|
||||
}
|
||||
// if the file isn't open, pop up an error:
|
||||
else {
|
||||
Serial.println("error opening datalog.txt");
|
||||
}
|
||||
else { Serial.println("error opening datalog.txt"); }
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -45,17 +45,11 @@ void setup() {
|
||||
|
||||
// if the file is available, write to it:
|
||||
if (dataFile) {
|
||||
while (dataFile.available()) {
|
||||
Serial.write(dataFile.read());
|
||||
}
|
||||
while (dataFile.available()) { Serial.write(dataFile.read()); }
|
||||
dataFile.close();
|
||||
}
|
||||
// if the file isn't open, pop up an error:
|
||||
else {
|
||||
Serial.println("error opening datalog.txt");
|
||||
}
|
||||
}
|
||||
|
||||
void loop() {
|
||||
else { Serial.println("error opening datalog.txt"); }
|
||||
}
|
||||
|
||||
void loop() {}
|
||||
|
@ -66,6 +66,3 @@ void setup() {
|
||||
void loop() {
|
||||
// nothing happens after setup finishes.
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -57,9 +57,7 @@ void setup() {
|
||||
Serial.println("test.txt:");
|
||||
|
||||
// read from the file until there's nothing else in it:
|
||||
while (myFile.available()) {
|
||||
Serial.write(myFile.read());
|
||||
}
|
||||
while (myFile.available()) { Serial.write(myFile.read()); }
|
||||
// close the file:
|
||||
myFile.close();
|
||||
} else {
|
||||
@ -71,5 +69,3 @@ void setup() {
|
||||
void loop() {
|
||||
// nothing happens after setup
|
||||
}
|
||||
|
||||
|
||||
|
@ -52,14 +52,12 @@ void loop() {
|
||||
void printDirectory(File dir, int numTabs) {
|
||||
while (true) {
|
||||
|
||||
File entry = dir.openNextFile();
|
||||
if (! entry) {
|
||||
File entry = dir.openNextFile();
|
||||
if (!entry) {
|
||||
// no more files
|
||||
break;
|
||||
}
|
||||
for (uint8_t i = 0; i < numTabs; i++) {
|
||||
Serial.print('\t');
|
||||
}
|
||||
for (uint8_t i = 0; i < numTabs; i++) { Serial.print('\t'); }
|
||||
Serial.print(entry.name());
|
||||
if (entry.isDirectory()) {
|
||||
Serial.println("/");
|
||||
@ -70,7 +68,7 @@ void printDirectory(File dir, int numTabs) {
|
||||
Serial.print(entry.size(), DEC);
|
||||
time_t cr = entry.getCreationTime();
|
||||
time_t lw = entry.getLastWrite();
|
||||
struct tm * tmstruct = localtime(&cr);
|
||||
struct tm* tmstruct = localtime(&cr);
|
||||
Serial.printf("\tCREATION: %d-%02d-%02d %02d:%02d:%02d", (tmstruct->tm_year) + 1900, (tmstruct->tm_mon) + 1, tmstruct->tm_mday, tmstruct->tm_hour, tmstruct->tm_min, tmstruct->tm_sec);
|
||||
tmstruct = localtime(&lw);
|
||||
Serial.printf("\tLAST WRITE: %d-%02d-%02d %02d:%02d:%02d\n", (tmstruct->tm_year) + 1900, (tmstruct->tm_mon) + 1, tmstruct->tm_mday, tmstruct->tm_hour, tmstruct->tm_min, tmstruct->tm_sec);
|
||||
|
Reference in New Issue
Block a user