build(boards): xpython板卡执行 npm run build:prod

This commit is contained in:
王立帮
2025-04-29 01:02:04 +08:00
parent 10dd1a8489
commit 67bc986595
10 changed files with 12 additions and 10 deletions

View File

@@ -7,6 +7,7 @@ Micropython library for the IR-Remote/Timer(IR_RX&TX)
"""
import array, time, gc
from machine import Pin, Timer
from os import uname
try:
from esp32 import RMT
TX_MOED = 1
@@ -27,7 +28,7 @@ class IR_RX:
self._pulses = array.array('H')
self.code = [None, None, None, memoryview(self._pulses)] #存放[cmd, addr, data, pulses]
Pin(pin, Pin.IN).irq(handler=self._irq_cb, trigger=(Pin.IRQ_FALLING | Pin.IRQ_RISING))
Timer(timer_id).init(period=5, mode=Timer.PERIODIC, callback=self._timer_cb)
Timer(0 if "-C2" in uname().machine else timer_id).init(period=5, mode=Timer.PERIODIC, callback=self._timer_cb)
def _irq_cb(self, pin):
if not self._enable:
@@ -67,8 +68,8 @@ class IR_RX:
self._enable = onoff
class NEC_RX(IR_RX):
def __init__(self, pin, bits=None, callback=None):
super().__init__(pin, callback, timeout=15000)
def __init__(self, pin, bits=None, callback=None, timer_id=1):
super().__init__(pin, callback, timer_id=timer_id)
self._bits = bits
def decode(self):
@@ -103,8 +104,8 @@ class NEC_RX(IR_RX):
self.code[0:3] = None, None, value
class RC5_RX(IR_RX):
def __init__(self, pin, callback=None):
super().__init__(pin, callback, timeout=15000)
def __init__(self, pin, callback=None, timer_id=1):
super().__init__(pin, callback, timer_id=timer_id)
def decode(self):
pulse_len = len(self._pulses)

View File

@@ -363,11 +363,12 @@
"time",
"gc",
"machine",
"os",
"esp32",
"machine"
],
"__file__": true,
"__size__": 6913,
"__size__": 7002,
"__name__": "irremote.py"
},
"ltr308al": {