Commit Graph

7441 Commits

Author SHA1 Message Date
Damien George e202b6f586 stmhal/sdcard: Use mp_hal_pin_config function instead of HAL_GPIO_Init.
There is a minor functional change with this patch, that the GPIO are now
configured in fast mode, whereas they were in high speed mode before.  But
the SDIO should still work because SD CK frequency is at most 25MHz.
2016-12-22 14:55:26 +11:00
Damien George ed559de063 stmhal/led: Use mp_hal_pin_config function instead of HAL_GPIO_Init. 2016-12-22 14:55:26 +11:00
Damien George ffa30898cc stmhal/usrsw: Use mp_hal_pin_config function instead of HAL_GPIO_Init. 2016-12-22 14:55:26 +11:00
Damien George 425150040c stmhal/mphalport.h: Explicitly use HAL's GPIO constants for pull modes.
They are the same as the existing raw constants (namely 0, 1, 2) but we
want to explicitly show that one can use the HAL's constants if necessary
(eg the mpconfigboard.h files do use the HAL's constants to define the
pull state of certain configurable pins).
2016-12-22 14:55:26 +11:00
Damien George b14abab9cd stmhal/led: Properly initialise timer handle to zero before using it.
Without this the timer will have random values for its State and Lock
entries.  The object can then be in a locked state leading to some HAL
functions returning immediately with an error code (which is unchecked).

This patch fixes such a bug which did manifest itself as PWM not working
correctly for LEDs.
2016-12-22 14:55:26 +11:00
Paul Sokolovsky ffe807f349 extmod/moduheapq: Revert change for adhoc relative-time queue support.
Now that specialized utimeq module has been implenented, revert previous
adhoc changes to uheapq.

This reverts commit 0cbc07227c.
2016-12-22 06:37:49 +03:00
Damien George efa206d955 unix/Makefile: Make "coverage_test" target mirror Travis test actions. 2016-12-22 11:28:29 +11:00
Damien George 97f3797b82 travis: Include persistent bytecode with floats in coverage tests. 2016-12-22 11:27:35 +11:00
Damien George cdec7ba30e tests: Add a coverage test for printing the parse-tree. 2016-12-22 11:26:06 +11:00
Damien George ebb8413178 unix/main: Allow to print the parse tree in coverage build.
Passing -v -v -v on the command line of the coverage build will now print
the parse tree (as well as other things at this verbosity level).
2016-12-22 10:56:11 +11:00
Damien George c305ae3243 py/lexer: Permanently disable the mp_lexer_show_token function.
The lexer is very mature and this debug function is no longer used.  If
it's really needed one can uncomment it and recompile.
2016-12-22 10:49:54 +11:00
Damien George f4aebafe7a py/lexer: Remove unnecessary check for EOF in lexer's next_char func.
This check always fails (ie chr0 is never EOF) because the callers of this
function never call it past the end of the input stream.  And even if they
did it would be harmless because 1) reader.readbyte must continue to
return an EOF char if the stream is exhausted; 2) next_char would just
count the subsequent EOF's as characters worth 1 column.
2016-12-22 10:39:06 +11:00
Damien George b9c4783273 py/lexer: Remove unreachable code in string tokeniser. 2016-12-22 10:37:13 +11:00
Damien George adccafb42a tests/basics/lexer: Add a test for newline-escaping within a string. 2016-12-22 10:32:06 +11:00
Scott Shawcroft a9087fbaa2 atmel-samd: Change cplay pins to rev B. 2016-12-21 15:29:25 -08:00
Scott Shawcroft 7ce69959f9 atmel-samd: Tweaks for rev B of the prototype circuit playground. 2016-12-21 14:07:50 -08:00
Paul Sokolovsky 1b44987d0c extmod/modutimeq: Fix warning about unused param. 2016-12-22 00:48:19 +03:00
Paul Sokolovsky 64b1d5f878 unix: Enable utimeq module. 2016-12-22 00:33:44 +03:00
Paul Sokolovsky 5d9025a76e tests/extmod: Add test for utimeq module. 2016-12-22 00:31:38 +03:00
Paul Sokolovsky d02f6a9956 extmod/modutimeq: Refactor into optimized class.
import utimeq, utime
    # Max queue size, the queue allocated statically on creation
    q = utimeq.utimeq(10)
    q.push(utime.ticks_ms(), data1, data2)
    res = [0, 0, 0]
    # Items in res are filled up with results
    q.pop(res)
