Commit Graph

4846 Commits

Author SHA1 Message Date
Paul Sokolovsky
ff8c4188f4 tests/run-tests: Improve robustness of REPL tests.
Unconditionally wait for MicroPython banner. On overloaded systems, when
using emulators, etc. initial executable startup may take more than 20ms.
2015-11-24 19:52:30 +02:00
Damien George
65888e2006 stmhal: Process storage idle tick handler in different slot to DMA. 2015-11-24 16:57:13 +00:00
Damien George
36bd10779c stmhal: In SysTick IRQ handler, make uwTick variable non-volatile.
uwTick can only change in the SysTick IRQ so this IRQ function does not
need to take special care with this variable.  It's important to make
this IRQ function as efficient as possible.
2015-11-24 16:23:54 +00:00
Damien George
e99e6c883d stmhal: Move flash storage idle tick handler from TIM3 to SysTick.
Using SysTick to do the counting and dispatch of the flash storage idle
handler is more efficient than requiring a dedicated hardware timer.
No new counter is needed, just the existing uwTick variable.  The
processing is not actually done in the SysTick IRQ, it is deferred to
the flash IRQ (which runs at lower priority).
2015-11-24 16:18:07 +00:00
Damien George
3cfb02f166 stmhal/irq: Set all IRQ subpriorities to 0, since they aren't used. 2015-11-24 15:56:33 +00:00
Damien George
18820471ae stmhal/irq: Add comment about SDIO priority being higher than DMA. 2015-11-24 15:51:07 +00:00
Damien George
22bd23114a stmhal: On SysTick IRQ, only process one DMA channel at a time.
This can be generalised if/when more processing is needed by SysTick.

Thanks to @chuckbook for the idea.
2015-11-24 15:44:16 +00:00
Damien George
9936aa3f87 stmhal: Save RAM and ROM by making SD DMA init structure const for tx/rx. 2015-11-24 15:44:16 +00:00
Damien George
522d454e34 stmhal: Small simplification of code to tickle DMA idle counter. 2015-11-24 15:44:16 +00:00
stijn
3baf6b5319 windows/py: Support 64bit mingw-w64 builds
- add mp_int_t/mp_uint_t typedefs in mpconfigport.h
- fix integer suffixes/formatting in mpconfig.h and mpz.h
- use MICROPY_NLR_SETJMP=1 in Makefile since the current nlrx64.S
  implementation causes segfaults in gc_free()
- update README
2015-11-24 17:34:14 +02:00
stijn
a58fa27c24 windows: Cleanup makefile
The BSD stuff is a copy from the unix makefile but at least there it
makes some sense, a windows makefile on BSD doesn't.
The -lmman flag is probably for mmap functions but there is no other build
support for it on windows so just that flag won't cut it anyway.
2015-11-24 17:34:14 +02:00
stijn
bf1570cb25 nlr: Use single preprocessor symbol to check if building on Windows 2015-11-24 17:34:14 +02:00
Dave Hylands
6edffd0df5 stmhal: Add dma support for sdcard.
This started out using IgorLektorovEpam work in PR #1389
and reworked it.
2015-11-24 09:37:25 +00:00
Dave Hylands
b677f03407 stmhal: Turn off DMA clocks when idle for 100 msec
Turning on each DMA block increases the current consumption
by about 8 mA. This code adds an idle timer for each DMA
block and turns off the clocks when no streams are in use
for 128 msec. Having a small timeout allows for improved
performance when back-to-back transfers are being performed.

The 128 msec is basically a guess.
2015-11-24 09:37:25 +00:00
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