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
Damien George
67f3edc10a
tests/import: Add a test which uses ... in from-import statement.
2016-12-21 11:25:53 +11:00
Glenn Ruben Bakke
2db3f0deb7
nrf5/modules: Adding a python test file with function to dim a specific led (17).
2016-12-20 23:21:17 +01:00
Glenn Ruben Bakke
0999226103
nrf5/pwm: Updating pwm module with freq function which re-initilises the PWM instance such that new frequency will be applied.
2016-12-20 23:15:26 +01: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
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
Paul Sokolovsky
91359c8690
tests/struct*: Make skippable.
2016-12-19 19:41:12 +03:00
Glenn Ruben Bakke
db1faf85f7
nrf5/pwm: Initializing pwm instances in main.c if enabled by MICROPY_PY_MACHINE_PWM.
2016-12-19 17:10:48 +01:00
Glenn Ruben Bakke
faa1b77844
nrf5/pwm: Adding api to initialize pwm instances.
2016-12-19 17:09:46 +01: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
Glenn Ruben Bakke
b4dc9254ac
nrf5: Updating mpconfigport.h to set a default for PWM machine module to be enabled by default, if not disabled in a board config. Refactoring order in the file.
2016-12-17 01:29:12 +01:00
Glenn Ruben Bakke
b350dc5198
nrf52: Set names to be used on PWM0-2 in board config. For nrf52840, the PWM3 is excluded as repo does not have latest headers to reflect this yet. Bump up to be done soon.
2016-12-17 01:27:58 +01:00
Glenn Ruben Bakke
dd9812e1e9
nrf52: Enable PWM HAL for both pca10040 (nrf52832) and pca10056 (nrf52840).
2016-12-17 01:21:32 +01:00
Glenn Ruben Bakke
275bf46831
nrf51: Disable MICROPY_PY_MACHINE_PWM for now in all nrf51 target boards as sw impl. is not yet included in the repo.
2016-12-17 01:19:44 +01:00
Glenn Ruben Bakke
18f528eceb
nrf5: Only enable hal_pwm.c if nrf52 target as nrf51 must have a sw implementation.
2016-12-17 01:16:38 +01:00
Glenn Ruben Bakke
3bf2ca05f1
nrf5/pwm: Adding pwm to modmachine.c
2016-12-17 01:14:50 +01:00
Glenn Ruben Bakke
abd945fde1
nrf5/hal: Updating PWM header file with init function prototype. Also added PWM_HandleTypeDef structure that can be used in the pwm python module.
2016-12-17 01:05:43 +01:00
Glenn Ruben Bakke
7bfe001d22
nrf5/pwm: Updating PWM dict table to have freq and duty function. Also added creation of default objects based on PWM name set in board config. Adding ifdef surrounding the import of hal_pwm.h as this module might be used by software implmentation of PWM later.
2016-12-17 01:03:39 +01:00
Glenn Ruben Bakke
a081bf2f91
nrf5/pwm: Removing include of hal_pwm.h as pwm.c might not use a hal, but sw implementation.
2016-12-17 00:39:24 +01: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
Glenn Ruben Bakke
eaece2734b
nrf5: Updating makefile to compile in pwm.c and hal_pwm.c
2016-12-16 19:56:12 +01:00
Glenn Ruben Bakke
36a232182a
nrf5/boards: Adding config flag for HAL_PWM in pca10040 and pca10056.
2016-12-16 19:56:00 +01:00
Glenn Ruben Bakke
930112753a
nrf5: Adding pwm work in progress machine PWM module.
2016-12-16 19:55:32 +01:00
Glenn Ruben Bakke
82f7fe88b0
nrf5/hal: Starting implementation of PWM hal to be used by PWM python module later.
2016-12-16 19:17:42 +01: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
Mike Causer
87e426c7c7
esp8266: Add "erase" target to Makefile, to erase entire flash.
2016-12-15 22:29:16 +11:00
Damien George
48d81c6900
esp8266: Use core-provided keyboard exception object.
2016-12-15 15:52:47 +11:00
Damien George
a770ba147e
stmhal: Use core-provided keyboard exception object.
2016-12-15 15:51:34 +11:00
Damien George
d89cafd5c3
lib/utils/interrupt_char: Use core-provided mp_kbd_exception if enabled.
...
Ultimately all ports that use lib/utils/interrupt_char would enable
MICROPY_KBD_EXCEPTION, so this is an interim solution.
2016-12-15 13:35:54 +11:00
Damien George
7f1da0a03b
py: Add MICROPY_KBD_EXCEPTION config option to provide mp_kbd_exception.
...
Defining and initialising mp_kbd_exception is boiler-plate code and so the
core runtime can provide it, instead of each port needing to do it
themselves.
The exception object is placed in the VM state rather than on the heap.
2016-12-15 13:00:19 +11:00
Damien George
979ab4e126
stmhal/usb: Always use the mp_kbd_exception object for VCP interrupt.
...
There's no need to store a separate pointer to this object.
2016-12-15 12:45:56 +11:00
Damien George
f254cfd3c4
stmhal: Rename mp_const_vcp_interrupt to mp_kbd_exception.
...
mp_kbd_exception is now considered the standard variable name to hold the
singleton KeyboardInterrupt exception.
This patch also moves the creation of this object from pyb_usb_init() to
main().
2016-12-15 12:32:00 +11:00
Damien George
29b5879613
tools/pyboard.py: Refactor so target is not reset between scripts/cmd.
...
Previous to this patch pyboard.py would open a new serial connection to
the target for each script that was run, and for any command that was run.
Apart from being inefficient, this meant that the board was soft-reset
between scripts/commands, which precludes scripts from accessing variables
set in a previous one.
This patch changes the behaviour of pyboard.py so that the connection to
the target is created only once, and it's not reset between scripts or any
command that is sent with the -c option.
2016-12-15 11:29:33 +11:00
Damien George
1b02565316
stmhal/mpconfigport: Add weak-module links for io, collections, random.
2016-12-15 11:23:20 +11:00