Assertion added to serial_usb driver in order to detect an anomalous condition.

git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@12528 110e8d01-0319-4d1e-a829-52ad28d1bb01
This commit is contained in:
Giovanni Di Sirio 2019-01-05 15:27:33 +00:00
parent a3653f3b16
commit 90ddeb9ef8
1 changed files with 4 additions and 5 deletions

View File

@ -188,12 +188,11 @@ static void obnotify(io_buffers_queue_t *bqp) {
/* Checking if there is already a transaction ongoing on the endpoint.*/
if (!usbGetTransmitStatusI(sdup->config->usbp, sdup->config->bulk_in)) {
/* Trying to get a full buffer.*/
/* Getting a full buffer, a buffer is available for sure because this
callback is invoked when one has been inserted.*/
uint8_t *buf = obqGetFullBufferI(&sdup->obqueue, &n);
if (buf != NULL) {
/* Buffer found, starting a new transaction.*/
usbStartTransmitI(sdup->config->usbp, sdup->config->bulk_in, buf, n);
}
osalDbgAssert(buf != NULL, "buffer not found");
usbStartTransmitI(sdup->config->usbp, sdup->config->bulk_in, buf, n);
}
}