diff options
author | Diego Ismirlian <dismirlian@gmail.com> | 2019-09-30 18:36:18 -0300 |
---|---|---|
committer | Diego Ismirlian <dismirlian@gmail.com> | 2019-10-02 16:57:31 -0300 |
commit | 7c57d8a92488ecbcc7b29c7c9131ec41aceb6c17 (patch) | |
tree | 0c384861bae6f656ba4fd7edf1b16150192a1e3f | |
parent | 7a57cfe93d3123b6927c6eb886cd60ba60d1605f (diff) | |
download | ChibiOS-Contrib-7c57d8a92488ecbcc7b29c7c9131ec41aceb6c17.tar.gz ChibiOS-Contrib-7c57d8a92488ecbcc7b29c7c9131ec41aceb6c17.tar.bz2 ChibiOS-Contrib-7c57d8a92488ecbcc7b29c7c9131ec41aceb6c17.zip |
USBH: UVC: improve debug message
-rw-r--r-- | os/hal/src/usbh/hal_usbh_uvc.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/os/hal/src/usbh/hal_usbh_uvc.c b/os/hal/src/usbh/hal_usbh_uvc.c index 8c82554..3a8b488 100644 --- a/os/hal/src/usbh/hal_usbh_uvc.c +++ b/os/hal/src/usbh/hal_usbh_uvc.c @@ -181,7 +181,8 @@ static void _post(USBHUVCDriver *uvcdp, usbh_urb_t *urb, memory_pool_t *mp, uint usbhuvc_message_base_t *const new_msg = (usbhuvc_message_base_t *)chPoolAllocI(mp); if (new_msg != NULL) { /* allocated the new buffer, now try to post the message to the mailbox */ - if (chMBPostI(&uvcdp->mb, (msg_t)msg) == MSG_OK) { + msg_t r = chMBPostI(&uvcdp->mb, (msg_t)msg); + if (r == MSG_OK) { /* everything OK, complete the missing fields */ msg->type = type; msg->length = urb->actualLength; @@ -189,8 +190,12 @@ static void _post(USBHUVCDriver *uvcdp, usbh_urb_t *urb, memory_pool_t *mp, uint /* change the URB's buffer to the newly allocated one */ urb->buff = ((usbhuvc_message_data_t *)new_msg)->data; } else { + if (r == MSG_RESET) { + uurbwarn("UVC: error, mailbox reset"); + } else { + uurberr("UVC: error, mailbox overrun"); + } /* couldn't post the message, free the newly allocated buffer */ - uurberr("UVC: error, mailbox overrun"); chPoolFreeI(&uvcdp->mp_status, new_msg); } } else { |