Skip to content

Commit 5f07ed7

Browse files
committed
Fixed page read loop
1 parent d363c55 commit 5f07ed7

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

firmware/main.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -422,8 +422,6 @@ static int cmd_nand_read(usb_t *usb)
422422
CDC_Send_DATA(usb->tx_buf, resp_header_size + write_len);
423423

424424
page.offset += write_len;
425-
if (page.offset == chip_info->page_size)
426-
page.offset = 0;
427425
read_cmd->len -= write_len;
428426
}
429427

@@ -433,6 +431,7 @@ static int cmd_nand_read(usb_t *usb)
433431
if (prog_addr.addr >= chip_info->size)
434432
goto Error;
435433
page.page++;
434+
page.offset = 0;
436435
}
437436
}
438437

0 commit comments

Comments
 (0)