Commit Graph

3732 Commits (64e8b622917156bfe3a7ca3698072188be1ab862)

Author SHA1 Message Date
Damien George 64e8b62291 docs: Bump version to 1.4. 2015-03-29 18:01:19 +01:00
Paul Sokolovsky ad038ca101 tests/class_descriptor.py: Fix line-endings (were CRLF). 2015-03-28 01:07:00 +02:00
stijn 28fa84b445 py: Add optional support for descriptors' __get__ and __set__ methods.
Disabled by default.  Enabled on unix and windows ports.
2015-03-26 23:55:14 +00:00
Paul Sokolovsky c260836beb docs: uctypes: Describe bytes_at(), bytearray_at(). 2015-03-27 00:19:23 +02:00
Daniel Campora 1eba62cac9 cc3200: Remove unneeded SPI instruction in the simplelink driver.
Setting the word count before a SPI transaction is only needed when
using DMA.
2015-03-26 20:50:39 +01:00
Daniel Campora 1826036a83 cc3200: Increase main stack size to 2K.
Increasing it from 1K to 2K gives more freedom to the callback
handlers, before this, simply nesting a function call into a
printf would cause a stack overflow.
2015-03-26 20:50:38 +01:00
Damien George 51229afbde py: Increase fixed size of stack-info in native emitter.
This is a temporary fix.
2015-03-26 17:54:12 +00:00
Damien George 4112590a60 py, compiler: When just bytecode, make explicit calls instead of table.
When just the bytecode emitter is needed there is no need to have a
dynamic method table for the emitter back-end, and we can instead
directly call the mp_emit_bc_XXX functions.  This gives a significant
reduction in code size and a very slight performance boost for the
compiler.

This patch saves 1160 bytes code on Thumb2 and 972 bytes on x86, when
native emitters are disabled.

Overall savings in code over the last 3 commits are:

bare-arm: 1664 bytes.
minimal:  2136 bytes.
stmhal:    584 bytes (it has native emitter enabled).
cc3200:   1736 bytes.
2015-03-26 16:52:45 +00:00
Damien George a210c774f9 py, compiler: Remove emit_pass1 code, using emit_bc to do its job.
First pass for the compiler is computing the scope (eg if an identifier
is local or not) and originally had an entire table of methods dedicated
to this, most of which did nothing.  With changes from previous commit,
this set of methods can be removed and the methods from the bytecode
emitter used instead, with very little modification -- this is what is
done in this commit.

This factoring has little to no impact on the speed of the compiler
(tested by compiling 3763 Python scripts and timing it).

This factoring reduces code size by about 270-300 bytes on Thumb2 archs,
and 400 bytes on x86.
2015-03-26 16:52:45 +00:00
Damien George 542bd6b4a1 py, compiler: Refactor load/store/delete_id logic to reduce code size.
Saves around 230 bytes on Thumb2 and 750 bytes on x86.
2015-03-26 16:52:45 +00:00
Daniel Campora 760a6eca9b cc3200: Minor refactorings on modwlan and pybsleep. 2015-03-26 14:27:21 +01:00
Daniel Campora 4be44014ab cc3200: Reenable active interrupts when waking from suspended mode. 2015-03-26 13:58:58 +01:00
Paul Sokolovsky 0090c714ba objdict: Cast mp_obj_t to concrete types explicitly.
Continuation of refactoring applied previously to objlist.
2015-03-26 12:28:56 +02:00
Daniel Campora 2d717ad97a cc3200: Add callback support to the UART for RX interrupts. 2015-03-26 10:28:43 +01:00
Daniel Campora e909e38871 cc3200: Remove superflous parameters from the SPI API. 2015-03-26 10:28:41 +01:00
Damien George 23d7fd526d tests: Skip some new tests when testing native emitter. 2015-03-25 23:33:48 +00:00
Damien George 214179b430 tests: Add tests for SyntaxError, TypeError, and other missing things.
This is intended to improve coverage of the test suite.
2015-03-25 23:10:09 +00:00
Damien George 44f65c0e2f py: Fix bug in compiler which allowed through illegal augmented assign.
It allowed such things as (a, b) += c.
2015-03-25 23:06:48 +00:00
Damien George 5e1d993f54 py: Clean up some logic in VM to remove assert(0)'s.
Saves around 30 bytes code on Thumb2 archs.
2015-03-25 22:20:37 +00:00
Damien George aedf583af2 py: Simplify some logic in compiler; add comments about CPython compat. 2015-03-25 22:06:47 +00:00
Daniel Campora 7f41f650de cc3200: Remove superflous params from the I2C API. 2015-03-25 16:56:14 +01:00
Daniel Campora 26d230419c cc3200: Add GPIO25 to the pins list of the WiPy and the WiPy-SD.
This allows to properly initialize the system led and add it
to the sleep module so that it can be restored when resuming
from suspended mode.
2015-03-25 15:22:32 +01:00
Daniel Campora 4729a212b1 cc3200: Rename the WiPy_SD to WiPy-SD. 2015-03-25 15:22:27 +01:00
Daniel Campora 684dba40f0 cc3200: Roll back to the previous telnet and ftp timeouts.
Unfortunately, these timeouts are the only realiable way (for now), to
be able to detect broken connections due to half-open sockets. Such a
thing occurs when getting out of the WiFi coverage area or when
disconnecting from the AP (sometimes the client doesn't send the
disconnect packet).
2015-03-25 15:22:21 +01:00
Daniel Campora e15f8198bc cc3200: Keep WLAN enabled during the soft reset. 2015-03-25 15:22:16 +01:00
Daniel Campora 9d3588f2be cc3200: Remove the cc3200.xml file. Latest CCS already ships with it. 2015-03-25 15:22:11 +01:00
Paul Sokolovsky 3d598256df py: Cast mp_obj_t to concrete types explicitly.
mp_obj_t internal representation doesn't have to be a pointer to object,
it can be anything.

