summaryrefslogtreecommitdiffstatshomepage
path: root/stmhal/file.c
Commit message (Collapse)AuthorAge
* py: Make stream seek correctly check for ioctl fn; add seek for textio.Damien George2014-11-16
|
* stmhal: Switch to file.seek() implementation using stream ioctl.Paul Sokolovsky2014-11-17
|
* Implement kwargs for builtin open() and _io.FileIOstijn2014-10-21
| | | | | | | This makes open() and _io.FileIO() more CPython compliant. The mode kwarg is fully iplemented. The encoding kwarg is allowed but not implemented; mainly to allow the tests to specify encoding for CPython, see #874
* unix, stmhal: Implement file.readinto() method.Paul Sokolovsky2014-10-18
| | | | | | Also, usocket.readinto(). Known issue is that .readinto() should be available only for binary files, but micropython uses single method table for both binary and text files.
* Change some parts of the core API to use mp_uint_t instead of uint/int.Damien George2014-08-30
| | | | Addressing issue #50, still some way to go yet.
* py: Make MP_OBJ_NEW_SMALL_INT cast arg to mp_int_t itself.Damien George2014-07-31
| | | | Addresses issue #724.
* py: Change stream protocol API: fns return uint; is_text for text.Damien George2014-07-27
|
* stmhal: Add file.flush and os.stat.Damien George2014-07-19
|
* Rename machine_(u)int_t to mp_(u)int_t.Damien George2014-07-03
| | | | See discussion in issue #50.
* stmhal: Fix file print methods to use print instead of printf.Damien George2014-06-15
| | | | | Also make stdout_print_strn static (ultimately this function needs to be merged with stdout_tx_strn).
* stmhal, file: Seek to end of file if opened in 'a' mode.Damien George2014-06-11
|
* stmhal, file: Implement a,x,+ open modes, seek and tell.Damien George2014-06-11
| | | | | | Also now returns correct POSIX errno when an IO operation fails. Addresses issues #516 and #676.
* py: Implement proper separation between io.FileIO and io.TextIOWrapper.Paul Sokolovsky2014-05-19
| | | | | | | io.FileIO is binary I/O, ans actually optional. Default file type is io.TextIOWrapper, which provides str results. CPython3 explicitly describes io.TextIOWrapper as buffered I/O, but we don't have buffering support yet anyway.
* Add license header to (almost) all files.Damien George2014-05-03
| | | | | | | Blanket wide to all .c and .h files. Some files originating from ST are difficult to deal with (license wise) so it was left out of those. Also merged modpyb.h, modos.h, modstm.h and modtime.h in stmhal/.
* py, stream: Implement readlines for a stream.Damien George2014-05-03
|
* stmhal: Add SPI class.Damien George2014-04-20
| | | | Also some updates to compile with latest changes to core py.
* unix, stmhal: Consistently use "FileIO" as class name for file objects.Paul Sokolovsky2014-04-08
| | | | | They correspond to io.FileIO in io module hierarchy (with small caveat that io.FileIO is raw file and works with bytes, not strings).
* py: Replace stream_p with *stream_p in mp_obj_type_t.Damien George2014-04-05
| | | | | | | | This is to reduce ROM usage. stream_p is used in file and socket types only (at the moment), so seems a good idea to make the protocol functions a pointer instead of the actual structure. It saves 308 bytes of ROM in the stmhal/ port, 928 in unix/.
* Improve GC finalisation code; add option to disable it.Damien George2014-04-05
|
* stmhal: Reimplement file support using stream protocol API.Paul Sokolovsky2014-04-03
| | | | | This adds readline(), readall(), etc. methods. Also other fixes to make Python API compliant and "with" support.
* Merge map.h into obj.h.Damien George2014-03-30
| | | | | | Pretty much everyone needs to include map.h, since it's such an integral part of the Micro Python object implementation. Thus, the definitions are now in obj.h instead. map.h is removed.
* Remove mp_obj_type_t.methods entry and use .locals_dict instead.Damien George2014-03-26
| | | | | | | | | | | | | | | | | | | | | | Originally, .methods was used for methods in a ROM class, and locals_dict for methods in a user-created class. That distinction is unnecessary, and we can use locals_dict for ROM classes now that we have ROMable maps. This removes an entry in the bloated mp_obj_type_t struct, saving a word for each ROM object and each RAM object. ROM objects that have a methods table (now a locals_dict) need an extra word in total (removed the methods pointer (1 word), no longer need the sentinel (2 words), but now need an mp_obj_dict_t wrapper (4 words)). But RAM objects save a word because they never used the methods entry. Overall the ROM usage is down by a few hundred bytes, and RAM usage is down 1 word per user-defined type/class. There is less code (no need to check 2 tables), and now consistent with the way ROM modules have their tables initialised. Efficiency is very close to equivaluent.
* Change mp_method_t.name from const char * to qstr.Damien George2014-03-26
| | | | Addresses issue #377.
* stmhal: Add fatfs support, working with flash and SD card.Damien George2014-03-17