Skip to content

Commit

Permalink
grainuum-state: only call callback when send completes
Browse files Browse the repository at this point in the history
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 34da145
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion grainuum-state.c
Expand Up @@ -84,7 +84,7 @@ static void grainuum_state_clear_tx(struct GrainuumState *state, int result)
struct GrainuumUSB *usb = state->usb; struct GrainuumUSB *usb = state->usb;


/* If a thread is blocking, wake it up with a failure */ /* 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); usb->cfg->sendDataFinished(usb, result);
state->data_out_left = 0; state->data_out_left = 0;
state->data_out_max = 0; state->data_out_max = 0;
Expand Down

0 comments on commit 34da145

Please sign in to comment.