@@ -1,5 +1,6 @@
import usb.core
import usb.util
+import time
# Find our device
dev = usb.core.find(idVendor=0x1430, idProduct=0x0150)
@@ -10,5 +11,5 @@ try:
except:
pass
dev.ctrl_transfer(0x21, 9, wValue=0x0200, wIndex=0, data_or_wLength=b"C\xff\x00\x00", timeout=None)
-# time.sleep(1)
+time.sleep(0.001)
dev.ctrl_transfer(0x21, 9, wValue=0x0200, wIndex=0, data_or_wLength=b"J\x00\x00\xff\x00\x00\x10", timeout=None)
@@ -30,6 +30,9 @@ void virtual_portal_tick(void* ctx) {
VirtualPortal* virtual_portal = (VirtualPortal*)ctx;
(void)virtual_portal;
VirtualPortalLed* led = &virtual_portal->right;
+ if (!led->running) {
+ return;
+ }
uint32_t elapsed = furi_get_tick() - led->start_time;
if (elapsed < led->delay) {
float t_phase = fminf((float)elapsed / (float)led->delay, 1);