Skip to content

Commit

Permalink
fix issue that cannot use uart after closing ftdi on Windows
Browse files Browse the repository at this point in the history
Signed-off-by: Clark Wang <[email protected]>
  • Loading branch information
wangxiaoningnxp committed Aug 18, 2020
1 parent 28c2f34 commit 972ad1c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion port.c
Original file line number Diff line number Diff line change
Expand Up @@ -137,13 +137,13 @@ int ft_open_channel(struct ftdi_info* fi, int channel)

int ft_close(struct ftdi_info* fi)
{
ft_set_bitmode(fi, 0, 0); //resetting the controller
#ifdef _WIN32
int num = fi->FT_close(fi->ftdi);
//printf("%d\n",num);
fi->isinit = 0;
return num;
#else
ft_set_bitmode(fi, 0, 0); //resetting the controller

if (fi->ftdi->usb_dev != NULL)
if (libusb_release_interface(fi->ftdi->usb_dev, fi->ftdi->interface) < 0)
Expand Down

0 comments on commit 972ad1c

Please sign in to comment.