1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-07-02 14:22:55 +03:00

minor: examples: reorder functions for declarations prior to call (#6766)

* minor: reorder functions for declaration prior to call
harmless for arduino, helps with emulation on host or PIO

* fixes per review
This commit is contained in:
david gauchard
2019-11-14 02:35:30 +01:00
committed by Develo
parent 09896d5287
commit 2f26d94f64
2 changed files with 29 additions and 29 deletions

View File

@ -85,6 +85,16 @@ static bool time_machine_running = false;
// return 15000; // 15s
//}
#define PTM(w) \
Serial.print(" " #w "="); \
Serial.print(tm->tm_##w);
void printTm(const char* what, const tm* tm) {
Serial.print(what);
PTM(isdst); PTM(yday); PTM(wday);
PTM(year); PTM(mon); PTM(mday);
PTM(hour); PTM(min); PTM(sec);
}
void showTime() {
gettimeofday(&tv, nullptr);
@ -152,18 +162,6 @@ void showTime() {
Serial.println();
}
#define PTM(w) \
Serial.print(" " #w "="); \
Serial.print(tm->tm_##w);
void printTm(const char* what, const tm* tm) {
Serial.print(what);
PTM(isdst); PTM(yday); PTM(wday);
PTM(year); PTM(mon); PTM(mday);
PTM(hour); PTM(min); PTM(sec);
}
void time_is_set_scheduled() {
// everything is allowed in this function