Mash tool: --poll flag for FastRIO bandwidth harvesting
Overrides the legacy 55ms analog poll interval (e.g. --poll 20 at 31250 -> ~50Hz analog). Summary's expected-poll-slots math follows. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -52,6 +52,7 @@ internal static class MashTest
|
|||||||
double wedgeSec = 2.0;
|
double wedgeSec = 2.0;
|
||||||
bool selftest = false;
|
bool selftest = false;
|
||||||
int baud = 9600;
|
int baud = 9600;
|
||||||
|
int pollMs = 55; // legacy cadence; FastRIO can sustain much faster
|
||||||
|
|
||||||
var positional = new List<string>();
|
var positional = new List<string>();
|
||||||
for (int i = 0; i < args.Length; i++)
|
for (int i = 0; i < args.Length; i++)
|
||||||
@@ -66,6 +67,8 @@ internal static class MashTest
|
|||||||
wedgeSec = w; i++; break;
|
wedgeSec = w; i++; break;
|
||||||
case "--baud" when i + 1 < args.Length && int.TryParse(args[i + 1], out int b):
|
case "--baud" when i + 1 < args.Length && int.TryParse(args[i + 1], out int b):
|
||||||
baud = b; i++; break;
|
baud = b; i++; break;
|
||||||
|
case "--poll" when i + 1 < args.Length && int.TryParse(args[i + 1], out int p) && p > 0:
|
||||||
|
pollMs = p; i++; break;
|
||||||
default: positional.Add(args[i]); break;
|
default: positional.Add(args[i]); break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -101,7 +104,7 @@ internal static class MashTest
|
|||||||
|
|
||||||
Raw($"== RIO mash test :: {port} @ {baud} 8N1, {seconds}s, chip label '{label}' ==");
|
Raw($"== RIO mash test :: {port} @ {baud} 8N1, {seconds}s, chip label '{label}' ==");
|
||||||
Raw($" lamp echo {(lampEcho ? "ON (drives reply/lamp collisions)" : "OFF")}, " +
|
Raw($" lamp echo {(lampEcho ? "ON (drives reply/lamp collisions)" : "OFF")}, " +
|
||||||
$"wedge threshold {wedgeSec:F1}s, app auto-recovery DISABLED");
|
$"wedge threshold {wedgeSec:F1}s, poll {pollMs}ms, app auto-recovery DISABLED");
|
||||||
Raw($" log: {Path.GetFullPath(logPath)}");
|
Raw($" log: {Path.GetFullPath(logPath)}");
|
||||||
|
|
||||||
IRioTransport transport;
|
IRioTransport transport;
|
||||||
@@ -120,6 +123,7 @@ internal static class MashTest
|
|||||||
var link = new RioSerialLink(transport, new RioSerialLinkOptions
|
var link = new RioSerialLink(transport, new RioSerialLinkOptions
|
||||||
{
|
{
|
||||||
AnalogRecoveryTimeout = TimeSpan.FromDays(365),
|
AnalogRecoveryTimeout = TimeSpan.FromDays(365),
|
||||||
|
AnalogPollInterval = TimeSpan.FromMilliseconds(pollMs),
|
||||||
});
|
});
|
||||||
|
|
||||||
// --- shared state (guarded by 'gate') ---------------------------------
|
// --- shared state (guarded by 'gate') ---------------------------------
|
||||||
@@ -308,7 +312,7 @@ internal static class MashTest
|
|||||||
|
|
||||||
// --- summary (fixed layout for diffing runs) ------------------------------
|
// --- summary (fixed layout for diffing runs) ------------------------------
|
||||||
double mins = Math.Max(sw.Elapsed.TotalMinutes, 0.001);
|
double mins = Math.Max(sw.Elapsed.TotalMinutes, 0.001);
|
||||||
long expectedPolls = (long)(seconds * 1000.0 / 55.0);
|
long expectedPolls = (long)(seconds * 1000.0 / pollMs);
|
||||||
bool anyWedge = wedges.Count > 0;
|
bool anyWedge = wedges.Count > 0;
|
||||||
bool endedWedged = wedges.Any(w => w.Unresolved);
|
bool endedWedged = wedges.Any(w => w.Unresolved);
|
||||||
bool anyButtonRevival = wedges.Any(w => w.RevivedByButton);
|
bool anyButtonRevival = wedges.Any(w => w.RevivedByButton);
|
||||||
|
|||||||
Reference in New Issue
Block a user