There's also a support for back-conversion in the form of MP_OBJ_UNCAST.
This is kind of optimization/status quo preserver to minimize patching the
existing code and avoid doing potentially expensive MP_OBJ_CAST over and
over. But then one may imagine implementations where MP_OBJ_UNCAST is very
expensive. But such implementations are unlikely interesting in practice.
2015-03-25 09:25:41 +02:00
Paul Sokolovsky ec1b1cf834 docs: uctypes: Describe couple more functions. 2015-03-24 22:42:54 +02:00
Damien George dfad7f471a stmhal: Optimise ADC.read_timed() so that it can sample up to 750kHz. 2015-03-23 22:36:51 +00:00
Paul Sokolovsky 44cd46a7e4 objnamedtuple: Accept field list as a string.
This change is required to unbreak some CPython stdlib modules (as included
into micropython-lib).
2015-03-23 22:45:14 +02:00
Paul Sokolovsky 8705171233 objstr: Expose mp_obj_str_split() for reuse in other modules. 2015-03-23 22:43:37 +02:00
Damien George 4a8556ca58 unix: Remove -Wdouble-promotion from main build, and 2 from coverage.
The 2 removed from coverage build are: -Wredundant-decls and
-Wstrict-prototypes.
2015-03-22 22:41:45 +00:00
Damien George 8657342973 stmhal: Correctly clear wake-up flag before entering standby mode. 2015-03-22 21:52:20 +00:00
Paul Sokolovsky e38b892144 objnamedtuple: Check that 2nd arg to namedtuple() is a list. 2015-03-22 23:08:19 +02:00
Damien George cfe623ae3e stmhal: Expose all PYBv1.0 pins, include SD and USB pins.
To have proper low power mode, need to configure all unused pins in
input mode, so need to have them available.
2015-03-22 17:57:09 +00:00
Damien George f44ace11fb stmhal: Put flash in deep power-down mode when entering stop mode.
This can get PYBv1.0 stop current down to around 290uA.
2015-03-22 17:55:50 +00:00
danicampora 104a867447 cc3200: Fix bug in telnet that caused the rx buffer to overflow. 2015-03-22 11:32:12 +01:00
Damien George 55b74d1ff5 py: Combine duplicated code that converts members from a lookup.
Despite initial guess, this code factoring does not hamper performance.
In fact it seems to improve speed by a little: running pystone(1.2) on
pyboard (which gives a very stable result) this patch takes pystones
from 1729.51 up to 1742.16.  Also, pystones on x64 increase by around
the same proportion (but it's much noisier).

Taking a look at the generated machine code, stack usage with this patch
is unchanged, and call is tail-optimised with all arguments in
registers.  Code size decreases by about 50 bytes on Thumb2 archs.
2015-03-21 14:21:54 +00:00
danicampora 59f6831336 cc3200: Reduce soft reset time. WLAN is not reinit, just reenabled. 2015-03-21 11:31:29 +01:00
danicampora 77791b5633 cc3200: Improve usability and robustness of the servers. 2015-03-21 11:31:17 +01:00
danicampora c1c23e2f6a cc3200: Remove superfluous code in pybsleep. 2015-03-21 11:27:26 +01:00
danicampora cd9bc14c8f cc3200: Add SPI module.
Only MASTER mode is supported. Transfer width is configurable to
8, 16 or 32 bits.
2015-03-21 11:26:47 +01:00
danicampora c45e641c1d cc3200: Re-name pybsystick to mpsystick. 2015-03-21 11:21:45 +01:00
Paul Sokolovsky 6bf423df2c unix: Bump stack limit and adjust for 64-bitness.
Without that, "import http.client" failed due to max recursion.
2015-03-21 02:16:45 +02:00
Damien George db80b65402 tests: Make pyb/timer test check callback timing properly. 2015-03-20 23:50:33 +00:00
Dave Hylands 49d8e5ebaa stmhal: Fix a bug related to unhandled channel interrupts.
This also cleans up spurious interrupts which happen at timer
initilaization time.
2015-03-20 23:40:50 +00:00
stijn 3cc17c69ff py: Allow retrieving a function's __name__.
Disabled by default.  Enabled on unix and stmhal ports.
2015-03-20 23:13:32 +00:00
Paul Sokolovsky 07b8dc68d6 runtime: mp_load_method_maybe(): Don't use confusing "base" term.
"Base" should rather refer to "base type"."Base object for attribute
lookup" should rather be just "object".

Also, a case of common subexpression elimination.
2015-03-21 00:59:39 +02:00
Paul Sokolovsky 8d51c9d376 unix: When using separate obj output dirs, make -B is no longer relevant. 2015-03-21 00:42:29 +02:00
Damien George 2e22c2b477 unix: Move compiler warnings from production build to coverage build. 2015-03-20 22:33:13 +00:00