mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2025-03-01 10:33:28 +00:00
Check _ftdic for null
This commit is contained in:
parent
db903cb539
commit
ba6feb81ce
@ -109,11 +109,13 @@ int ProviderFtdi::open()
|
|||||||
|
|
||||||
int ProviderFtdi::close()
|
int ProviderFtdi::close()
|
||||||
{
|
{
|
||||||
|
if (_ftdic != nullptr) {
|
||||||
Debug(_log, "Closing FTDI device");
|
Debug(_log, "Closing FTDI device");
|
||||||
ftdi_set_bitmode(_ftdic, 0x00, BITMODE_RESET);
|
ftdi_set_bitmode(_ftdic, 0x00, BITMODE_RESET);
|
||||||
ftdi_usb_close(_ftdic);
|
ftdi_usb_close(_ftdic);
|
||||||
ftdi_free(_ftdic);
|
ftdi_free(_ftdic);
|
||||||
_ftdic = nullptr;
|
_ftdic = nullptr;
|
||||||
|
}
|
||||||
return LedDevice::close();
|
return LedDevice::close();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user