]> vault307.fbx.one Git - micorpython_ir.git/blobdiff - ir_rx/acquire.py
Philips RC5 TX: fix validation for RC5X.
[micorpython_ir.git] / ir_rx / acquire.py
index e8c6a1243b3174db935296a4f9d46b291d2546fa..af3ab38ba17ad61a46c58ff4700ef3a0c6f9fa5b 100644 (file)
@@ -70,8 +70,8 @@ class IR_GET(IR_RX):
                     print('Protocol start {} {} Burst length {} duration {}'.format(burst[0], burst[1], lb, duration))
                     ok = True
 
                     print('Protocol start {} {} Burst length {} duration {}'.format(burst[0], burst[1], lb, duration))
                     ok = True
 
-            if not ok and near(burst[0], 4500) and near(burst[1], 4500):  # Samsung?
-                print('Unsupported protocol. Samsung?')
+            if not ok and near(burst[0], 4500) and near(burst[1], 4500) and lb == 67:  # Samsung
+                print('Samsung')
                 ok = True
 
             if not ok and near(burst[0], 3500) and near(burst[1], 1680):  # Panasonic?
                 ok = True
 
             if not ok and near(burst[0], 3500) and near(burst[1], 1680):  # Panasonic?
@@ -101,6 +101,8 @@ def test():
         pin = Pin(13, Pin.IN)
     elif platform == 'esp32' or platform == 'esp32_LoBo':
         pin = Pin(23, Pin.IN)
         pin = Pin(13, Pin.IN)
     elif platform == 'esp32' or platform == 'esp32_LoBo':
         pin = Pin(23, Pin.IN)
+    elif platform == 'rp2':
+        pin = Pin(16, Pin.IN)
     irg = IR_GET(pin)
     print('Waiting for IR data...')
     irg = IR_GET(pin)
     print('Waiting for IR data...')
-    irg.acquire()
+    return irg.acquire()