Commit Graph

4003 Commits

Author SHA1 Message Date
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
Damien George
7674da8057 stmhal: Remove some unnecessary declarations, purely for cleanup. 2015-03-20 22:27:34 +00:00
Paul Sokolovsky
69922c602c objlist: list_reverse(): Fix typesafety error. 2015-03-20 23:35:21 +02:00
Damien George
d478fc75b3 tests: Adjust expected output, since Travis can't do git describe. 2015-03-20 21:31:50 +00:00
Damien George
d1cee02783 py: Clarify API for map/set lookup when removing&adding at once.
Addresses issue #1160.
2015-03-20 17:41:37 +00:00
Paul Sokolovsky
d48035b06b tests: Add basic test for OrderedDict.
Mostly to have coverage of newly added code in map.c.
2015-03-20 17:26:10 +00:00
Paul Sokolovsky
0ef01d0a75 py: Implement core of OrderedDict type.
Given that there's already support for "fixed table" maps, which are
essentially ordered maps, the implementation of OrderedDict just extends
"fixed table" maps by adding an "is ordered" flag and add/remove
operations, and reuses 95% of objdict code, just making methods tolerant
to both dict and OrderedDict.

Some things are missing so far, like CPython-compatible repr and comparison.

OrderedDict is Disabled by default; enabled on unix and stmhal ports.
2015-03-20 17:26:10 +00:00
Damien George
1004535237 tests: Make cmdline tests more stable by using regex for matching. 2015-03-20 17:25:25 +00:00
Damien George
8e9a71257d py: Implement DELETE_GLOBAL in showbc.c. 2015-03-20 17:12:09 +00:00
Paul Sokolovsky
3425431370 objtype: More comment clarification for attribute lookup. 2015-03-20 00:51:55 +02:00
danicampora
f8ee88bbe0 cc3200: Move server methods from WLAN to the network module. 2015-03-19 17:08:25 +01:00
Damien George
92496abe0f unix: Enable extra compiler warnings.
To address issue #699.
2015-03-19 00:25:33 +00:00
Damien George
6b07a6132f extmod/crypto: Add static keyword where it should be. 2015-03-19 00:25:33 +00:00
Damien George
2e2e404ff7 py: Allow to compile with extra warnings (sign-compare, unused-param). 2015-03-19 00:25:33 +00:00
Paul Sokolovsky
02894b51f4 extmod: Update uzlib to 1.2.1.
Fixes for compiler warnings in pedantic mode.
2015-03-19 00:04:12 +02:00
Paul Sokolovsky
d7194f1b8e extmod: Update re1.5 to 0.7.
Includes static function fix and all the previous improvements and fixes
by @dpgeorge.
2015-03-18 23:42:17 +02:00
danicampora
0e96d1b3f1 cc3200: Add parameter to wlan_stop() for custom timeout values. 2015-03-18 21:55:08 +01:00
danicampora
f382f4442e cc3200: Fixes and improvements to the SD card driver. 2015-03-18 21:55:02 +01:00
danicampora
963d7c7ee6 cc3200: Refactor I2C. Remove all references to SLAVE mode. 2015-03-18 21:54:41 +01:00
danicampora
d3912549a3 cc3200: Improve I2C timeout handling. 2015-03-18 21:54:30 +01:00
stijn
f43e03ee4f extmod/ure: Fix msvc warning resulting from memset on const char ** pointer 2015-03-17 15:41:42 +01:00
danicampora
005a7f4190 cc3200: Fix extint_enable behaviour when the callback is updated. 2015-03-17 13:26:09 +01:00
danicampora
181fe5016c cc3200: Add RTC callback with wake-up from sleep capability. 2015-03-17 13:26:08 +01:00
danicampora
6de1b39368 cc3200: Make peripheral objects static.
This prevents duplication of objects in the sleep list. Also helps
with reducing the code size by ~100 bytes.
2015-03-17 13:26:07 +01:00
danicampora
fcf6db0695 cc3200: Register pybsd with the sleep module and use pin_config(). 2015-03-17 13:26:06 +01:00
danicampora
98b8568362 cc3200: Assign GPIO10 and GPIO11 to the GPIO peripheral on start-up. 2015-03-17 13:26:05 +01:00
danicampora
ea43fa104e cc3200: Remove unneeded functions and add pybsleep_remove() calls. 2015-03-17 13:26:03 +01:00
Paul Sokolovsky
1954d8021f objtype: Clarify comment why we call mp_load_method_maybe() for native sub-obj. 2015-03-17 02:08:08 +02:00
Damien George
49fe6dc89a stmhal: Add config option to use LSE/LSI for RTC.
Most boards (except the pyboard) don't have a 32kHz crystal so they
should use the LSI for the RTC.
2015-03-16 22:54:44 +00:00
Paul Sokolovsky
3cb766344d objtype: Refactor dealing with native sub-objects for clarity. 2015-03-16 14:00:01 +02:00