8000 Update IR_TX Samsung32 Address Format · peterhinch/micropython_ir@d7ff5be · GitHub
[go: up one dir, main page]

Skip to content

Commit d7ff5be

Browse files
Update IR_TX Samsung32 Address Format
Builds different [addr] formats for the NEC or Samsung32 protocol. - NEC: 8 address bits + 8 inverted address bits - Samsung32: 8 address bits + 8 address bits This is based on the logic found in the FlipperZero IR Samsung Encoder: https://github.com/flipperdevices/flipperzero-firmware/blob/052237f8c9bb34bc244abcbf108cdf1ec6ec58ec/lib/infrared/encoder_decoder/samsung/infrared_encoder_samsung.c#L27-L31
1 parent cfb4d7a commit d7ff5be

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

ir_tx/nec.py

Lines changed: 4 additions & 1 deletion
7C58
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,10 @@ def tx(self, addr, data, _): # Ignore toggle
2727
else:
2828
self.append(9000, 4500)
2929
if addr < 256: # Short address: append complement
30-
addr |= ((addr ^ 0xff) << 8)
30+
if self.samsung:
31+
addr |= addr << 8
32+
else:
33+
addr |= ((addr ^ 0xff) << 8)
3134
for _ in range(16):
3235
self._bit(addr & 1)
3336
addr >>= 1

0 commit comments

Comments
 (0)
0