aboutsummaryrefslogtreecommitdiff
path: root/extmod
AgeCommit message (Collapse)Author
2016-02-13extmod/fsusermount: umount: Add NULL pointer checks.Paul Sokolovsky
2016-02-10extmod/fsusermount: Move BP_IOCTL_xxx constants to fsusermount.h.Damien George
2016-02-10extmod/fsusermount: Support mounting of multiple block devices.Damien George
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-10extmod/fsusermount: Expose umount as a public function.Damien George
2016-02-10extmod/modmachine: Truncate integers that are to be stored using mem*.Damien George
Addresses issue #1835.
2016-02-10extmod/fsusermount: Change block protocol to support ioctl method.Damien George
The new block protocol is: - readblocks(self, n, buf) - writeblocks(self, n, buf) - ioctl(self, cmd, arg) The new ioctl method handles the old sync and count methods, as well as a new "get sector size" method. The old protocol is still supported, and used if the device doesn't have the ioctl method.
2016-02-10extmod/fsusermount: Implement separate umount() function.Paul Sokolovsky
2016-02-10extmod/fsusermount: Introduce separate mkfs() function.Paul Sokolovsky
Per the previously discussed plan. mount() still stays backward-compatible, and new mkfs() is rought and takes more args than needed. But is a step in a forward direction.
2016-02-06extmod/fsusermount: Common subexpression elimination.Paul Sokolovsky
Don't repeat MP_STATE_PORT(fs_user_mount), use local var.
2016-02-01extmod: Update uzlib to 1.2.2.Paul Sokolovsky
Fixes use of uninitialized structure field by tinf_uncompress().
2016-01-26extmod/modurandom: Add some extra random functions.Damien George
Functions added are: - randint - randrange - choice - random - uniform They are enabled with configuration variable MICROPY_PY_URANDOM_EXTRA_FUNCS, which is disabled by default. It is enabled for unix coverage build and stmhal.
2016-01-25extmod/moduhashlib: Use MICROPY_PY_UHASHLIB_SHA1 config define.Paul Sokolovsky
2016-01-24extmod/moduhashlib: Add support for SHA1 (based on axTLS).Paul Sokolovsky
SHA1 is used in a number of protocols and algorithm originated 5 years ago or so, in other words, it's in "wide use", and only newer protocols use SHA2. The implementation depends on axTLS enabled. TODO: Make separate config option specifically for sha1().
2016-01-17extmod/modurandom: Make yasmarang() function static.Paul Sokolovsky
2016-01-17extmod/modurandom: Add "urandom" module.Paul Sokolovsky
Seedable and reproducible pseudo-random number generator. Implemented functions are getrandbits(n) (n <= 32) and seed(). The algorithm used is Yasmarang by Ilya Levin: http://www.literatecode.com/yasmarang
2016-01-11py: Change first arg of type.make_new from mp_obj_t to mp_obj_type_t*.Damien George
The first argument to the type.make_new method is naturally a uPy type, and all uses of this argument cast it directly to a pointer to a type structure. So it makes sense to just have it a pointer to a type from the very beginning (and a const pointer at that). This patch makes such a change, and removes all unnecessary casting to/from mp_obj_t.
2016-01-11py: Change type signature of builtin funs that take variable or kw args.Damien George
With this patch the n_args parameter is changed type from mp_uint_t to size_t.
2016-01-11py: Change type of .make_new and .call args: mp_uint_t becomes size_t.Damien George
This patch changes the type signature of .make_new and .call object method slots to use size_t for n_args and n_kw (was mp_uint_t. Makes code more efficient when mp_uint_t is larger than a machine word. Doesn't affect ports when size_t and mp_uint_t have the same size.
2016-01-10extmod: Fix uctypes size calculation for bitfieldsDave Hylands
2016-01-03uctypes: Implement assignment for scalar arrayAntonin ENFRUN
2016-01-01extmod/moduos_dupterm: Handle exceptions in call to dupterm's .write()Paul Sokolovsky
2016-01-01extmod/moduos_dupterm: Make mp_uos_dupterm_tx_strn() function reusable.Paul Sokolovsky
Function to actually spool output terminal data to dupterm object.
2016-01-01extmod/moduos_dupterm: Make uos.dupterm() implementation reusable.Paul Sokolovsky
That's just function which sets/gets dup terminal object, and can be easily reused across ports.
2015-12-30extmod/modlwip: Use _ERR_BADF instead of magic number.Paul Sokolovsky
2015-12-30extmod/modlwip: Avoid magic numeric values in memcpy().Paul Sokolovsky
2015-12-30extmod/modlwip: User proper field name and value names for socket state.Paul Sokolovsky
2015-12-29extmod/modlwip: Mark some lwip_socket_obj_t's fields as volatile.Paul Sokolovsky
Any fields changed by asynchronous callbacks must be volatile.
2015-12-29extmod/modlwip: tcp_recv: Use more regular and responsive poll pattern.Paul Sokolovsky
Polling once in 100ms means dismal performance. TODO: Propagate this pattern to other polling places.
2015-12-26extmod/modubinascii: Add "separator" argument to hexlify().Paul Sokolovsky
This is extension to CPython, it allows to easily produce human-readable hex dump: >>> ubinascii.hexlify(b"\xaa\x55\xaa\x55", b" ") b'aa 55 aa 55'
2015-12-20extmod/moduhashlib: Add namespace prefix for crypto-algorithms/sha256.h.Paul Sokolovsky
Everyone loves to names similar things the same, then there're conflicts between different libraries. The namespace prefix used is "CRYAL_", which is weird, and that's good, as that minimizes chance of another conflict.
2015-12-18unix: machine_mem improvementsDave Hylands
This basically introduces the MICROPY_MACHINE_MEM_GET_READ_ADDR and MICROPY_MACHINE_MEM_GET_WRITE_ADDR macros. If one of them is not defined, then a default identity function is provided.
2015-12-13unix: Move modmachine into unix directoryDave Hylands
This leaves behind the common functionality in extmod/machine_mem.c which can be used by all ports.
2015-12-09extmod/moductypes: sizeof operation depends on layout type of structure.Paul Sokolovsky
Previously, sizeof() blindly assumed LAYOUT_NATIVE and tried to align size even for packed LAYOUT_LITTLE_ENDIAN & LAYOUT_BIG_ENDIAN. As sizeof() is implemented on a strucuture descriptor dictionary (not an structure object), resolving this required passing layout type around.
2015-12-04extmod/moductypes: set_aligned(): Handle INT64/UINT64.Paul Sokolovsky
2015-11-29py: Wrap all obj-ptr conversions in MP_OBJ_TO_PTR/MP_OBJ_FROM_PTR.Damien George
This allows the mp_obj_t type to be configured to something other than a pointer-sized primitive type. This patch also includes additional changes to allow the code to compile when sizeof(mp_uint_t) != sizeof(void*), such as using size_t instead of mp_uint_t, and various casts.
2015-11-29py: Add MP_ROM_* macros and mp_rom_* types and use them.Damien George
2015-11-29extmod/modmachine: Use uintptr_t instead of mp_uint_t for address type.Damien George
2015-11-25extmod/fsusermount: Make configurable with MICROPY_FSUSERMOUNT.Paul Sokolovsky
2015-11-25extmod: Move fsusermount.c from stmhal for cross-port reuse.Paul Sokolovsky
2015-11-23extmod/modure: Use correct integer type for n_args argument.Damien George
2015-11-04extmod/lwip: Change void pointers to unions, include new mphal.h fileGalen Hazelwood
2015-11-01extmod/re1.5: Workaround issue with mingw32-gcc 4.2.1.Paul Sokolovsky
2015-11-01extmod/modure: Make sure that errors in regexps are caught early.Paul Sokolovsky
2015-11-01extmod/re1.5: Update to 0.8.Paul Sokolovsky
Contains implementation of ?: (non-capturing groups), ?? (non-greedy ?), as well as much improved robustness, and edge cases and error handling by Amir Plivatsky (@ampli).
2015-10-31extmod/modlwip: socket->incoming changed by async callbacks, must be volatile.Paul Sokolovsky
Otherwise for code like: while (socket->incoming == NULL) { LWIP_DELAY(100); } a compiler may cache it in a register and it will be an infinite loop.
2015-10-28extmod/moductypes: When dealing with UINT64, use mp_obj_new_int_from_ull().Paul Sokolovsky
Since we now have it.
2015-10-27unix, stmhal: Introduce mp_hal_delay_ms(), mp_hal_ticks_ms().Paul Sokolovsky
These MPHAL functions are intended to replace previously used HAL_Delay(), HAL_GetTick() to provide better naming and MPHAL separation (they are fully equivalent otherwise). Also, refactor extmod/modlwip to use them.
2015-10-27extmod/modlwip: Codestyle: no need for () when taking address of primary expr.Paul Sokolovsky
Like foo.bar or foo->bar.
2015-10-27extmod/modlwip: lwip_tcp_send(): Common subexpression elimination, use MIN().Paul Sokolovsky
2015-10-27extmod/modlwip.c: Codestyle whitespace changes.Paul Sokolovsky
With MicroPython codestyle, with pointer casts, "*" packs with primary type without space. Few other similar changes too (git diff -b -w is null).