소스 검색

Merge pull request #3569 from egbert-h/master

mstorage.c: fix the issue bug in_read_capacity()
Bernard Xiong 5 년 전
부모
커밋
664bc4e9d8
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      components/drivers/usb/usbdevice/class/mstorage.c

+ 1 - 1
components/drivers/usb/usbdevice/class/mstorage.c

@@ -426,7 +426,7 @@ static rt_size_t _read_capacity(ufunction_t func, ustorage_cbw_t cbw)
 
     data = (struct mstorage*)func->user_data;   
     buf = data->ep_in->buffer;    
-    sector_count = data->geometry.sector_count;
+    sector_count = data->geometry.sector_count - 1; /* Last Logical Block Address */
     sector_size = data->geometry.bytes_per_sector;
 
     buf[0] = sector_count >> 24;