Expand serial status field names
This commit is contained in:
+29
-29
@@ -583,26 +583,26 @@ void printStatus(const __FlashStringHelper *tag) {
|
||||
Serial.print(tag);
|
||||
Serial.println(F("]"));
|
||||
printUptime();
|
||||
printNamedInt(F("raw"), parkingRawValue);
|
||||
printNamedBool(F("ig"), ignitionState == HIGH);
|
||||
printNamedBool(F("p"), parkingState == HIGH);
|
||||
printNamedBool(F("rawDrive"), getRawDriveMode() == HIGH);
|
||||
printNamedBool(F("confirmedDrive"), confirmedDriveMode == HIGH);
|
||||
printNamedLong(F("currentMs"), currentPosMs);
|
||||
printNamedLong(F("targetMs"), targetPosMs);
|
||||
printNamedInt(F("parkingRawValue"), parkingRawValue);
|
||||
printNamedBool(F("ignition"), ignitionState == HIGH);
|
||||
printNamedBool(F("parking"), parkingState == HIGH);
|
||||
printNamedBool(F("rawDriveMode"), getRawDriveMode() == HIGH);
|
||||
printNamedBool(F("confirmedDriveMode"), confirmedDriveMode == HIGH);
|
||||
printNamedLong(F("currentPositionMs"), currentPosMs);
|
||||
printNamedLong(F("targetPositionMs"), targetPosMs);
|
||||
printNamedInt(F("savedPositionMs"), storedSeatPositionMs);
|
||||
printNamedInt(F("hardLimitMs"), SEAT_HARD_LIMIT_UP_MS);
|
||||
printNamedInt(F("requestedRelay"), requestedSeatAction);
|
||||
printNamedInt(F("actualRelay"), currentSeatAction);
|
||||
printNamedInt(F("hardLimitPositionMs"), SEAT_HARD_LIMIT_UP_MS);
|
||||
printNamedInt(F("requestedRelayAction"), requestedSeatAction);
|
||||
printNamedInt(F("actualRelayAction"), currentSeatAction);
|
||||
printNamedBool(F("manualMode"), manualMode);
|
||||
printNamedBool(F("stabilizing"), isStabilizing);
|
||||
Serial.print(F("useCount="));
|
||||
Serial.print(useCount);
|
||||
Serial.print(F("/"));
|
||||
Serial.println(USES_BEFORE_AUTO_CALIBRATION);
|
||||
printNamedBool(F("autoPending"), autoCalibrationPending);
|
||||
printNamedBool(F("forceCal"), forceCalibration);
|
||||
printNamedInt(F("autoCalState"), autoCalibrationState);
|
||||
printNamedBool(F("autoCalibrationPending"), autoCalibrationPending);
|
||||
printNamedBool(F("forceCalibration"), forceCalibration);
|
||||
printNamedInt(F("autoCalibrationState"), autoCalibrationState);
|
||||
printAutoCalibrationDelayStatus();
|
||||
}
|
||||
|
||||
@@ -610,26 +610,26 @@ void printDebugLine() {
|
||||
Serial.println();
|
||||
Serial.println(F("[DEBUG]"));
|
||||
printUptime();
|
||||
printNamedInt(F("raw"), parkingRawValue);
|
||||
printNamedBool(F("ig"), ignitionState == HIGH);
|
||||
printNamedBool(F("p"), parkingState == HIGH);
|
||||
printNamedBool(F("rawDrive"), getRawDriveMode() == HIGH);
|
||||
printNamedBool(F("confirmedDrive"), confirmedDriveMode == HIGH);
|
||||
printNamedLong(F("currentMs"), currentPosMs);
|
||||
printNamedLong(F("targetMs"), targetPosMs);
|
||||
printNamedInt(F("savedMs"), storedSeatPositionMs);
|
||||
printNamedInt(F("hardLimitMs"), SEAT_HARD_LIMIT_UP_MS);
|
||||
printNamedInt(F("requestedRelay"), requestedSeatAction);
|
||||
printNamedInt(F("actualRelay"), currentSeatAction);
|
||||
printNamedBool(F("manual"), manualMode);
|
||||
printNamedInt(F("parkingRawValue"), parkingRawValue);
|
||||
printNamedBool(F("ignition"), ignitionState == HIGH);
|
||||
printNamedBool(F("parking"), parkingState == HIGH);
|
||||
printNamedBool(F("rawDriveMode"), getRawDriveMode() == HIGH);
|
||||
printNamedBool(F("confirmedDriveMode"), confirmedDriveMode == HIGH);
|
||||
printNamedLong(F("currentPositionMs"), currentPosMs);
|
||||
printNamedLong(F("targetPositionMs"), targetPosMs);
|
||||
printNamedInt(F("savedPositionMs"), storedSeatPositionMs);
|
||||
printNamedInt(F("hardLimitPositionMs"), SEAT_HARD_LIMIT_UP_MS);
|
||||
printNamedInt(F("requestedRelayAction"), requestedSeatAction);
|
||||
printNamedInt(F("actualRelayAction"), currentSeatAction);
|
||||
printNamedBool(F("manualMode"), manualMode);
|
||||
printNamedBool(F("stabilizing"), isStabilizing);
|
||||
Serial.print(F("useCount="));
|
||||
Serial.print(useCount);
|
||||
Serial.print(F("/"));
|
||||
Serial.println(USES_BEFORE_AUTO_CALIBRATION);
|
||||
printNamedBool(F("autoPending"), autoCalibrationPending);
|
||||
printNamedBool(F("forceCal"), forceCalibration);
|
||||
printNamedInt(F("autoCalState"), autoCalibrationState);
|
||||
printNamedBool(F("autoCalibrationPending"), autoCalibrationPending);
|
||||
printNamedBool(F("forceCalibration"), forceCalibration);
|
||||
printNamedInt(F("autoCalibrationState"), autoCalibrationState);
|
||||
printAutoCalibrationDelayStatus();
|
||||
}
|
||||
|
||||
@@ -688,7 +688,7 @@ void printAutoCalibrationDelayStatusInline() {
|
||||
return;
|
||||
}
|
||||
|
||||
Serial.print(F(" autoCalOffTimer="));
|
||||
Serial.print(F("autoCalibrationOffTimer="));
|
||||
if (ignitionState == HIGH) {
|
||||
Serial.print(F("waiting_for_ig_off"));
|
||||
return;
|
||||
|
||||
@@ -34,8 +34,8 @@ Opening a USB serial connection can reset an Arduino Nano through DTR.
|
||||
If the board boots while `IG1 HIGH` and parking is OFF, the controller assumes the seat is already at the saved driving position:
|
||||
|
||||
```text
|
||||
currentMs = savedPositionMs
|
||||
targetMs = savedPositionMs
|
||||
currentPositionMs = savedPositionMs
|
||||
targetPositionMs = savedPositionMs
|
||||
relay = OFF
|
||||
```
|
||||
|
||||
@@ -85,23 +85,23 @@ Every status output uses one item per line and includes boot uptime:
|
||||
```text
|
||||
[STATUS]
|
||||
uptime=0h 2m 13s 457ms
|
||||
raw=1023
|
||||
ig=true
|
||||
p=true
|
||||
rawDrive=false
|
||||
confirmedDrive=false
|
||||
parkingRawValue=1023
|
||||
ignition=true
|
||||
parking=true
|
||||
rawDriveMode=false
|
||||
confirmedDriveMode=false
|
||||
```
|
||||
|
||||
If the use counter reached 10, status/debug output also includes the ignition-off calibration timer:
|
||||
|
||||
```text
|
||||
autoCalOffTimer=elapsed 0h 1m 20s 123ms remaining 0h 3m 39s 877ms
|
||||
autoCalibrationOffTimer=elapsed 0h 1m 20s 123ms remaining 0h 3m 39s 877ms
|
||||
```
|
||||
|
||||
If IG1 is still ON:
|
||||
|
||||
```text
|
||||
autoCalOffTimer=waiting_for_ig_off
|
||||
autoCalibrationOffTimer=waiting_for_ig_off
|
||||
```
|
||||
|
||||
Debug mode prints a readable block every second, one item per line. Boolean values are printed as `true` or `false`:
|
||||
@@ -109,22 +109,23 @@ Debug mode prints a readable block every second, one item per line. Boolean valu
|
||||
```text
|
||||
[DEBUG]
|
||||
uptime=0h 0m 5s 123ms
|
||||
raw=1023
|
||||
ig=true
|
||||
p=true
|
||||
rawDrive=false
|
||||
confirmedDrive=false
|
||||
currentMs=0
|
||||
targetMs=0
|
||||
savedMs=6000
|
||||
requestedRelay=0
|
||||
actualRelay=0
|
||||
manual=false
|
||||
parkingRawValue=1023
|
||||
ignition=true
|
||||
parking=true
|
||||
rawDriveMode=false
|
||||
confirmedDriveMode=false
|
||||
currentPositionMs=0
|
||||
targetPositionMs=0
|
||||
savedPositionMs=6000
|
||||
hardLimitPositionMs=6000
|
||||
requestedRelayAction=0
|
||||
actualRelayAction=0
|
||||
manualMode=false
|
||||
stabilizing=false
|
||||
useCount=0/10
|
||||
autoPending=false
|
||||
forceCal=false
|
||||
autoCalState=0
|
||||
autoCalibrationPending=false
|
||||
forceCalibration=false
|
||||
autoCalibrationState=0
|
||||
```
|
||||
|
||||
## Automatic Calibration
|
||||
@@ -136,8 +137,8 @@ autoCalState=0
|
||||
```text
|
||||
up 7000ms
|
||||
down 6000ms
|
||||
currentMs = 0
|
||||
targetMs = 0
|
||||
currentPositionMs = 0
|
||||
targetPositionMs = 0
|
||||
useCount = 0
|
||||
```
|
||||
|
||||
|
||||
+3
-3
@@ -225,8 +225,8 @@ when currentPosMs <= 0:
|
||||
</table>
|
||||
<p><span class="warn">주의:</span> 명령은 한 글자만 받습니다. <code>debug</code>, <code>down</code>, <code>position 2000</code>처럼 긴 문자열은 실행하지 않습니다.</p>
|
||||
<p>모든 상태 출력은 항목별 한 줄 형식이며, 부팅 후 경과 시간이 <code>uptime=0h 2m 13s 457ms</code> 형식으로 포함됩니다. debug 출력에서도 1초마다 같은 형식으로 확인할 수 있습니다.</p>
|
||||
<p>사용 횟수가 10회에 도달한 경우에만 보정 대기 타이머가 <code>autoCalOffTimer=elapsed 0h 1m 20s 123ms remaining 0h 3m 39s 877ms</code> 형식으로 추가 출력됩니다. IG1 ON 상태에서는 <code>autoCalOffTimer=waiting_for_ig_off</code>로 표시됩니다.</p>
|
||||
<p>debug 출력은 1초마다 항목별 한 줄 형식으로 표시되며, <code>ig=true</code>, <code>p=false</code>, <code>autoPending=false</code>처럼 bool 값은 <code>true</code>/<code>false</code>로 출력됩니다.</p>
|
||||
<p>사용 횟수가 10회에 도달한 경우에만 보정 대기 타이머가 <code>autoCalibrationOffTimer=elapsed 0h 1m 20s 123ms remaining 0h 3m 39s 877ms</code> 형식으로 추가 출력됩니다. IG1 ON 상태에서는 <code>autoCalibrationOffTimer=waiting_for_ig_off</code>로 표시됩니다.</p>
|
||||
<p>debug 출력은 1초마다 항목별 한 줄 형식으로 표시되며, <code>ignition=true</code>, <code>parking=false</code>, <code>autoCalibrationPending=false</code>처럼 bool 값은 <code>true</code>/<code>false</code>로 출력됩니다.</p>
|
||||
|
||||
<h2>5. 수동 위치 세팅 시뮬레이션</h2>
|
||||
<table>
|
||||
@@ -300,7 +300,7 @@ if useCount >= 10 and IG1 LOW for 5 minutes:
|
||||
</tr>
|
||||
<tr>
|
||||
<td>내부 위치값 범위 이탈</td>
|
||||
<td><code>currentMs</code>, <code>targetMs</code>를 0..6000으로 보정</td>
|
||||
<td><code>currentPositionMs</code>, <code>targetPositionMs</code>를 0..6000으로 보정</td>
|
||||
<td>시간 계산 오차나 상태 꼬임으로 인한 비정상 목표 방지</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
||||
Reference in New Issue
Block a user