Damien George
dde739d364
py, gc: Further simplify coding-style of gc_realloc.
...
No logic changes, just coding style to make it easy to read.
2014-04-20 18:16:25 +01:00
Damien George
5f6a25fc50
py: Wrap #if's around emitter functions that are used only by emitcpy.
...
3 emitter functions are needed only for emitcpy, and so we can #if them
out when compiling with emitcpy support.
Also remove unused SETUP_LOOP bytecode.
2014-04-20 18:02:27 +01:00
Damien George
3558f62fb5
py: Making closures now passes pointer to stack, not a tuple for vars.
...
Closed over variables are now passed on the stack, instead of creating a
tuple and passing that. This way memory for the closed over variables
can be allocated within the closure object itself. See issue #510 for
background.
2014-04-20 17:50:40 +01:00
Paul Sokolovsky
bc5f0c1977
objclosure: Store reference to entire closed variables tuple.
...
Avoids pointer-to-field garbage collection issue. Fixes #510 .
2014-04-20 13:08:33 +03:00
Paul Sokolovsky
2758b7d3e2
objcell: Add disabled by default print method for debugging.
2014-04-20 13:08:33 +03:00
Paul Sokolovsky
c86889dafb
gc: "new" gc_realloc: Rewrite in plain C, fixing bunch of bugs.
...
There were typos, various rounding errors trying to do concurrent counting
in bytes vs blocks, complex conditional paths, superfluous variables, etc.,
etc., all leading to obscure segfaults.
2014-04-20 13:08:33 +03:00
Paul Sokolovsky
ed162b5ef2
gc: Recover simple gc_realloc implementation, make easier to switch between.
2014-04-20 13:08:33 +03:00
Paul Sokolovsky
9fd02e186d
modsocket: Add setblocking() method.
2014-04-20 13:08:33 +03:00
Paul Sokolovsky
0f836ef893
modstruct: Add 'O' typecode for passing mp_obj_t.
...
Useful as callback data, etc.
2014-04-20 13:08:33 +03:00
Paul Sokolovsky
4e4fa94c4c
modstruct: Use proper int accessor which checks input value type.
2014-04-20 13:08:33 +03:00
Ilya Dmitrichenko
8e998ed280
modffi: Fix how we call pkg-config
2014-04-20 09:30:46 +01:00
Dave Hylands
f70630c58f
Fix i2c and spi to compile for Netduino Plus 2
2014-04-20 00:06:03 -07:00
Damien George
53775026e7
Merge branch 'master' of github.com:micropython/micropython
2014-04-20 01:26:25 +01:00
Damien George
fd6925b4b9
stmhal: Small bug fixes and simplifications.
2014-04-20 01:25:58 +01:00
Damien George
f87b35e779
py: Fix mp_arg_parse_all.
2014-04-20 01:25:15 +01:00
Damien George
13c19c57a0
stmhal: Only init RNG if it's used.
2014-04-20 00:45:59 +01:00
Damien George
0a6e9f562f
stmhal: Update ExtInt to allow keyword arguments in constructor.
2014-04-20 00:38:50 +01:00
Damien George
57e415859a
stmhal: Tidy up and improve consistency across modules.
2014-04-20 00:30:09 +01:00
Damien George
d689430e79
stmhal: Add SPI class.
...
Also some updates to compile with latest changes to core py.
2014-04-20 00:16:30 +01:00
Damien George
c7c4a84397
stm: Update to compile with latest changes to core py.
2014-04-20 00:15:35 +01:00
Damien George
a3f94e0030
py: Add arg checking helper functions.
...
These are to assist in writing native C functions that take positional
and keyword arguments. mp_arg_check_num is for just checking the
number of arguments is correct. mp_arg_parse_all is for parsing
positional and keyword arguments with default values.
2014-04-20 00:13:22 +01:00
Paul Sokolovsky
efc36f0cea
test/class-super: Expose super() breakage.
2014-04-19 21:54:06 +03:00
Paul Sokolovsky
d6e12723ed
objarray: Implement slice subscription.
2014-04-19 20:06:57 +03:00
Paul Sokolovsky
9ae0912496
modffi: Update for MP_OBJ_STOP_ITERATION refactor.
2014-04-19 20:05:47 +03:00
Damien George
27dd471098
Merge branch 'master' of github.com:micropython/micropython
2014-04-19 02:18:19 +01:00
Damien George
3d19137442
stmhal: Add pyb.Pin.init method to re-init GPIO pin mode.
2014-04-19 02:17:57 +01:00
Damien George
6e44381cce
stmhal: Improve RTC class; make fatfs use RTC for time stamping files.
2014-04-19 02:17:30 +01:00
Damien George
ed5117f6a8
stmhal: Add pyb.unique_id, to get unique id of MCU.
2014-04-19 01:28:18 +01:00
Paul Sokolovsky
206dd2a905
stmhal: Update for mp_binary_get_size() refactor.
2014-04-19 03:27:37 +03:00
Paul Sokolovsky
6204460461
modstruct: Initial implementation of struct.pack().
2014-04-19 03:22:08 +03:00
Paul Sokolovsky
504e23388c
objstr: Init hash in mp_obj_str_builder_start() to 0.
2014-04-19 03:21:06 +03:00
Paul Sokolovsky
4602b9a79f
obj.h: Typo fix in comment.
2014-04-19 03:21:06 +03:00
Paul Sokolovsky
1355cf42f2
modstruct: Fix .calcsize() to account for struct type/alignment.
2014-04-19 03:21:06 +03:00
Paul Sokolovsky
5695e07256
modstruct: Support 'q' & 'Q' type codes.
2014-04-19 03:18:14 +03:00
Paul Sokolovsky
752d2080b7
modffi: Mark 'p' type spec deprecated, replace with 'P'.
...
'p' in struct module is "pascal string". 'P' is void*.
2014-04-19 03:18:14 +03:00
Damien George
44ee42de50
stmhal: Rename pyb.Led to pyb.LED to conform to naming rules.
...
It's Light Emitting Diode, so should be LED.
2014-04-19 00:54:33 +01:00
Damien George
8cf08a58a1
stmhal: Remove pyb.input (use sys.stdio.read(1) instead).
2014-04-19 00:50:50 +01:00
Damien George
f20e093b9b
stmhal: Add lots of constants to stm module.
2014-04-19 00:32:25 +01:00
Damien George
561f83c9cf
Merge branch 'master' of github.com:micropython/micropython
2014-04-18 23:35:24 +01:00
Damien George
38ae014e42
stmhal: Update ADC, DAC and I2C objects to use new buffer protocol.
...
Main reason for expanding buffer protocol API was to support writes to a
buffer in ADC module (see read_timed). With this change you can now
create an array of arbitrary type and ADC.read_timed will store into
that array in the correct format (byte, int, float). I wonder though if
all these changes were really worth it to support just this function.
Hopefully this enhanced buffer protocol API (with typecode specified)
will be used elsewhere.
2014-04-18 23:28:56 +01:00
Damien George
71e9bfa20d
py: Add mp_binary_set_val_array_from_int, to store an int directly.
2014-04-18 23:28:12 +01:00
Damien George
b11b85adaa
py: Allow to pass buffer protocol flags to get_buffer helper funcs.
2014-04-18 22:59:24 +01:00
Damien George
a8f5d15fc6
stmhal: Update help and comments re gpio changing to Pin.
2014-04-18 22:48:59 +01:00
Damien George
c66d86c5ce
stmhal: Big cleanup; merge gpio into Pin; make names consistent.
...
This is an attempt to clean up the Micro Python API on the pyboard.
Gpio functionality is now in the Pin object, which seems more natural.
Constants for MODE and PULL are now in pyb.Pin. Names of some
classes have been adjusted to conform to CamelCase. Other
miscellaneous changes and clean up here and there.
2014-04-18 22:38:09 +01:00
Damien George
738bdeb73a
unix: Update to use new buffer protocol interface with typecode.
2014-04-18 22:31:24 +01:00
Damien George
57a4b4f178
py: Add typecode to buffer protocol.
...
When querying an object that supports the buffer protocol, that object
must now return a typecode (as per binary.[ch]). This does not have to
be honoured by the caller, but can be useful for determining element
size.
2014-04-18 22:29:21 +01:00
Damien George
3fd2d7fad2
py: Tidy up function argument error messages.
...
We are not as verbose as CPython, and maybe a bit too cryptic sometimes.
2014-04-18 22:06:55 +01:00
Damien George
32ca164992
py: Tidy up array.array; add more error handling.
2014-04-18 22:04:06 +01:00
Paul Sokolovsky
0fc4775cd6
sequence: Further simplify sequence comparison.
2014-04-18 21:47:58 +03:00
Paul Sokolovsky
83eba5dec5
sequence: Fix glaring bug in sequence comparison.
2014-04-18 21:42:54 +03:00