Clean USBDBG_FRAME_SIZE code.

This commit is contained in:
iabdalkader 2016-08-19 19:17:22 +02:00
parent 1142940b88
commit 5b8de6f867

View File

@ -92,11 +92,12 @@ void usbdbg_data_in(void *buffer, int length)
}
case USBDBG_FRAME_SIZE:
((uint32_t*)buffer)[0] = 0;
// Try to lock FB. If header size == 0 frame is not ready
if (mutex_try_lock(&JPEG_FB()->lock, MUTEX_TID_IDE)) {
// If header size == 0 frame is not ready
if (JPEG_FB()->size == 0) {
// Return 0
((uint32_t*)buffer)[0] = 0;
// unlock FB
mutex_unlock(&JPEG_FB()->lock, MUTEX_TID_IDE);
} else {