| Commit message (Collapse) | Author | Age |
|
|
|
|
| |
With so many config options it's good to (at least try to) keep them
grouped into logical sections.
|
|
|
|
|
|
| |
This patch fixes two main things:
- dicts can be printed directly using '%s' % dict
- %-formatting should not crash when passed a non-dict to, eg, '%(foo)s'
|
|
|
|
|
|
| |
Updated modbuiltin.c to add conditional support for 3-arg calls to
pow() using MICROPY_PY_BUILTINS_POW3 config parameter. Added support in
objint_mpz.c for for optimised implementation.
|
| |
|
|
|
|
|
| |
0j to the power of negative now raises ZeroDivisionError, and 0j to the
power of positive returns 0.
|
| |
|
| |
|
|
|
|
| |
E.g. uio.BytesIO(100) will allocate buffer with 100 bytes of space.
|
|
|
|
| |
This PR is to address issue #2812.
|
|
|
|
| |
Replaced by MICROPY_VFS and the VFS sub-system.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
A signal is like a pin, but ca also be inverted (active low). As such, it
abstracts properties of various physical devices, like LEDs, buttons,
relays, buzzers, etc. To instantiate a Signal:
pin = machine.Pin(...)
signal = machine.Signal(pin, inverted=True)
signal has the same .value() and __call__() methods as a pin.
|
|
|
|
|
| |
It should only be used for low-level things and with caution, for example
putting mounted VFS data in ROM or the static data section.
|
|
|
|
|
|
|
|
|
|
|
|
| |
This provides mp_vfs_XXX functions (eg mount, open, listdir) which are
agnostic to the underlying filesystem type, and just require an object with
the relevant filesystem-like methods (eg .mount, .open, .listidr) which can
then be mounted.
These mp_vfs_XXX functions would typically be used by a port to implement
the "uos" module, and mp_vfs_open would be the builtin open function.
This feature is controlled by MICROPY_VFS, disabled by default.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In this, don't allocate copy, just return non-empty string. This helps
with a standard pattern of buffering data in case of short reads:
buf = b""
while ...:
s = f.read(...)
buf += s
...
For a typical case when single read returns all data needed, there won't
be extra allocation. This optimization helps uasyncio.
|
|
|
|
|
|
| |
They are one-line functions and having them inline in mp_init/mp_deinit
eliminates the overhead of a function call, and matches how other state
is initialised in mp_init.
|
| |
|
|
|
|
|
|
|
|
| |
This is how CPython does it, and it's very useful to help users discover
the available modules for a given port, especially built-in and frozen
modules. The function does not list modules that are in the filesystem
because this would require a fair bit of work to do correctly, and is very
port specific (depending on the filesystem).
|
| |
|
|
|
|
|
| |
This builtin is configured using MICROPY_PY_BUILTINS_HELP, and is disabled
by default.
|
|
|
|
| |
To be implemented later.
|
|
|
|
|
|
|
| |
If result guaranteedly fits in a small int, it is handled in objint.c.
Otherwise, it is delegated to mp_obj_int_from_bytes_impl(), which should
be implemented by individual objint_*.c, similar to
mp_obj_int_to_bytes_impl().
|
| |
|
| |
|
|
|
|
|
| |
The if-block that this unreachable code is in has a condition "f>=5" so
"fp_isless1(f)" will always fail.
|
|
|
|
|
| |
Previouly, we had errors checked in callers, which led to duplicate code
or missing checks in some places.
|
| |
|
| |
|
| |
|
|
|
|
|
| |
This helps to improve code coverage. Note that most of the changes in
this patch are just de-denting the cases of the switch statements.
|
|
|
|
| |
In this case it's allowed to be ignored.
|
|
|
|
| |
Arguments to throw() for generators don't need to be exceptions.
|
|
|
|
|
|
| |
If GeneratorExit is injected as a throw-value then that should lead to
the close() method being called, if it exists. If close() does not exist
then throw() should not be called, and this patch fixes this.
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
The commit d9047d3c8a99603884db25076c37778f50633ca6 introduced a bug
whereby "from a.b import c" stopped working for frozen packages. This is
because the path was not properly truncated and became "a//b". Such a
path resolves correctly for a "real" filesystem, but not for a search in
the list of frozen modules.
|
|
|
|
| |
So that ports can pass their own custom options to mpy-cross.
|
| |
|
| |
|
|
|
|
|
| |
One never needs to format integers with a base larger than 16 (but code
can be easily extended beyond this value if needed in the future).
|
| |
|
| |
|
| |
|
|
|
|
|
| |
This function should be able to parse integers with any value for the
base, because it is called by int('xxx', base).
|
|
|
|
|
|
|
|
| |
UART REPL support was lost in os.dupterm() refactorings, etc. As
os.dupterm() is there, implement UART REPL support at the high level -
if MICROPY_STDIO_UART is set, make default boot.py contain os.dupterm()
call for a UART. This means that changing MICROPY_STDIO_UART value will
also require erasing flash on a module to force boot.py re-creation.
|
| |
|
|
|
|
|
| |
The lexer is very mature and this debug function is no longer used. If
it's really needed one can uncomment it and recompile.
|