Skip to content

Commit

Permalink
Fix use of old libftdi version
Browse files Browse the repository at this point in the history
  • Loading branch information
jlblancoc committed Jun 14, 2023
1 parent 5235dba commit bf7ab8b
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .lgtm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ extraction:
- "libopencv-dev"
- "libeigen3-dev"
- "libgtest-dev"
- "libftdi-dev"
- "libftdi1-dev"
- "freeglut3-dev"
- "zlib1g-dev"
- "libusb-1.0-0-dev"
Expand Down
2 changes: 1 addition & 1 deletion doc/source/compiling.rst
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ Minimum compiler requisites:
libxrandr-dev libxxf86vm-dev
# Support most common sensors:
sudo apt install libftdi-dev libusb-1.0-0-dev libudev-dev libfreenect-dev \
sudo apt install libftdi1-dev libusb-1.0-0-dev libudev-dev libfreenect-dev \
libdc1394-22-dev libavformat-dev libswscale-dev libpcap-dev \
liboctomap-dev libopenni2-dev
Expand Down
2 changes: 2 additions & 0 deletions doc/source/doxygen-docs/changelog.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
\page changelog Change Log

# Version 2.9.2: UNRELEASED
- Changes in docs:
- Update dependency in instructions from `libftdi-dev` to `libftdi1-dev`
- Changes in libraries:
- \ref mrpt_comms_grp
- mrpt::comms::CInterfaceFTDI Fix usage of deprecated API in libftdi
Expand Down
6 changes: 6 additions & 0 deletions libs/comms/src/CInterfaceFTDI_LIN.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -419,8 +419,14 @@ void CInterfaceFTDI::Purge()
auto* ctx = static_cast<ftdi_context*>(m_ftdi_context);
ASSERT_(ctx->usb_dev);

#if MRPT_FTDI_VERSION >= 0x120
if (ftdi_tcioflush(ctx) < 0)
#else
if (ftdi_usb_purge_buffers(ctx) < 0)
#endif
{
THROW_EXCEPTION("Error purging device buffers");
}

m_readBuffer.clear();
#endif
Expand Down

0 comments on commit bf7ab8b

Please sign in to comment.