summaryrefslogtreecommitdiffstatshomepage
path: root/stmhal/file.c
diff options
context:
space:
mode:
Diffstat (limited to 'stmhal/file.c')
-rw-r--r--stmhal/file.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/stmhal/file.c b/stmhal/file.c
index 3f7342bd6e..d09d0a0a89 100644
--- a/stmhal/file.c
+++ b/stmhal/file.c
@@ -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;
}