Paul Sokolovsky
3b74c91684
Makefiles: Support py/*.h includes per #1022 .
10 years ago
Paul Sokolovsky
8ab6f90674
py: Move to guarded includes for compile.h and related headers.
10 years ago
Paul Sokolovsky
343266ea51
showbc: Refactor to allow inline instruction printing.
10 years ago
Damien George
c55a4d82cf
py: Make bytes objs work with more str methods; add tests.
10 years ago
Paul Sokolovsky
7fdb8d78a4
tests: Add run-tests-exp.py, simple MicroPython-based test runner.
This script is rewrite of run-tests-exp.sh, and tries to achieve self-hosted
testsuite running in environments where neither CPython nor unix shell is
available. As run-tests-exp.sh, it requires complete set of .exp files
pre-generated with ./run-test --write-exp.
10 years ago
Damien George
f3a1d673de
stmhal: Enable ubinascii module, weak link to binascii.
10 years ago
Dave Hylands
90cd6cd987
docs: Add mention about using USB charger when resetting the filesystem.
It seems the Mac will happily wipe out at least some of the data on
a freshly reset filesytem, if the filesystem was reset while plugged
into the Mac.
10 years ago
Paul Sokolovsky
9c658b6afc
unix, windows: Add _os.system() call.
system() is the basic function to support automation of tasks, so have it
available builtin, for example, for bootstrapping rest of micropython
environment.
10 years ago
Damien George
a37656c132
docs: Make admonition for CPy-difference use "attention" class.
This renders it in yellow/orange box on RTD server.
10 years ago
Damien George
74eb44c392
py: Reduce size of VM exception stack element by 1 machine word.
This optimisation reduces the VM exception stack element (mp_exc_stack_t)
by 1 word, by using bit 1 of a pointer to store whether the opcode was a
FINALLY or WITH opcode. This optimisation was pending, waiting for
maturity of the exception handling code, which has now proven itself.
Saves 1 machine word RAM for each exception (4->3 words per exception).
Increases stmhal code by 4 bytes, and decreases unix x64 code by 32
bytes.
10 years ago
Damien George
81836c28b3
py: Use str_to_int function in more places to reduce code size.
10 years ago
Damien George
01039b5bd8
py: Remove last uses of printf from compile; use proper SyntaxError.
10 years ago
Damien George
584ba6762f
py: Move global/nonlocal decl code to compiler for proper SyntaxError.
This patch gives proper SyntaxError exceptions for bad global/nonlocal
declarations. It also reduces code size: 304 bytes on unix x64, 132
bytes on stmhal.
10 years ago
Damien George
b063b9b36d
py: Fix iteration over map in 2 places.
10 years ago
Damien George
7b80d908bf
docs: Add RTD local_settings file, to add custom templates.
10 years ago
Damien George
9b561a7c0d
docs: Add custom CSS file, with code for admonition.
10 years ago
Paul Sokolovsky
4b60b45bfc
stmhal: gccollect.h is superfluous in many places.
10 years ago
Paul Sokolovsky
6aaccc484c
stmhal: Use gc_dump_info() function instead of adhoc code.
10 years ago
Paul Sokolovsky
bf19586c53
stmhal: Include MICROPY_HAL_H only if defined.
Helps other ports.
10 years ago
Damien George
6efa66f125
py: Remove unnecessary RULE_none and PN_none from parser.
10 years ago
Damien George
b47ea4eadd
py: Add blank and ident flags to grammar rules to simplify parser.
This saves around 100 bytes code space on stmhal, more on unix.
10 years ago
Damien George
4fd7c1a2ac
tools, pyboard.py: Write data to pyboard in chunks of 256 bytes.
This speeds up writes significantly.
10 years ago
Damien George
2870d85a11
py: Save a few code bytes in parser; make vars local where possible.
10 years ago
Paul Sokolovsky
978f4ca2e1
run-tests: Allow to run testuite against Windows build on Linux (using Wine).
Just adjust line-endings of micropython.exe output, the rest should be
handled by Wine (automagically on properly configured distro).
To run:
MICROPY_MICROPYTHON=../windows/micropython.exe ./run-tests
10 years ago
stijn
f5efefd5a0
windows: Correctly interpret skipped tests, enable uhashlib and ubinascii
10 years ago
Damien George
6d3ae569cf
docs: Add CPy diff note for print_exception; embellish sys.platform.
10 years ago
Damien George
2a3e2b9033
py: Add execfile function (from Python 2); enable in stmhal port.
Adds just 60 bytes to stmhal binary. Addresses issue #362 .
10 years ago
Paul Sokolovsky
8427c5b76c
unix/windows: Make sure that process exit code is portable 8-bit value.
This fixes FORCED_EXIT internal flag leaking into Windows exit code.
10 years ago
Damien George
f04329e93b
lib/libm: Add acosh, asinh, atanh, tan; get working with stmhal.
acoshf, asinhf, atanhf were added from musl. mathsincos.c was
split up into its original, separate files (from newlibe-nano-2).
tan was added.
All of the important missing float functions are now implemented,
and pyboard now passes tests/float/math_fun.py (finally!).
10 years ago
Damien George
6936f4626c
tests: Get misc/print_exception and pyb/spi working on pyboard.
10 years ago
Paul Sokolovsky
c8b0229bc7
tests: sha256: skip test if uhashlib module is not available.
10 years ago
Gregory
5cf7ac7309
Fix leds.rst
N (mod 4) is 0..3
10 years ago
Paul Sokolovsky
9d944c7fb2
unix: Rename "time" module to "utime" to allow extensibility.
Name choosen per latest conventions and for compatibiity with stmhal port.
10 years ago
Damien George
9642846d71
docs: Define more clearly the behaviour of LED methods.
Addresses issue #1006 .
10 years ago
Paul Sokolovsky
0078561303
modffi: Support void (None) return value for Python callback functions.
10 years ago
Paul Sokolovsky
7a4765dbeb
tests: Add testcase for ffi callbacks.
10 years ago
Paul Sokolovsky
b62371e8fb
modffi: 64-bit cleanness (fixes actual bug in callback arg handling).
10 years ago
Paul Sokolovsky
c0bc3bd736
asmarm: Fix bug with encoding small negative ints using MVN instruction.
10 years ago
Paul Sokolovsky
83d27b0f0b
unix: Enable Thumb2 and ARM emitters by default on corresponding archs.
10 years ago
Paul Sokolovsky
138562ccd9
run-tests: Skip native/viper tests based on prefix.
Otherwise, new tests are forgotten to be added to explicit lists. Issue
found running on Debian/ARM.
10 years ago
Damien George
e181c0dc07
py: Fix optimised for-loop compiler so it follows proper semantics.
You can now assign to the range end variable and the for-loop still
works correctly. This fully addresses issue #565 .
Also fixed a bug with the stack not being fully popped when breaking out
of an optimised for-loop (and it's actually impossible to write a test
for this case!).
10 years ago
Damien George
7764f163fa
py: Fix label printing in showbc; print sp in vm trace.
10 years ago
Paul Sokolovsky
1ca28bd570
run-tests: Reset MICROPYPATH, to make sure tests use only builtin modules.
10 years ago
Paul Sokolovsky
dbc7854355
run-tests: PEP8 fix.
10 years ago
Paul Sokolovsky
f42b3c7599
tests: Activate recursive_data.py test, now that io.StringIO is available.
10 years ago
Damien George
5fba93a26b
tests: Add test for semantics of for-loop that optimisation can break.
10 years ago
Damien George
c33ce606cf
py: Fix a semantic issue with range optimisation.
Now you can assign to the range variable within the for loop and it will
still work.
Partially addresses issue #565 .
10 years ago
Damien George
f905145c6d
tests: Disable print_exception test when using native emitter.
10 years ago
Damien George
184182d14c
tests: Fix print_exception test and re-enable it on Travis CI.
Issue was with uPy: on local machine with micropython-lib installed, io
module is available. Not the case on Travis CI, where only _io module
is available in uPy.
10 years ago
Paul Sokolovsky
66a6caa307
run-tests: Skip print_exception.py on TravisCI, as it irreproducibly fails.
TODO: Figure out what's wrong on Travis.
10 years ago