diff --git a/Auto_Seat.ino b/Auto_Seat.ino index 1d94471..9167f49 100644 --- a/Auto_Seat.ino +++ b/Auto_Seat.ino @@ -582,6 +582,7 @@ void printStatus(const __FlashStringHelper *tag) { Serial.print(F("[")); Serial.print(tag); Serial.println(F("]")); + printUptime(); Serial.print(F("raw=")); Serial.print(parkingRawValue); Serial.print(F(" ig=")); @@ -623,6 +624,26 @@ void printStatus(const __FlashStringHelper *tag) { Serial.println(autoCalibrationState); } +void printUptime() { + unsigned long totalMs = millis(); + unsigned long hours = totalMs / 3600000UL; + totalMs %= 3600000UL; + unsigned long minutes = totalMs / 60000UL; + totalMs %= 60000UL; + unsigned long seconds = totalMs / 1000UL; + unsigned long milliseconds = totalMs % 1000UL; + + Serial.print(F("uptime=")); + Serial.print(hours); + Serial.print(F("h ")); + Serial.print(minutes); + Serial.print(F("m ")); + Serial.print(seconds); + Serial.print(F("s ")); + Serial.print(milliseconds); + Serial.println(F("ms")); +} + void setRelay(int relayPin, boolean state) { digitalWrite(relayPin, state ? LOW : HIGH); } diff --git a/README.md b/README.md index 9a24fb4..cfbbf24 100644 --- a/README.md +++ b/README.md @@ -80,6 +80,12 @@ While debug mode is active, only `x` is accepted. Other input is ignored. Manual position commands `u`, `d`, and `p` are allowed while driving, as long as the controller is not busy with an in-progress movement. +Every status output includes boot uptime: + +```text +uptime=0h 2m 13s 457ms +``` + ## Automatic Calibration - Each `IG1 HIGH -> LOW` transition increments the EEPROM use counter. diff --git a/report.html b/report.html index 89bb4c6..b843482 100644 --- a/report.html +++ b/report.html @@ -224,6 +224,7 @@ when currentPosMs <= 0:
주의: 명령은 한 글자만 받습니다. debug, down, position 2000처럼 긴 문자열은 실행하지 않습니다.
모든 상태 출력에는 부팅 후 경과 시간이 uptime=0h 2m 13s 457ms 형식으로 포함됩니다. debug 출력에서도 1초마다 같은 형식으로 확인할 수 있습니다.