system/fastboot: Fix error that download_size always be zero
Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
This commit is contained in:
parent
e6cedb8da7
commit
a413f6bcac
@ -557,6 +557,7 @@ static void fastboot_download(FAR struct fastboot_ctx_s *context,
|
|||||||
}
|
}
|
||||||
|
|
||||||
download = context->download_buffer;
|
download = context->download_buffer;
|
||||||
|
context->download_size = len;
|
||||||
|
|
||||||
while (len > 0)
|
while (len > 0)
|
||||||
{
|
{
|
||||||
@ -564,6 +565,7 @@ static void fastboot_download(FAR struct fastboot_ctx_s *context,
|
|||||||
download, len);
|
download, len);
|
||||||
if (r < 0)
|
if (r < 0)
|
||||||
{
|
{
|
||||||
|
context->download_size = 0;
|
||||||
fb_err("fastboot_download usb read error\n");
|
fb_err("fastboot_download usb read error\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -572,7 +574,6 @@ static void fastboot_download(FAR struct fastboot_ctx_s *context,
|
|||||||
download += r;
|
download += r;
|
||||||
}
|
}
|
||||||
|
|
||||||
context->download_size = len;
|
|
||||||
fastboot_okay(context, "");
|
fastboot_okay(context, "");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user