From 6ab7c181b6539d600dfd06d202948929589afaa9 Mon Sep 17 00:00:00 2001 From: dahanzimin <353767514@qq.com> Date: Tue, 3 Jun 2025 19:25:17 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=9B=B7=E8=BE=BE=E5=BA=93?= =?UTF-8?q?=E7=9A=84I2C=E5=94=A4=E9=86=92=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- boards/default_src/micropython/origin/build/lib/cbr817.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/boards/default_src/micropython/origin/build/lib/cbr817.py b/boards/default_src/micropython/origin/build/lib/cbr817.py index 553e06d2..37d93cf3 100644 --- a/boards/default_src/micropython/origin/build/lib/cbr817.py +++ b/boards/default_src/micropython/origin/build/lib/cbr817.py @@ -29,8 +29,6 @@ class CBR817: def __init__(self, i2c_bus, addr=CBR_ADDRESS, tx_power=3, threshold=5000, noise=256, delay=500, lock=500): self._device = i2c_bus self._address = addr - _str_i2c = str(self._device) #唤醒需要SCL管脚给高脉冲 - self._scl = Pin(int(_str_i2c[_str_i2c.find('=') + 1 : _str_i2c.find(",")]), Pin.OUT, Pin.OPEN_DRAIN) self._configure() self.tx_power(tx_power) @@ -49,8 +47,10 @@ class CBR817: def _wake(self): '''Wake up from low power consumption''' - self._scl.value(0) - time.sleep_us(10) + try: + self._wreg(CBR_SEL_REG, 0xC0) + except : + pass def threshold(self, value=None): self._wake()