| Age | Commit message (Collapse) | Author |
|
Addresses issue #1835.
|
|
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.
|
|
|
|
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.
|
|
Don't repeat MP_STATE_PORT(fs_user_mount), use local var.
|
|
Fixes use of uninitialized structure field by tinf_uncompress().
|
|
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.
|
|
|
|
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().
|
|
|
|
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
|
|
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.
|
|
With this patch the n_args parameter is changed type from mp_uint_t to
size_t.
|
|
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.
|
|
|
|
|
|
|
|
Function to actually spool output terminal data to dupterm object.
|
|
That's just function which sets/gets dup terminal object, and can be
easily reused across ports.
|
|
|
|
|
|
|
|
Any fields changed by asynchronous callbacks must be volatile.
|
|
Polling once in 100ms means dismal performance.
TODO: Propagate this pattern to other polling places.
|
|
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'
|
|
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.
|
|
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.
|
|
This leaves behind the common functionality in extmod/machine_mem.c
which can be used by all ports.
|
|
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.
|
|
|
|
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Contains implementation of ?: (non-capturing groups), ?? (non-greedy ?),
as well as much improved robustness, and edge cases and error handling by
Amir Plivatsky (@ampli).
|
|
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.
|
|
Since we now have it.
|
|
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.
|
|
Like foo.bar or foo->bar.
|
|
|
|
With MicroPython codestyle, with pointer casts, "*" packs with primary type
without space. Few other similar changes too (git diff -b -w is null).
|
|
Based on the original patch by Galen Hazelwood:
https://github.com/micropython/micropython/pull/1517 .
|
|
This is required to write structures to files, pass to FFI functions,
etc.
|
|
|
|
|