Skip to content

Commit 13d743d

Browse files
committed
mk_qd.py: Allow QD image lead-in to be configured on command line
1 parent a9b8f8d commit 13d743d

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

scripts/mk_qd.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
def main(argv):
1313
parser = argparse.ArgumentParser(
1414
formatter_class=argparse.ArgumentDefaultsHelpFormatter)
15+
parser.add_argument("--lead-in", type=float, default=0.5,
16+
help="lead-in, seconds")
1517
parser.add_argument("--window", type=float, default=5.5,
1618
help="data window, seconds")
1719
parser.add_argument("--total", type=float, default=8.0,
@@ -22,10 +24,10 @@ def main(argv):
2224
bit_ms = 0.004916
2325
total_bytes = int(args.total * 1000.0 / bit_ms / 8)
2426
window_bytes = int(args.window * 1000.0 / bit_ms / 8)
25-
init_bytes = int(500.0 / bit_ms / 8)
27+
init_bytes = int(args.lead_in * 1000.0 / bit_ms / 8)
2628

2729
assert (2*init_bytes + window_bytes) < total_bytes, "Window too large"
28-
print("Lead-In: %.2f sec -> %u bytes" % (0.5, init_bytes))
30+
print("Lead-In: %.2f sec -> %u bytes" % (args.lead_in, init_bytes))
2931
print("Window: %.2f sec -> %u bytes" % (args.window, window_bytes))
3032
print("TOTAL: %.2f sec -> %u bytes" % (args.total, total_bytes))
3133

0 commit comments

Comments
 (0)