| Age | Commit message (Collapse) | Author |
|
* py: Only load frozen modules when the filename has the prefix.
This allows one to override a built-in module by loading a newer
version onto the file system.
* Unbreak mpys
|
|
The frozen module `_boot.py` was not being loaded on restart
because `pyexec_frozen_module()` did not know about the new `.frozen`
pseudo-directory. Updated lower-level routine to look in the right place.
Also made ".frozen" and related values be `#define`s.
|
|
Fixes #214
|
|
|
|
development) master.
cpx build compiles and loads and works in repl; test suite not run yet
esp8266 not tested yet
|
|
build (#199)
Reworked frozen module support: clean up makefiles and handle multiple directories.
Modules to freeze are included as git submodules.
Add neopixel to circuitplayground express build.
Fixes #56
|
|
This macro is provided by stmhal/mphalport.h and makes sure the addr and
size arguments are correctly aligned.
|
|
|
|
|
|
|
|
This allows the command to succeed without error even if there is no
$(BUILD)/build directory, which is the case for mpy-cross.
|
|
Per POSIX, this is EINVAL, so raises OSError(EINVAL).
|
|
For SEEK_SET, offset should be treated as unsigned, to allow full-width
stream sizes (e.g. 32-bit instead of 31-bit). This is now fully documented
in stream.h. Also, seek symbolic constants are added.
|
|
Too big positive, or too big negative offset values could lead to overflow
and address space wraparound and thus access to unrelated areas of memory
(a security issue).
|
|
The value of 0 can't be used because otherwise mp_binary_get_size will let
a null byte through as the type code (intepreted as byterray). This can
lead to invalid type-specifier strings being let through without an error
in the struct module, and even buffer overruns.
|
|
It enables all the DEBUG_printf outputs in the py/ source code.
|
|
Without bugfix:
struct.pack('>Q', 16)
b'\x00\x00\x00\x10\x00\x00\x00\x00'
With bugfix:
struct.pack('>Q', 16)
b'\x00\x00\x00\x00\x00\x00\x00\x10'
|
|
- Changed: ValueError, TypeError, NotImplementedError
- OSError invocations unchanged, because the corresponding utility
function takes ints, not strings like the long form invocation.
- OverflowError, IndexError and RuntimeError etc. not changed for now
until we decide whether to add new utility functions.
|
|
This introduces a skip_if module that can be used by tests to
determine when they should be skipped due to the environment.
Some tests have been split in order to have finer grained skip
control.
|
|
Implemented as a new MP_UNARY_OP. This patch adds support lists, dicts and
instances.
|
|
$(TOP) is defined in py/mkenv.mk and should be used to refer to the top
level of this repository.
|
|
This makes it clear when frozen modules are loaded as opposed to the empty path
which represents the current working directory. Furthermore, by splitting the two
apart this allows one to control in what order frozen modules are loaded.
This is a prerequisite for #56.
|
|
the state under which its being built. Instead, build it before running the subsequent make.
|
|
The main case to catch is invalid types for the containment operator, of
the form str.__contains__(non-str).
|
|
|
|
serial connection such as WebREPL.
Fixes #181.
|
|
This works for Unix and similar ports so far.
|
|
of stack in a different way.
|
|
"STATIC inline" can expand to "inline" if STATIC is defined to nothing, and
this case can lead to link errors.
|
|
There were several different spellings of MicroPython present in comments,
when there should be only one.
|
|
|
|
|
|
Before this patch raising a big-int to a negative power would just return
0. Now it returns a floating-point number with the correct value.
|
|
It's more efficient as an inline function, and saves code size.
|
|
|
|
Before this patch the mperrno.h file could be included and would silently
succeed with incorrect config settings, because mpconfig.h was not yet
included.
|
|
Otherwise they can interfere (eg redefinition of "abort") with other source
files in a given uPy port.
|
|
Add max stack usage tracking, visible via debug module ustack.
Add separate cpp flag for enabling modules: MICROPY_DEBUG_MODULES
|
|
|
|
|
|
Without this cast the print will give a wrong result on nan-boxing builds.
|
|
If constants (eg mp_const_none_obj) are placed in very high memory
locations that require 64-bits for the pointer then the assembler must be
able to emit instructions to move such pointers to one of the top 8
registers (ie r8-r15).
|
|
It's not used anywhere else in the VM loop, and clashes with (is shadowed
by) the n_state variable that's redeclared towards the end of the
mp_execute_bytecode function. Code size is unchanged.
|
|
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
|
|
1. Allow -Wlto-type-mismatch to be just a warning when building with frozen modules.
2. Fix extern decls that triggered -Wnested-externs when building with frozen modules.
3. Pass the correct value of -mlongint-impl to $(MPY_TOOL). New file mpconfigport.mk to do this.
|
|
gc_free() expects either NULL or a valid pointer into the heap, so the
checks for a valid pointer can be turned into assertions.
|
|
|
|
Adds nothing to the code size, since it uses existing empty slots in the
type structures.
|
|
|
|
Reduces code size.
|