Commit 8c511e6975515989f0b257750ae283be5579e196
1 parent
840e89be
Ignore USB errors for bulkReadMulti after first packet
Showing
3 changed files
with
9 additions
and
6 deletions
openhantek/ChangeLog
openhantek/src/hantek/control.cpp
| ... | ... | @@ -193,8 +193,10 @@ namespace Hantek { |
| 193 | 193 | int lastCaptureState = captureState; |
| 194 | 194 | #endif |
| 195 | 195 | captureState = this->getCaptureState(); |
| 196 | + if(captureState < 0) | |
| 197 | + qWarning("Getting capture state failed: %s", Helper::libUsbErrorString(captureState).toLocal8Bit().data()); | |
| 196 | 198 | #ifdef DEBUG |
| 197 | - if(captureState != lastCaptureState) | |
| 199 | + else if(captureState != lastCaptureState) | |
| 198 | 200 | qDebug("Capture state changed to %d", captureState); |
| 199 | 201 | #endif |
| 200 | 202 | switch(captureState) { |
| ... | ... | @@ -271,8 +273,6 @@ namespace Hantek { |
| 271 | 273 | case CAPTURE_SAMPLING: |
| 272 | 274 | break; |
| 273 | 275 | default: |
| 274 | - if(captureState < 0) | |
| 275 | - qWarning("Getting capture state failed: %s", Helper::libUsbErrorString(captureState).toLocal8Bit().data()); | |
| 276 | 276 | break; |
| 277 | 277 | } |
| 278 | 278 | } | ... | ... |
openhantek/src/hantek/device.cpp
| ... | ... | @@ -397,10 +397,10 @@ namespace Hantek { |
| 397 | 397 | received += errorCode; |
| 398 | 398 | } |
| 399 | 399 | |
| 400 | - if(errorCode < 0) | |
| 401 | - return errorCode; | |
| 402 | - else | |
| 400 | + if(received > 0) | |
| 403 | 401 | return received; |
| 402 | + else | |
| 403 | + return errorCode; | |
| 404 | 404 | } |
| 405 | 405 | |
| 406 | 406 | /// \brief Control transfer to the oscilloscope. | ... | ... |