Commit Graph

4832 Commits

Author SHA1 Message Date
Dave Hylands 9f5486c7e2 stmhal: Put IRQs into priority order.
- added some comments to explain the priority/sub-priority.
- adds an entry for SDIO (to be used in a later patch)
- increases DMA priority above USB so that DMA can be used
  for sdcard I/O when using USB Mass Storage.
2015-11-24 09:37:25 +00:00
Damien George 056abbcf31 stmhal: Fix unused variables when HW_CLK_LAST_FREQ not defined. 2015-11-23 23:52:09 +00:00
T S 86aa16bea6 stmhal: Implement delayed RTC initialization with LSI fallback.
If RTC is already running at boot then it's left alone.  Otherwise, RTC is
started at boot but startup function returns straight away.  RTC startup
is then finished the first time it is used.  Fallback to LSI if LSE fails
to start in a certain time.

Also included:
 MICROPY_HW_CLK_LAST_FREQ
        hold pyb.freq() parameters in RTC backup reg
 MICROPY_HW_RTC_USE_US
        option to present datetime sub-seconds in microseconds
 MICROPY_HW_RTC_USE_CALOUT
        option to enable RTC calibration output

CLK_LAST_FREQ and RTC_USE_CALOUT are enabled for PYBv1.0.
2015-11-23 23:23:07 +00:00
Damien George 4dea24e105 docs: Bump version to 1.5.1. 2015-11-23 21:27:33 +00:00
Paul Sokolovsky 4892e4c5fc lib/utils/printf: Use more conservative check for MICROPY_DEBUG_STDERR. 2015-11-23 22:38:48 +02:00
Damien George 9a56912ad1 py/compile: Do proper checking of * and ** in function definition.
This patch checks that there is only one *, and that ** is last in the
arg list.
2015-11-23 16:50:42 +00:00
Damien George 0e3f29cc99 py: Check that second argument to hasattr is actually a string.
Fixes issue #1623.
2015-11-23 15:57:00 +00:00
Damien George a8aa1998ce extmod/modure: Use correct integer type for n_args argument. 2015-11-23 15:05:58 +00:00
Damien George 44e6e348d6 py/emitglue: Implement persistent saving and loading of const objects. 2015-11-23 11:54:12 +00:00
Damien George 39a8deb95f py/emitglue: Add feature-flag header to .mpy to detect bytecode compat.
Loading .mpy files will now check to make sure that the target VM can
support the bytecode.
2015-11-23 10:58:16 +00:00
Paul Sokolovsky 9f10d3fb63 unix/main: Get rid of perror() which uses stdio. 2015-11-23 00:10:38 +02:00
Paul Sokolovsky 4120f32292 tests/int_big_*: Add more tests for result normalization.
Tested by comparability to small int/casting to bool.
2015-11-22 22:11:01 +02:00
Paul Sokolovsky b3be4710aa py/mpz: Normalize (remove leading zeros) xor operation result. 2015-11-22 22:03:18 +02:00
Paul Sokolovsky b56c635d64 tests/int_big_xor: Test that xor result is normalized.
And thus can be successfully used in comparisons, etc.
2015-11-22 22:02:15 +02:00
Paul Sokolovsky 3d6240ba1b py/formatfloat: Handle calculation of integer digit for %f format properly.
%f prints true integer digit, so its calculation should happen before any
exponential scaling.
2015-11-22 20:05:08 +02:00
Paul Sokolovsky 3c4c069802 py/formatfloat: Workaround (fix?) incorrect rounding for %f format. 2015-11-22 18:09:28 +02:00
Paul Sokolovsky b64e0575fd tests/float/string_format: Add testcase for incorrect rounding for %f. 2015-11-22 18:08:49 +02:00
Paul Sokolovsky 9aaccd4735 py/formatfloat: Convert to fully portable implementation.
This takes previous IEEE-754 single precision float implementation, and
converts it to fully portable parametrizable implementation using C99
functions like signbit(), isnan(), isinf(). As long as those functions
are available (they can be defined in adhoc manner of course), and
compiler can perform standard arithmetic and comparison operations on a
float type, this implementation will work with any underlying float type
(including types whose mantissa is larger than available intergral integer
type).
2015-11-22 17:54:05 +02:00
Paul Sokolovsky 1818da2ef3 lib/utils/printf: Fix issue with putchar define for some ports. 2015-11-22 02:46:32 +02:00
Paul Sokolovsky 8ee43e24f3 lib/utils/printf: Add extra prototypes. 2015-11-22 00:59:24 +02:00
Paul Sokolovsky c3280d83e7 unix: Use printf() implementation in terms of mp_printf().
In other words, unix port now uses overriden printf(), instead of using
libc's. This should remove almost all dependency on libc stdio (which
is bloated).
2015-11-22 00:44:41 +02:00
Paul Sokolovsky ede1f547e7 unix/modsocket: Use snprintf(), as defined by lib/utils/printf.c. 2015-11-21 17:21:49 +02:00
Paul Sokolovsky 295ea12411 py/emitglue: Host definition of mp_verbose_flag.
This may not seem like the ideal place, but is actually the only place
in py/ where it gets referenced, so is just right.
2015-11-21 16:54:15 +02:00
Paul Sokolovsky 72bd172b30 py/modsys: Consistently use indented #if's. 2015-11-21 16:03:37 +02:00
Paul Sokolovsky 3ba61656bd unix/modsocket: Implement sockaddr() function to decode raw socket address.
Return tuple of (address_family, net_addr, [port, [extra_data]]). net_addr
is still raw network address as bytes object, but suitable for passing to
inet_ntop() function. At the very least, sockaddr() will separate address
family value from binary socket address (and currently, only AF_INET family
is decoded).
2015-11-21 01:38:59 +02:00
Paul Sokolovsky 2ae7ced721 unix/modsocket: Removed dangling references to sockaddr_in_type. 2015-11-20 21:32:27 +02:00
Paul Sokolovsky acb743da64 unix/modffi: Mark 'O' type specifier as implemented. 2015-11-20 17:51:37 +02:00
Damien George 83229d3ffe py: Use MP_OBJ_NULL instead of NULL when appropriate. 2015-11-20 14:09:20 +00:00
Damien George 54df549b5f unix/moduselect: Initialise variable so can compile in non-debug mode. 2015-11-20 12:51:00 +00:00
Damien George b5b1f2c527 py/emitglue: Add mp_raw_code_load_mem to load raw-code from memory. 2015-11-20 12:44:20 +00:00
Damien George f148727b78 py/emitglue: Only compile raw-code fatfs loader when on thumb2 platform.
Here we are assuming that a thumb2 port will have fatfs, which is only
roughly true.  We need a better way of enabling specific raw-code file
readers.
2015-11-20 12:42:26 +00:00
Damien George d4dba88236 py/compile: Add mp_compile_to_raw_code() to return raw code object.
This can then be passed to mp_raw_code_save_file to save a .mpy file.
2015-11-20 12:30:37 +00:00
Igor Gatis f5c554dfe3 py: Added Cygwin support to py/nlrx86.S. 2015-11-19 20:23:43 +02:00
Damien George 593faf14c4 py/map: Store key/value in earliest possible slot in hash table.
This change makes the code behave how it was supposed to work when first
written.  The avail_slot variable is set to the first free slot when
looking for a key (which would come from deleting an entry).  So it's
more efficient (for subsequent lookups) to insert a new key into such a
slot, rather than the very last slot that was searched.
2015-11-19 01:27:28 +00:00
danicampora db0a5aed39 cc3200: Bump version to 1.1.1. 2015-11-18 23:45:24 +01:00
danicampora efc4da4be9 cc3200/README.md: Correct cc3200's update file name. 2015-11-18 20:10:19 +01:00
Chris Liechti 426f326d35 docs/wipy: Make wifi/wlan naming consistent with tutorial.rst. 2015-11-18 20:02:07 +01:00
Jason Hildebrand 9142179f81 docs/wipy: Add warning about losing wlan connection when changing mode.
Also provide workarounds, link to other revelant sections,
and fix some typos.
2015-11-18 19:55:55 +01:00
Gary Ashton-Jones 7080e9632c cc3200/appsign.sh: Use md5 if running under Darwin. 2015-11-18 19:50:28 +01:00
Noah 00960133c2 docs: Update docs for WiPy wlan.connect().
- The link establishment timeout is infinite by default
- Fix typo in notes about the auth kwarg
2015-11-18 19:47:40 +01:00
Dave Hylands f3308daa6f docs/wipy: Fixed some typos in the WiPy's tutorials. 2015-11-18 19:40:29 +01:00
Damien George 994ff738c8 py/mpstate: Make mp_pending_exception volatile.
It can change asynchronously.
2015-11-17 14:27:21 +00:00
Damien George a24eafacc9 py/modmath: Make log2, log10 and hyperbolic funcs be SPECIAL_FUNCTIONS.
Will be included only when MICROPY_PY_MATH_SPECIAL_FUNCTIONS is enabled.

Also covers cmath module (but only log10 is there at the moment).
2015-11-17 14:10:13 +00:00
Damien George 2c83894257 py: Implement default and star args for lambdas. 2015-11-17 14:00:14 +00:00
Damien George cbd9ae5256 py/compile: Don't unnecessarily save state when compiling param list.
Parameter lists can't be nested so there is no need to save the global
state when compiling them.
2015-11-17 12:37:02 +00:00
danicampora e4404fbef0 cc3200: Unmount all user file systems after a soft reset. 2015-11-16 23:43:47 +01:00
Paul Sokolovsky 65971f5160 unix: Add "uselect" module, with poll() function.
Underlyingly, uses standard POSIX poll() for portability.
2015-11-17 00:35:57 +02:00
Paul Sokolovsky 79c4ec1102 unix/input: Switch to POSIX I/O for history reading/writing. 2015-11-16 07:40:56 +02:00
Paul Sokolovsky f8bc3f6964 tools: Update to upip 0.6.2. Fixes issue due to MacOSX undocumented behavior. 2015-11-15 00:04:18 +02:00
Paul Sokolovsky 3862ef9a9f tools: Update upip to 0.6.1. Fixes normal installs without -p switch. 2015-11-14 17:54:30 +02:00