summaryrefslogtreecommitdiff
path: root/shared-module/storage/__init__.c
diff options
context:
space:
mode:
authorScott Shawcroft <scott@tannewt.org>2019-02-19 14:45:45 -0800
committerScott Shawcroft <scott@tannewt.org>2019-02-21 10:45:41 -0800
commit1a0596a2fbb68c1285ec59606d03a610ee94ca47 (patch)
treeca91a0b4816a7703afbc98e63f22563d17e5569a /shared-module/storage/__init__.c
parentb1e8c4367987944c3faaad613142fec974840044 (diff)
Add option to disable the concurrent write protection
This allows writing to the filesystem from the host computer and CircuitPython by increasing the risk of filesystem corruption.
Diffstat (limited to 'shared-module/storage/__init__.c')
-rw-r--r--shared-module/storage/__init__.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/shared-module/storage/__init__.c b/shared-module/storage/__init__.c
index f09edd785..215e1356a 100644
--- a/shared-module/storage/__init__.c
+++ b/shared-module/storage/__init__.c
@@ -143,7 +143,7 @@ mp_obj_t common_hal_storage_getmount(const char *mount_path) {
return storage_object_from_path(mount_path);
}
-void common_hal_storage_remount(const char *mount_path, bool readonly) {
+void common_hal_storage_remount(const char *mount_path, bool readonly, bool disable_concurrent_write_protection) {
if (strcmp(mount_path, "/") != 0) {
mp_raise_OSError(MP_EINVAL);
}
@@ -156,7 +156,8 @@ void common_hal_storage_remount(const char *mount_path, bool readonly) {
}
#endif
- supervisor_flash_set_usb_writable(readonly);
+ filesystem_set_internal_writable_by_usb(readonly);
+ filesystem_set_internal_concurrent_write_protection(!disable_concurrent_write_protection);
}
void common_hal_storage_erase_filesystem(void) {