2016-12-22 00:29:32 +03:00
Paul Sokolovsky ef23399e32 extmod/modutimeq: Copy of current moduheapq with timeq support for refactoring. 2016-12-22 00:23:11 +03:00
Rami Ali 1731868ae7 tests: Add tests to improve coverage of objarray.c. 2016-12-21 18:21:41 +11:00
Rami Ali 531c206e8b tests: Add tests to improve coverage of runtime.c. 2016-12-21 15:44:41 +11:00
Damien George 46a6592f9a py/emitglue: Refactor to remove assert(0), to improve coverage. 2016-12-21 11:52:05 +11:00
Damien George e4af712125 py/objint: Rename mp_obj_int_as_float to mp_obj_int_as_float_impl.
And also simplify it to remove the check for small int.  This can be done
because this function is only ever called if the argument is not a small
int.
2016-12-21 11:46:27 +11:00
Scott Shawcroft f48d2df634 atmel-samd: Improve TouchIn to allow for multiple simultaneous touch pads. 2016-12-20 16:39:32 -08:00
Damien George 67f3edc10a tests/import: Add a test which uses ... in from-import statement. 2016-12-21 11:25:53 +11:00
Paul Sokolovsky 9af73bda33 esp8266: Force relinking OTA firmware image if built after normal one. 2016-12-20 23:23:45 +03:00
Paul Sokolovsky c1e94b77a4 esp8266/modesp: flash_user_start(): Support configuration with yaota8266.
It's pretty rough way to detect yaota8266 being used, but otherwise allows
to have a filesystem in such config.
2016-12-20 22:57:51 +03:00
Rami Ali 5d06a74303 tests/basics: Improve test coverage for generators. 2016-12-20 16:19:56 +11:00
Damien George 1e7a801e2d tests/run-tests: For REPL tests make sure the REPL is exited at the end. 2016-12-20 15:13:49 +11:00
Damien George 7bbce4e213 tests/basics/set_pop: Improve coverage of set functions. 2016-12-20 14:25:06 +11:00
Damien George b470f59892 tests/basics: Add test for builtin locals(). 2016-12-20 14:08:57 +11:00
Damien George d291007fea tests/basics/builtin_dir: Add test for dir() of a type. 2016-12-20 14:08:27 +11:00
Damien George 49bf7617d0 tests/float/builtin_float_round: Test round() with second arg. 2016-12-20 14:01:10 +11:00
Damien George 7318949c46 py/modbuiltins: Remove unreachable code. 2016-12-20 14:00:59 +11:00
Scott Shawcroft e8db23d241 esp8266: Add limited (untested) UART support. 2016-12-19 17:32:40 -08:00
Scott Shawcroft 427d33c706 atmel-samd: Add help() and remove mem_info functions from smallest builds to make room. 2016-12-19 16:38:35 -08:00
Scott Shawcroft 576373552a atmel-samd: Run the VM hook while waiting for the UART read to timeout in case nothing is received. 2016-12-19 16:36:32 -08:00
Damien George 0d32f1aeb3 esp8266: When doing GC be sure to trace the memory holding native code.
Native code can hold pointers to objects on the heap, eg constant objects
like big integers.
2016-12-20 11:20:01 +11:00
Rami Ali 5e1ccddc82 tests/basics: Improve mpz test coverage. 2016-12-20 10:15:48 +11:00
Scott Shawcroft b09a711eb0 Merge pull request #66 from tannewt/uart
Thanks to @turbinenreiter for the first work on this.

I heavily modified it to work with a circular RX buffer of configurable size. The main API is the same as the stream API and is a subset of upstream's machine.UART.

Fixes #46
2016-12-19 14:02:14 -08:00
Scott Shawcroft f2bfbab6a0 atmel-samd: Save space by not creating default files on the FS and by only keeping LED flashing code when LEDs are present. 2016-12-19 13:03:50 -08:00
Sebastian Plamauer 1598e44231 atmel-samd: Add preliminary support for UART 2016-12-19 13:03:50 -08:00
Paul Sokolovsky 91359c8690 tests/struct*: Make skippable. 2016-12-19 19:41:12 +03:00
Damien George de9cd00b39 py/compile: Add an extra pass for Xtensa inline assembler.
It needs an extra pass to compute the size of the constant table for the
l32r instructions.
2016-12-19 17:42:25 +11:00
Paul Sokolovsky bbd0d27a25 zephyr: Enable slice subscription.
Required for the testsuite.
2016-12-18 21:52:52 +03:00
Paul Sokolovsky 56a514c193 zephyr/uart_core: Access console UART directly instead of printk() hack.
This is required to avoid extra level of output "cooking" ("\r\r\n") and
make test infrastructure work. On the other hand, this breaks somewhat
Zephyr console abstraction.
2016-12-17 00:48:56 +03:00
Paul Sokolovsky 0c59c30fde zephyr: Use core-provided keyboard exception object. 2016-12-16 01:07:28 +03:00
Paul Sokolovsky 724b82559d zephyr/main: Initialize sys.path and sys.argv. 2016-12-16 00:33:33 +03:00