From d3e8d3a34139fd2cd26971f59684e7379c5956b4 Mon Sep 17 00:00:00 2001 From: LordGrey Date: Sat, 8 Apr 2023 10:55:40 +0000 Subject: [PATCH] Add wait in close() --- libsrc/leddevice/dev_ftdi/ProviderFtdi.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/libsrc/leddevice/dev_ftdi/ProviderFtdi.cpp b/libsrc/leddevice/dev_ftdi/ProviderFtdi.cpp index 8c8c3052..04320287 100644 --- a/libsrc/leddevice/dev_ftdi/ProviderFtdi.cpp +++ b/libsrc/leddevice/dev_ftdi/ProviderFtdi.cpp @@ -1,6 +1,7 @@ // LedDevice includes #include #include "ProviderFtdi.h" +#include #include #include @@ -110,7 +111,10 @@ int ProviderFtdi::open() int ProviderFtdi::close() { if (_ftdic != nullptr) { - Debug(_log, "Closing FTDI device"); + Debug(_log, "Closing FTDI device"); +// Delay to give time to push color black from writeBlack() into the led, +// otherwise frame transmission will be terminated half way through + wait(30); ftdi_set_bitmode(_ftdic, 0x00, BITMODE_RESET); ftdi_usb_close(_ftdic); ftdi_free(_ftdic);