Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
extmod/vfs_blockdev: Support bool return from Python read/write blocks.
Commit f4ab9d9 inadvertently broke some Python block devices, for example esp32 and stm32 SDCard classes. Those classes return a bool from their `readblocks` and `writeblocks` methods instead of an integer errno code. With that change, both `False` and `True` return values are now be interpreted as non-zero and hence the block device call fails. The fix in this commit is to allow a bool and explicitly convert `True` to 0 and `False` to `-MP_EIO`. Signed-off-by: Damien George <[email protected]>
- Loading branch information