| Commit message (Collapse) | Author | Age |
|
|
|
|
| |
There were several different spellings of MicroPython present in comments,
when there should be only one.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The code conventions suggest using header guards, but do not define how
those should look like and instead point to existing files. However, not
all existing files follow the same scheme, sometimes omitting header guards
altogether, sometimes using non-standard names, making it easy to
accidentally pick a "wrong" example.
This commit ensures that all header files of the MicroPython project (that
were not simply copied from somewhere else) follow the same pattern, that
was already present in the majority of files, especially in the py folder.
The rules are as follows.
Naming convention:
* start with the words MICROPY_INCLUDED
* contain the full path to the file
* replace special characters with _
In addition, there are no empty lines before #ifndef, between #ifndef and
one empty line before #endif. #endif is followed by a comment containing
the name of the guard macro.
py/grammar.h cannot use header guards by design, since it has to be
included multiple times in a single C file. Several other files also do not
need header guards as they are only used internally and guaranteed to be
included only once:
* MICROPY_MPHALPORT_H
* mpconfigboard.h
* mpconfigport.h
* mpthreadport.h
* pin_defs_*.h
* qstrdefs*.h
|
|
|
|
|
| |
This builtin is configured using MICROPY_PY_BUILTINS_HELP, and is disabled
by default.
|
|
|
|
|
|
|
|
|
|
| |
import utimeq, utime
# Max queue size, the queue allocated statically on creation
q = utimeq.utimeq(10)
q.push(utime.ticks_ms(), data1, data2)
res = [0, 0, 0]
# Items in res are filled up with results
q.pop(res)
|
| |
|
| |
|
|
|
|
|
|
|
| |
In order to have more fine-grained control over how builtin functions are
constructed, the MP_DECLARE_CONST_FUN_OBJ macros are made more specific,
with suffix of _0, _1, _2, _3, _VAR, _VAR_BETEEN or _KW. These names now
match the MP_DEFINE_CONST_FUN_OBJ macros.
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
| |
While just a websocket is enough for handling terminal part of WebREPL,
handling file transfer operations requires demultiplexing and acting
upon, which is encapsulated in _webrepl class provided by this module,
which wraps a websocket object.
|
|
|
|
| |
These are *defined* per-port, but why redeclare them again and again.
|
| |
|
|
|
|
| |
Currently, only write support is implemented (of limited buffer size).
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
| |
With this patch the n_args parameter is changed type from mp_uint_t to
size_t.
|
| |
|
|
|
|
|
| |
Based on the original patch by Galen Hazelwood:
https://github.com/micropython/micropython/pull/1517 .
|
| |
|
| |
|
|
|
|
|
| |
Refactored from "stm" module, provides mem8, mem16, mem32 objects with
array subscript syntax.
|
| |
|
| |
|
|
|
|
|
|
| |
This patch consolidates all global variables in py/ core into one place,
in a global structure. Root pointers are all located together to make
GC tracing easier and more efficient.
|
|
|
|
| |
Addresses issue #1022.
|
|
|
|
| |
Adds just 60 bytes to stmhal binary. Addresses issue #362.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch adds a configuration option (MICROPY_CAN_OVERRIDE_BUILTINS)
which, when enabled, allows to override all names within the builtins
module. A builtins override dict is created the first time the user
assigns to a name in the builtins model, and then that dict is searched
first on subsequent lookups. Note that this implementation doesn't
allow deleting of names.
This patch also does some refactoring of builtins code, creating the
modbuiltins.c file.
Addresses issue #959.
|
| |
|
| |
|
|
|
|
| |
Addresses issue #934.
|
|
|
|
|
|
|
| |
This should be pretty compliant with CPython, except perhaps for some
corner cases to do with globals/locals context.
Addresses issue #879.
|
| |
|
| |
|
|
|
|
|
|
|
| |
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
|
| |
|
| |
|
|
|
|
| |
https://github.com/pfalcon/re1.5
|
|
|
|
|
| |
Also add start of ujson module with dumps implemented. Enabled in unix
and stmhal ports. Test passes on both.
|
| |
|
| |
|
|
|
|
| |
Part of code cleanup, working towards resolving issue #50.
|
| |
|
|
|
|
|
|
|
|
| |
reversed function now implemented, and works for tuple, list, str, bytes
and user objects with __len__ and __getitem__.
Renamed mp_builtin_len to mp_obj_len to make it publically available (eg
for reversed).
|
|
|
|
|
| |
And not system printf(), like it was before. For this, move pfenv_printf()
from stmhal port to py/.
|
|
|
|
|
| |
But much smaller and memory-efficient. Uses Python builtin data structures
(dict, tuple, int) to describe structure layout.
|
|
|
|
|
| |
.makefile() should allow to specify which stream time to create - byte
or text.
|
| |
|
| |
|
|
|
|
|
|
|
| |
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/.
|
|
|
|
| |
Addresses issue #487.
|