bloguetronica / cp2130-qt

A C++ class that uses libusb to interface with CP2130 devices. It can be used to configure the OTP ROM of such devices, as well as to control them. The class was made for Qt. If you wish to use a derived non-Qt version, please refer to https://github.com/bloguetronica/cp2130.
0 stars 0 forks source link

Function spiWriteRead() should break on first error #35

Closed samuelfmlourenco closed 2 years ago

samuelfmlourenco commented 2 years ago

Following the issue reported at https://github.com/bloguetronica/cp2130-com/issues/15, spiWriteRead() should interrupt its execution and return when an error occurs. The validity of the returned vector is of no concern, because any filtering should be done by the caller.

This interruption on error is not required just for cosmetic reasons. With such break implemented, there is no excessive hanging while trying to retrieve results from an unresponsive device, and in case of error the returned vector would be invalid anyway, so there is no need to continue, which translates to increased responsiveness.

samuelfmlourenco commented 2 years ago

Fixed in version 2.2.4.