Damien George
3771a097da
stmhal: Improve USART class, to be more like SPI and I2C.
...
The three classes I2C, SPI and USART now have a fairly uniform (Python)
API. All are constructed, initialised and deinitialised in the same
way. They can have most of their parameters set, using keyword arguments.
All have send and recv (although slightly different with I2C requiring an
address in master mode). recv can do inplace receiving (ie store the
data in a previously-created bytearray).
It's just polling mode at the moment, but interrupt and DMA would be
nice to add.
2014-04-21 01:14:14 +01:00
Damien George
eb8bdf4df3
stmhal, SPI and I2C: Improvements to functionality and consistency.
2014-04-21 00:10:04 +01:00
Damien George
64ba6ca127
py: Small change to mp_arg_parse_all.
2014-04-21 00:09:44 +01:00
Damien George
643284fc8e
Merge branch 'master' of github.com:micropython/micropython
2014-04-20 19:08:46 +01:00
Damien George
ff91156d34
stmhal: Improved configurability for I2C and SPI busses.
...
The HAL handles for the I2C/SPI objects are rather large, so we don't
want to unnecessarily include them.
2014-04-20 19:06:15 +01:00
Paul Sokolovsky
26905259d0
objarray: Slice subscription operation: properly test for op subtype.
...
Also, checked that both bytearray and array.array actually support generic
(a-la list) slice assignment and deletion. Added TODOs.
2014-04-20 20:58:33 +03:00
Paul Sokolovsky
5b991ae2d3
gc: gc_realloc(): Fix byte-to-block calculation.
2014-04-20 20:46:39 +03:00
Damien George
2b925d7696
Merge branch 'fix-netduino-i2c-spi' of github.com:dhylands/micropython into dhylands-fix-netduino-i2c-spi
2014-04-20 18:32:17 +01:00
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
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