Dave Hylands
3bbceeaaf7
Fix make-pins.py to support having multiple names for a pin.
...
SW and X17 now both map to PB3
2014-04-08 15:45:47 -07:00
Damien George
88d7bba961
py: Make it so that printing a small int does not allocate heap memory.
...
With the implementation of proper string formatting, code to print a
small int was delegated to mpz_as_str_inpl (after first converting the
small int to an mpz using stack memory). But mpz_as_str_inpl allocates
heap memory to do the conversion, so small ints needed heap memory just
to be printed.
This fix has a separate function to print small ints, which does not
allocate heap, and allocates less stack.
String formatting, printf and pfenv are now large beasts, with some
semi-duplicated code.
2014-04-08 23:30:46 +01:00
Damien George
803b9263ab
Merge branch 'master' of github.com:micropython/micropython
2014-04-08 23:11:51 +01:00
Damien George
eec91057b8
py: Add comment mpz function, and free memory used for string printing.
2014-04-08 23:11:00 +01:00
Paul Sokolovsky
a985b4593d
objint: Implement int.from_bytes() class method and .to_bytes() method.
...
These two are apprerently the most concise and efficient way to convert
int to/from bytes in Python. The alternatives are struct and array modules,
but methods using them are more verbose in Python code and less efficient
in memory/cycles.
2014-04-09 01:07:37 +03:00
Paul Sokolovsky
3aa8ee7c9e
py: Add mp_get_buffer(), mp_get_buffer_raise() convenience functions to API.
2014-04-09 01:07:37 +03:00
Damien George
2b0091983f
tests: Oops: fix del-attr.
2014-04-08 23:02:24 +01:00
Damien George
b04488151e
stmhal: Make USRSW re-register the EXTI callback each time it's set.
2014-04-08 22:35:42 +01:00
Damien George
348435d279
py: Reinstate old pfenv_print_int function for stmhal's printf.
2014-04-08 22:10:37 +01:00
Damien George
a9837bbf8b
py: Remove obsolete mp_delete_subscr declaration.
2014-04-08 22:06:31 +01:00
Damien George
f4c9b33abf
py: Remove DELETE_SUBSCR opcode, combine with STORE_SUBSCR.
...
This makes the runtime and object APIs more consistent. mp_store_subscr
functionality now moved into objects (ie list and dict store_item).
2014-04-08 21:32:29 +01:00
Damien George
4671392d90
Merge branch 'master' of github.com:micropython/micropython
2014-04-08 21:13:04 +01:00
Damien George
1d24ea5207
py: Finish implementation of all del opcodes.
...
At this point, all opcodes are now implemented!
Some del opcodes have been combined with store opcodes, with the value
to store being MP_OBJ_NULL.
2014-04-08 21:11:49 +01:00
Paul Sokolovsky
4dcb605ac4
py: Make bytearray a proper type.
2014-04-08 22:11:40 +03:00
Damien George
134c10e776
Merge branch 'master' of github.com:micropython/micropython
2014-04-08 18:29:50 +01:00
Damien George
47e1b85d9c
py: Improve inline assembler; add a few more opcodes.
2014-04-08 18:28:33 +01:00
Damien George
495d781a36
py: implement UNPACK_EX byte code (for: a, *b, c = d)
2014-04-08 17:51:47 +01:00
Paul Sokolovsky
f898a95cba
unix modffi: Support any object implementing buffer protocol as a native arg.
2014-04-08 19:08:34 +03:00
Paul Sokolovsky
7a70a3ae9a
bytes: Support buffer protocol.
2014-04-08 19:08:34 +03:00
Paul Sokolovsky
b9cf3d3730
bytearray: Support bytearray(int) constructor.
...
To create bytearray of given length.
2014-04-08 19:08:34 +03:00
Damien George
e753d916c0
py: Raise exception for unimplemented byte codes.
2014-04-08 16:49:28 +01:00
Damien George
b7ffdcc1c7
py: Improve compiler syntax errors; catch more errors.
2014-04-08 16:41:02 +01:00
Damien George
2137bc7124
stmhal: in EXTI interrupt handler wrap uPy calls in gc_lock and nlr_buf.
2014-04-08 15:21:26 +01:00
Damien George
72cfc6ef0a
unix: Oops, remove nlr_jump test in main.
2014-04-08 15:10:21 +01:00
Damien George
26cf55ae05
Add a check for NULL nlr_top in nlr_jump.
...
If no nlr_buf has been pushed, and an nlr_jump is called, then control
is transferred to nlr_jump_fail (which should bail out with a fatal
error).
2014-04-08 14:08:14 +00:00