mirror of
https://github.com/micropython/micropython.git
synced 2026-01-04 11:10:14 +01:00
stmhal: Detect disk full condition
This commit is contained in:
committed by
Damien George
parent
3cb804de26
commit
968b7dd173
@@ -88,6 +88,11 @@ STATIC mp_uint_t file_obj_write(mp_obj_t self_in, const void *buf, mp_uint_t siz
|
||||
*errcode = fresult_to_errno_table[res];
|
||||
return MP_STREAM_ERROR;
|
||||
}
|
||||
if (sz_out != size) {
|
||||
// The FatFS documentation says that this means disk full.
|
||||
*errcode = ENOSPC;
|
||||
return MP_STREAM_ERROR;
|
||||
}
|
||||
return sz_out;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user