X-Git-Url: https://vault307.fbx.one/gitweb/micorpython_ir.git/blobdiff_plain/2ebf5db498266618fc0f037469309a6ea1906304..8a8fc29645419e7830d9709b8aad9787576821e2:/ir_tx/rp2_rmt.py diff --git a/ir_tx/rp2_rmt.py b/ir_tx/rp2_rmt.py index 7b42fa8..2848419 100644 --- a/ir_tx/rp2_rmt.py +++ b/ir_tx/rp2_rmt.py @@ -82,10 +82,13 @@ class RP2_RMT: if d == 0: break if check: - # Discard any trailing mark which would leave carrier on. + # Pulse train must end with a space otherwise we leave carrier on. + # So, if it ends with a mark, append a space. Note __init__.py + # ensures that there is room in array. if (x & 1): - x -= 1 - ar[x] = 0 + ar[x] = 1 # space. Duration doesn't matter. + x += 1 + ar[x] = 0 # STOP self.icm = x # index of 1st STOP mv = memoryview(ar) n = min(x, 4) # Fill FIFO if there are enough data points.