Skip to content

Commit

Permalink
libtock-sync: console-write: use yield-waitfor
Browse files Browse the repository at this point in the history
  • Loading branch information
bradjc committed Jun 14, 2024
1 parent c734ec5 commit 48d5105
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions libtock-sync/interface/console.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,11 @@ returncode_t libtocksync_console_write(const uint8_t* buffer, uint32_t length, i
if (err != RETURNCODE_SUCCESS) return err;

// Wait for the callback.
yield_for(&result.fired);
if (result.result != RETURNCODE_SUCCESS) return result.result;
libtock_console_write_done_set_upcall(NULL, NULL);
yield_waitfor_return_t yval = yield_wait_for(DRIVER_NUM_CONSOLE, 1);
if (yval.data0 != RETURNCODE_SUCCESS) return yval.data0;

*written = result.length;
*written = yval.data1;
return RETURNCODE_SUCCESS;
}

Expand Down

0 comments on commit 48d5105

Please sign in to comment.