mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-31 12:21:35 +08:00
Read the full buffer
sizeof wont work here since file_buf is now a pointer
This commit is contained in:
@@ -432,8 +432,8 @@ PX4IO_Uploader::program(size_t fw_size)
|
|||||||
while (sent < fw_size) {
|
while (sent < fw_size) {
|
||||||
/* get more bytes to program */
|
/* get more bytes to program */
|
||||||
size_t n = fw_size - sent;
|
size_t n = fw_size - sent;
|
||||||
if (n > sizeof(file_buf)) {
|
if (n > PROG_MULTI_MAX) {
|
||||||
n = sizeof(file_buf);
|
n = PROG_MULTI_MAX;
|
||||||
}
|
}
|
||||||
count = read_with_retry(_fw_fd, file_buf, n);
|
count = read_with_retry(_fw_fd, file_buf, n);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user