Skip to content
Permalink
Browse files

grainuum-state: only call callback when send completes

Check the 'data finished' flag to see if we should call the callback.
Otherwise, save it for later.

Signed-off-by: Sean Cross <sean@xobs.io>
  • Loading branch information...
xobs committed Jun 13, 2017
1 parent 1598f92 commit 34da1455952964a0b8c21ccffd0820e3bfcd3041
Showing with 1 addition and 1 deletion.
  1. +1 −1 grainuum-state.c
@@ -84,7 +84,7 @@ static void grainuum_state_clear_tx(struct GrainuumState *state, int result)
struct GrainuumUSB *usb = state->usb;

/* If a thread is blocking, wake it up with a failure */
if (usb->cfg->sendDataFinished)
if (usb->cfg->sendDataFinished && state->packet_queued)
usb->cfg->sendDataFinished(usb, result);
state->data_out_left = 0;
state->data_out_max = 0;

0 comments on commit 34da145

Please sign in to comment.
You can’t perform that action at this time.