Damien George
78035b995f
py, compiler: Clean up and compress scope/compile structures.
Convert int types to uint where sensible, and then to uint8_t or
uint16_t where possible to reduce RAM usage.
11 years ago
Damien George
fc18c8e834
Merge branch 'master' of github.com:micropython/micropython
11 years ago
Damien George
a5c18f3285
stmhal: Update windows driver; \r\n newlines and addition USB id.
11 years ago
Paul Sokolovsky
03b9ad7b01
gc.c: Remove superfluous typedef (bute defined in misc.h).
11 years ago
Damien George
b99ca2cdde
stmhal: Add windows cdc .inf driver to flash filesystem.
11 years ago
Damien George
8e6f98b166
stmhal: Improve help() function.
11 years ago
Damien George
229347139b
stmhal: Add functionality to Servo object.
Can now calibrate, set pulse width, angle and speed.
11 years ago
Damien George
d9ec625d9a
Merge pull request #454 from dhylands/make-pins-multiple-named-pins
Fix make-pins.py to support having multiple names for a pin.
11 years ago
Dave Hylands
3bbceeaaf7
Fix make-pins.py to support having multiple names for a pin.
SW and X17 now both map to PB3
11 years ago
Paul Sokolovsky
2ee7304cb8
README: Python is required during build process unconditionally.
Fixes #449 .
11 years ago
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.
11 years ago
Damien George
803b9263ab
Merge branch 'master' of github.com:micropython/micropython
11 years ago
Damien George
eec91057b8
py: Add comment mpz function, and free memory used for string printing.
11 years ago
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.
11 years ago
Paul Sokolovsky
3aa8ee7c9e
py: Add mp_get_buffer(), mp_get_buffer_raise() convenience functions to API.
11 years ago
Damien George
2b0091983f
tests: Oops: fix del-attr.
11 years ago
Damien George
b04488151e
stmhal: Make USRSW re-register the EXTI callback each time it's set.
11 years ago
Damien George
348435d279
py: Reinstate old pfenv_print_int function for stmhal's printf.
11 years ago
Damien George
a9837bbf8b
py: Remove obsolete mp_delete_subscr declaration.
11 years ago
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).
11 years ago
Damien George
4671392d90
Merge branch 'master' of github.com:micropython/micropython
11 years ago
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.
11 years ago
Paul Sokolovsky
4dcb605ac4
py: Make bytearray a proper type.
11 years ago
Damien George
134c10e776
Merge branch 'master' of github.com:micropython/micropython
11 years ago
Damien George
47e1b85d9c
py: Improve inline assembler; add a few more opcodes.
11 years ago
Damien George
495d781a36
py: implement UNPACK_EX byte code (for: a, *b, c = d)
11 years ago
Paul Sokolovsky
f898a95cba
unix modffi: Support any object implementing buffer protocol as a native arg.
11 years ago
Paul Sokolovsky
7a70a3ae9a
bytes: Support buffer protocol.
11 years ago
Paul Sokolovsky
b9cf3d3730
bytearray: Support bytearray(int) constructor.
To create bytearray of given length.
11 years ago
Damien George
e753d916c0
py: Raise exception for unimplemented byte codes.
11 years ago
Damien George
b7ffdcc1c7
py: Improve compiler syntax errors; catch more errors.
11 years ago
Damien George
2137bc7124
stmhal: in EXTI interrupt handler wrap uPy calls in gc_lock and nlr_buf.
11 years ago
Damien George
72cfc6ef0a
unix: Oops, remove nlr_jump test in main.
11 years ago
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).
11 years ago
Damien George
094ebef259
windows: Use most of the source files from unix/ port.
To keep it maintainable, windows port now uses as much as possible from
unix port. Maybe could even use mpconfigport.h.
11 years ago
Damien George
73c79b9925
py: Continue line if last character is backslash.
11 years ago
Damien George
443e018a3f
py: Improve GC locking/unlocking, and make it part of the API.
11 years ago
Damien George
ff5639fd42
Merge pull request #451 from lurch/repr-fixes
Display \r and \t escape codes in string repr
11 years ago
Damien George
97790455fe
Improve REPL detecting when input needs to continue.
Full CPython compatibility with this requires actually parsing the
input so far collected, and if it fails parsing due to lack of tokens,
then continue collecting input. It's not worth doing it this way. Not
having compatibility at this level does not hurt the goals of Micro
Python.
11 years ago
Andrew Scheller
12968fb6b2
Display \r and \t escape codes in string repr
11 years ago
Paul Sokolovsky
72d70cb045
unix, stmhal: Consistently use "FileIO" as class name for file objects.
They correspond to io.FileIO in io module hierarchy (with small caveat
that io.FileIO is raw file and works with bytes, not strings).
11 years ago
Paul Sokolovsky
b8cf948550
unix, windows: There's no "help" builtin.
11 years ago
Damien George
a12a0f78b0
py: Rename pfenv_print_int to pfenv_print_mp_int, and add back former.
stmhal relies on pfenv_* to implement its printf. Thus, it needs a
pfenv_print_int which prints a proper 32-bit integer. With latest
change to pfenv, this function became one that took mp_obj_t, and
extracted the integer value from that object.
To fix temporarily, pfenv_print_int has been renamed to
pfenv_print_mp_int (to indicate it takes a mp_obj_t for the int), and
pfenv_print_int has been added (which takes a normal C int). Currently,
pfenv_print_int proxies to pfenv_print_mp_int, but this means it looses
the MSB. Need to find a way to fix this, but the only way I can think
of will duplicate lots of code.
11 years ago
Damien George
97543c5285
Merge pull request #447 from dhylands/str-format-mpz
Add string formatting support for longlong and mpz.
11 years ago
Dave Hylands
23dc6d0ace
Fix truncation problem when using longlong implementation.
11 years ago
Paul Sokolovsky
98dd6d7712
README: Be specific that ARMv7 Linux is supported.
11 years ago
Dave Hylands
c4029e5079
Add string formatting support for longlong and mpz.
11 years ago
Damien George
6827f9fc55
Add uPy welcome message to UNIX and Windows ports; update Teensy port.
Partly addresses issue #154 .
11 years ago
Damien George
6c6f9d6782
windows: Make it compile with latest changes to py core.
11 years ago
Damien George
10072b72a5
Merge pull request #439 from lurch/makefile-tweaks
Makefile tweaks
11 years ago