Commit Graph

19 Commits

Author SHA1 Message Date
Paul Sokolovsky
cd6d189f48 extmod/vfs_fat: Move listdir() method from stmhal for reuse. 2016-02-28 17:17:24 +02:00
Paul Sokolovsky
6b0c88256b extmod/vfs_fat_file: Reusable FatFs module, move from stmhal/file. 2016-02-15 00:16:46 +02:00
Damien George
b33a770596 extmod/fsusermount: Support mounting of multiple block devices.
This patch adds support to fsusermount for multiple block devices
(instead of just one).  The maximum allowed is fixed at compile time by
the size of the fs_user_mount array accessed via MP_STATE_PORT, which
in turn is set by MICROPY_FATFS_VOLUMES.

With this patch, stmhal (which is still tightly coupled to fsusermount)
is also modified to support mounting multiple devices   And the flash and
SD card are now just two block devices that are mounted at start up if
they exist (and they have special native code to make them more
efficient).
2016-02-10 23:40:10 +00:00
Damien George
34023eb673 stmhal: Add mount/umount/mkfs to os module. 2016-02-10 23:40:10 +00:00
Dave Hylands
f22844b4e5 stmhal: Add os.statvfs
Implement enough of statvfs to determine the amount of free
space on a volume.
2016-01-19 12:29:47 +00:00
Paul Sokolovsky
3a1bbcc2ef extmod: Move fsusermount.c from stmhal for cross-port reuse. 2015-11-25 13:19:36 +02:00
Damien George
83158e0e7f stmhal: Implement os.dupterm (was pyb.repl_uart).
pyb.repl_uart still exists but points to os.dupterm.
2015-10-19 21:57:41 +01:00
Damien George
f5d04750db stmhal: Put fs_user_mount pointer in root ptr section of global state.
Should fix issue #1393.
2015-07-27 23:52:56 +01:00
Josef Gajdusek
1db4253886 lib: Move time utility functions to common library. 2015-05-13 00:12:54 +01:00
Steve Zatz
c7df9c6c47 stmhal: Add os.rename function. 2015-05-12 23:43:11 +01:00
Damien George
95f53461c2 py: Replace py-version.sh with makeversionhdr.py, written in Python.
Also rename py-version.h to mpversion.h for consistency with mpconfig.h.
2015-04-28 23:52:36 +01:00
Damien George
d8837cea6f stmhal: Implement os.uname() to get details of OS and hardware. 2015-04-21 14:51:49 +00:00
Damien George
48ef64a729 stmhal: Make os.sync use disk_ioctl exclusively; reuse os.sync in pyb. 2015-03-04 20:38:28 +00:00
Damien George
4f94d90d4d stmhal: Include fatfs headers using lib/fatfs prefix.
This helps make files reusable across other ports.
2015-03-04 20:35:41 +00:00
Damien George
05005f679e py: Remove mp_obj_str_builder and use vstr instead.
With this patch str/bytes construction is streamlined.  Always use a
vstr to build a str/bytes object.  If the size is known beforehand then
use vstr_init_len to allocate only required memory.  Otherwise use
vstr_init and the vstr will grow as needed.  Then use
mp_obj_new_str_from_vstr to create a str/bytes object using the vstr
memory.

Saves code ROM: 68 bytes on stmhal, 108 bytes on bare-arm, and 336 bytes
on unix x64.
2015-01-21 23:18:02 +00:00
Damien George
2cf6dfa280 stmhal: Prefix includes with py/; remove need for -I../py. 2015-01-01 21:06:20 +00:00
Damien George
7690b13953 stmhal: Add ability to mount custom block device. 2014-12-27 20:20:51 +00:00
Damien George
3b603f29ec Use MP_DEFINE_CONST_DICT macro to define module dicts.
This is just a clean-up of the code.  Generated code is exactly the
same.
2014-11-29 14:39:27 +00:00
Damien George
136b5cbd76 stmhal: Rename module files to keep consistency with module name. 2014-10-12 20:24:55 +01:00