Damien George
cb861a5c6a
stm[hal]: Init mp_sys_path and mp_sys_argv correctly.
11 years ago
Damien George
5bb7d99175
py: Modify makeqstrdata to recognise better the output of CPP.
11 years ago
Damien George
49f20b841d
py: Add more #if's for configurable MOD_SYS.
11 years ago
Damien George
640e7e4779
Merge pull request #476 from pfalcon/static-sys
Convert sys module to static allocation
11 years ago
Damien George
f95c68e536
Merge pull request #473 from pfalcon/list-extend-iter
objlist: Make .extend accept arbitrary iterable.
11 years ago
Damien George
b9e7ed4ebc
py: Oops, fix int.from_bytes to correctly convert bytes!
11 years ago
Damien George
5213eb35b5
py: Make int.from_bytes a classmethod; support arbitrary length buf.
11 years ago
Damien George
8a1cab952f
py: Fix mp_get_buffer, and use it in more places.
Must use mp_obj_get_type to get the type of an object. Can't assume
mp_obj_t is castable to mp_obj_base_t.
11 years ago
Damien George
4b01de44ba
py: Add traceback info to syntax errors.
Should fix issue #463 .
11 years ago
Damien George
3d484d9ad4
py: Update showbc to decode ptrs for MAKE_FUNCTION ops.
11 years ago
Damien George
0aab675108
stmhal: Little hack to dump GC allocation table using pyb.info().
Pass a single parameter (doesn't matter what): pyb.info(1), will dump
the GC alloc table.
11 years ago
Damien George
df8127a17e
py: Remove unique_codes from emitglue.c. Replace with pointers.
Attempt to address issue #386 . unique_code_id's have been removed and
replaced with a pointer to the "raw code" information. This pointer is
stored in the actual byte code (aligned, so the GC can trace it), so
that raw code (ie byte code, native code and inline assembler) is kept
only for as long as it is needed. In memory it's now like a tree: the
outer module's byte code points directly to its children's raw code. So
when the outer code gets freed, if there are no remaining functions that
need the raw code, then the children's code gets freed as well.
This is pretty much like CPython does it, except that CPython stores
indexes in the byte code rather than machine pointers. These indices
index the per-function constant table in order to find the relevant
code.
11 years ago
Paul Sokolovsky
68e7c5146c
py: Factor out impl of special methods for builtin types into opmethods.c
11 years ago
Paul Sokolovsky
036ad76659
objset: Implement __contains__() op-method.
11 years ago
Paul Sokolovsky
1a37588e35
py: Provide more details for too few and too much args for Python fun calls.
11 years ago
Paul Sokolovsky
48fdaad824
py: Rename collections module to _collections.
We're not going to implement all the plethora of types in there in C.
Funnily, CPython implements defaultdict in C, and namedtuple in Python.
11 years ago
Paul Sokolovsky
ef79a82cec
README: Update for modffi being enabled by default for unix port.
11 years ago
Paul Sokolovsky
4165cd1c0c
stmhal: Update for static mod sys.
11 years ago
Paul Sokolovsky
a3e50eacca
py: Move sys attribute qstrs's to core.
11 years ago
Paul Sokolovsky
5500cdeec7
py, unix: Convert sys module to static representation.
11 years ago
Paul Sokolovsky
18bef25a0c
objlist: Add support for statically allocated lists.
Similar to similar support for lists.
11 years ago
Paul Sokolovsky
f130ca1f60
py: Make bytes type hashable.
11 years ago
Paul Sokolovsky
73b7027b83
objstr: Add str.encode() and bytes.decode() methods.
These largely duplicate str() & bytes() constructors' functionality,
but can be used to achieve Python2 compatibility.
11 years ago
Paul Sokolovsky
aa6666c45e
objlist: Make .extend accept arbitrary iterable.
11 years ago
Damien George
fe6ded4d17
Merge pull request #472 from pfalcon/modffi-on
unix: Enable modffi by default.
11 years ago
Damien George
eb936189aa
Merge branch 'master' of github.com:micropython/micropython
11 years ago
Damien George
8721087661
py: Big improvements to inline assembler.
Improved the Thumb assembler back end. Added many more Thumb
instructions to the inline assembler. Improved parsing of assembler
instructions and arguments. Assembler functions can now be passed the
address of any object that supports the buffer protocol (to get the
address of the buffer). Added an example of how to sum numbers from
an array in assembler.
11 years ago
Paul Sokolovsky
9a092831f7
unix: Enable modffi by default.
ffi is needed to use micropython-lib, so let's have it enabled by default,
then folks who have troubles with libffi can disable it, instead of everyone
doing manual actions again and again.
11 years ago
Paul Sokolovsky
06526e7ccc
pip-micropython: Apply more workarounds for setuptools, pip, etc misfeatures.
11 years ago
Damien George
82c7b1b1d5
stmhal: Put a USB structure in ROM; GC doesn't scan the data segment.
11 years ago
Damien George
b14f2a0ba3
Update .gitignore to ignore __pycache__/.
11 years ago
Damien George
71dcd51989
examples: Add example script to flash an LED using inline assembler.
11 years ago
Damien George
6ce4277551
py: Make all LOAD_FAST ops check for unbound local.
This is necessary to catch all cases where locals are referenced before
assignment. We still keep the _0, _1, _2 versions of LOAD_FAST to help
reduced the byte code size in RAM.
Addresses issue #457 .
11 years ago
Damien George
c2803db010
tests: Add some bytecode tests.
11 years ago
Damien George
0a4c210586
Merge branch 'master' of github.com:micropython/micropython
11 years ago
Damien George
a26dc50968
py: Improve inline assembler; improve compiler constant folding.
11 years ago
Damien George
2813cb6043
py: Add 'static' to inline function MP_BOOL; remove category_t.
Small fixes to get it compiling with ARMCC. I have no idea why
category_t was in the enum definition for qstrs...
11 years ago
Paul Sokolovsky
a5afc9009f
builtinimport: Implement relative imports.
11 years ago
Paul Sokolovsky
faf84491ce
showbc: Add quotes around (some) string args, to show empty string properly.
11 years ago
Damien George
d6c5d398fe
Updated README.
11 years ago
Damien George
c557215822
Add 'bare-arm' port: the bare minimum to get it running on an ARM MCU.
11 years ago
Damien George
f7e4e1c2b4
py: Fix compiler warning when floats disabled.
11 years ago
Damien George
19b992a862
Merge branch 'master' of github.com:micropython/micropython
11 years ago
Paul Sokolovsky
42453dc98e
py: Make ImportError message match CPython's.
11 years ago
Paul Sokolovsky
2ff3d9d0b2
builtinimport: Set __path__ attribute ASAP as it's clear we have a package.
This helps with handling "recursive" imports in sane manner, for example
when foo/__init__.py has something like "from foo import submod".
11 years ago
Paul Sokolovsky
69f1867da5
builtinimport: Fix thinko passing 0 vs NULL.
11 years ago
Damien George
b96c7c03ca
stmhal: Move fatfs volume/partition lookup table to ROM.
11 years ago
Damien George
60427864b1
stmhal: Move I2C objects to ROM.
11 years ago
Damien George
8c63ef187d
Merge pull request #465 from xbe/unix-gc
unix: Fix GC not tracing .data
11 years ago
Damien George
8f19317540
py: Remove useless implementations of NOT_EQUAL in binary_op's.
I'm pretty sure these are never reached, since NOT_EQUAL is always
converted into EQUAL in mp_binary_op. No one should call
type.binary_op directly, they should always go through mp_binary_op
(or mp_obj_is_equal).
11 years ago