Skip to content

Commit 10ed330

Browse files
committed
libs/hardware/ir.py: NEC key value is incorrect.
When a duplicate code is encountered, incorrect NEC key value acquisition will occur. Signed-off-by: lbuque <[email protected]>
1 parent 8bd4d52 commit 10ed330

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

m5stack/libs/driver/ir/nec.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,9 @@ def decode(self, _):
102102
raise RuntimeError(self.BADADDR)
103103
addr |= val & 0xFF00 # pass assumed 16 bit address to callback
104104
self._addr = addr
105+
self._cmd = cmd
105106
except RuntimeError as e:
106-
cmd = e.args[0]
107+
cmd = self._cmd if e.args[0] == self.REPEAT else -1
107108
addr = self._addr if cmd == self.REPEAT else 0 # REPEAT uses last address
108109
# Set up for new data burst and run user callback
109110
self.do_callback(cmd, addr, 0, self.REPEAT)

m5stack/libs/hardware/ir.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@
66
M5.BOARD.M5AtomS3: (None, 4),
77
M5.BOARD.M5AtomS3Lite: (None, 4),
88
M5.BOARD.M5AtomS3U: (None, 12),
9+
M5.BOARD.M5Capsule: (None, 4),
10+
M5.BOARD.M5Cardputer: (None, 44),
11+
M5.BOARD.M5StickCPlus: (None, 9),
12+
M5.BOARD.M5StickC: (None, 9),
13+
M5.BOARD.M5StickCPlus2: (None, 19),
14+
M5.BOARD.M5AtomU: (None, 12),
915
}
1016

1117

0 commit comments

Comments
 (0)