Skip to content

Commit c6de848

Browse files
committed
Add CIRCUITPY-CHANGES back
1 parent 5616fc2 commit c6de848

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

extmod/vfs_blockdev.c

+4
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,8 @@ void mp_vfs_blockdev_init(mp_vfs_blockdev_t *self, mp_obj_t bdev) {
7878

7979
int mp_vfs_blockdev_read(mp_vfs_blockdev_t *self, size_t block_num, size_t num_blocks, uint8_t *buf) {
8080
if (self->flags & MP_BLOCKDEV_FLAG_NATIVE) {
81+
// CIRCUITPY-CHANGE: Pass the blockdev object into native readblocks so
82+
// it has the corresponding state.
8183
mp_uint_t (*f)(mp_obj_t self, uint8_t *, uint32_t, uint32_t) = (void *)(uintptr_t)self->readblocks[2];
8284
return f(self->readblocks[1], buf, block_num, num_blocks);
8385
} else {
@@ -110,6 +112,8 @@ int mp_vfs_blockdev_write(mp_vfs_blockdev_t *self, size_t block_num, size_t num_
110112
}
111113

112114
if (self->flags & MP_BLOCKDEV_FLAG_NATIVE) {
115+
// CIRCUITPY-CHANGE: Pass the blockdev object into native readblocks so
116+
// it has the corresponding state.
113117
mp_uint_t (*f)(mp_obj_t self, const uint8_t *, uint32_t, uint32_t) = (void *)(uintptr_t)self->writeblocks[2];
114118
return f(self->writeblocks[1], buf, block_num, num_blocks);
115119
} else {

0 commit comments

Comments
 (0)