Damien George
04d05db27e
py/vm: Fix bug with unwind jump popping the iterator from a for loop.
...
This patch fixes a regression introduced by
088740ecc4
2017-05-25 20:39:08 +10:00
Damien George
68e71eacb8
py/vm: Fix bug with stackless mode and unwinding of exceptions.
...
This patch fixes a regression introduced by
71a3d6ec3b
Previous to this patch the n_state variable was referring to that computed
at the very start of the mp_execute_bytecode function. This patch fixes it
so that n_state is recomputed when the code_state changes.
2017-05-25 20:35:57 +10:00
Glenn Ruben Bakke
aba5fcbf0f
nrf5/main: Move initializaton of modmusic to the module itself. Upon init of the module, the hardware, pwm and ticker will be started. Could be moved back to main if pwm or ticker should be shared among more modules and have to be initialized more global.
2017-05-25 00:25:14 +02:00
Glenn Ruben Bakke
d9813910da
nrf5/modules/machine/timer: If timer is used in combination with SOFT_PWM (implicitly use of ticker.c) guard the Timer1 instance from being instantiated trough python timer module. Also disable implementation of the HAL IRQ handler which is for now explicitly implemented in ticker.c for Timer1.
2017-05-25 00:25:14 +02:00
Glenn Ruben Bakke
aa9ad6be01
nrf5/modules/music: Update ticker and modmusic to share global ticks counter as a volatile variable. Use Timer1 hardware peripheral instead of instance 0. Timer0 is not free if used in combination with a bluetooth stack. Update IRQ priority to levels that are compatible in use with a bluetooth stack for both nrf51 and nrf52. Apply nrf51 PAN fixes for Timer1 instead of original Timer0.
2017-05-25 00:25:14 +02:00
Glenn Ruben Bakke
ed93392d87
nrf5/drivers/bluetooth: Updating bluetooth driver to initialize nrf_nvic_state_t struct during declaration of the global variable instead of explicit memset.
2017-05-25 00:25:14 +02:00
Glenn Ruben Bakke
2f40c61c3e
nrf5/hal/irq: Adding wrappers for handling nvic calls when Bluetooth LE stack is enabled.
2017-05-25 00:25:14 +02:00
Glenn Ruben Bakke
c7cc57eaa0
nrf5/modules/machine: Updating IRQ levels in SPI with IRQ priorities compatible with Bluetooth stacks.
2017-05-25 00:24:50 +02:00
Scott Shawcroft
1280e9122b
Doc tweaks to clarify external libraries, new boards and add HID library.
2017-05-24 11:44:23 -07:00
Scott Shawcroft
3cad7b7b03
atmel-samd: correctly reset the REPL history on reload. Fixes #141
2017-05-24 10:53:52 -07:00
Paul Sokolovsky
982e676902
zephyr/modusocket: getaddrinfo: Raise OSError on resolution timeout, etc.
2017-05-24 19:55:14 +03:00
Scott Shawcroft
b444788451
Merge pull request #135 from robomike/pins
...
Renamed spi flash to ext flash not to confuse with the actual spi flash
2017-05-23 11:43:20 -07:00
robomike
517590a58a
atmel-samd:renamed spi flash to confuse with the actual spi flash
2017-05-23 14:09:28 -04:00
Scott Shawcroft
907188972c
Merge pull request #138 from dhalbert/add-ure-et-al
...
Enable ure, center, partition, frozenset, splitlines, reversed for Express builds.
2017-05-21 22:00:19 -07:00
Dan Halbert
5c7071e92a
Merge branch 'master' into add-ure-et-al
2017-05-21 23:20:47 -04:00
Glenn Ruben Bakke
e87dcd8940
nrf5/device: Remove old startup files in asm, which has now been replaced with c-implementation.
2017-05-21 23:10:45 +02:00
Glenn Ruben Bakke
d580fa4088
nrf5: Update Makefile to add c-implementation of startup scripts instead of the .s files.
2017-05-21 23:10:45 +02:00
Glenn Ruben Bakke
d7145339aa
nrf5/device: Adding startup files in .c to replace current asm versions.
2017-05-21 23:10:45 +02:00
Glenn Ruben Bakke
d877e0e533
nrf5/examples: Tuning Bluetooth LE example controller python script after testing out the example live. Motor speed of 100 was not enought to lift the airplane. Also turning was hard without setting higher angle values. The new values are just guessed values. However, the flying experience was good.
2017-05-21 18:14:08 +02:00
Scott Shawcroft
eeced45bed
Remove code size check. Its causing builds to fail because the new GCC made it slightly larger.
2017-05-21 07:53:19 -07:00
Paul Sokolovsky
1c9ee49756
drivers: Replace deprecated Pin.high()/low() methods with .__call__(1/0).
2017-05-21 17:44:58 +03:00
Paul Sokolovsky
bcf31a3908
esp8266, stmhal, zephyr: Rename machine.Pin high/low methods to on/off.
...
For consistent Pin/Signal class hierarchy. With it, Signal is a proper
(while still ducktyped) subclass of a Pin, and any (direct) usage of Pin
can be replace with Signal.
As stmhal's class is reused both as machine.Pin and legacy pyb.Pin,
high/low methods actually retained there.
2017-05-21 17:44:58 +03:00
Paul Sokolovsky
299c0a3925
CODECONVENTIONS: Typo fix.
2017-05-21 15:58:03 +03:00
Paul Sokolovsky
3ebd67fc09
library/machine.Pin: Remove .id() method and .board class attr.
...
Both aren't part of generic Hardware API: It's impossible to implement
.id() method in a generic case (e.g., when Pin is instantiated by the
underlying OS/RTOS). .board attribute is an obvious space hog which
instead can be implemented on Python level if needed.
2017-05-21 15:50:16 +03:00
Paul Sokolovsky
19e065294d
cc3200/mods/pybpin: Remove toggle() method.
...
It's not part of MicroPython HW API and can be easily implemented on Python
level in case of need.
Saved 56 bytes of binary.
2017-05-21 15:39:27 +03:00
Dan Halbert
253bdf7739
Enable ure, center, partition, frozenset, splitlines, reversed for Express builds.
2017-05-20 14:02:37 -04:00
Scott Shawcroft
0a6bed491f
atmel-samd: Enable autoreload by default again.
2017-05-20 08:11:06 -07:00
Damien George
338f0849d9
py/mkenv.mk: Use $(TOP) instead of ".." to reference tools, mpy-cross.
2017-05-19 15:53:55 +10:00
Damien George
436d97b3f9
docs/library/machine.UART: Update and improve uart.any() docs.
2017-05-19 15:48:22 +10:00
Damien George
aca898eeb0
esp8266/machine_uart: Add uart.any() method.
...
Returns 0 or 1, corresponding to no or at least 1 char waiting.
2017-05-19 15:48:22 +10:00
Glenn Ruben Bakke
4a7716f5dd
Merge remote-tracking branch 'upstream/master' into nrf5_no_sdk
2017-05-18 23:23:21 +02:00
Glenn Ruben Bakke
003f43b5c9
nrf5/hal/irq: Adding include of nrf_nvic.h if s132 bluetooth stack is used to resolve IRQ function wrappers on newer bluetooth stacks.
2017-05-18 23:20:25 +02:00
Glenn Ruben Bakke
1192981d24
nrf5/drivers/ticker: Removing unused code.
2017-05-18 23:11:41 +02:00
Glenn Ruben Bakke
0fa70ec988
nrf5/examples: Adding music example. Only working if bluetooth stack is not enabled.
2017-05-18 23:11:41 +02:00
Glenn Ruben Bakke
1ff44dd5b8
nrf5/boards/microbit: Disable music and softPWM as there are some issues with the ticker.
2017-05-18 23:11:41 +02:00
Glenn Ruben Bakke
d06c6f4587
nrf5: Adding -fstack-usage flag to gcc CFLAGS to be able to trace stack usage on modules.
2017-05-18 23:11:41 +02:00
Glenn Ruben Bakke
c921bbd9ac
nrf5/drivers/ticker: Removing LowPriority callback from nrf51 as there is only one SoftwareIRQ free if bluetooth stack is enabled. Also setting new IRQ priority on SlowTicker to 3 instead of 2, to interleave with bluetooth stack if needed. Updating all NVIC calls to use hal_irq.h defined static inlines instead of direct access.
2017-05-18 23:11:41 +02:00
Glenn Ruben Bakke
981b3e61dd
nrf5/hal/irq: Adding IRQ wrappers if Bluetooth Stack is present.
2017-05-18 23:11:41 +02:00
Glenn Ruben Bakke
d1a4b19dc5
nrf5: Facilitate option to configure away the modble if needed. Enabled if MICROPY_PY_BLE config is enabled in bluetooth_conf.h.
2017-05-18 23:11:41 +02:00
Glenn Ruben Bakke
147d03feff
nrf5/boards/microbit: Enable music module by default. However, timer and rtc module has to be disabled. Bluetooth support broken. Optimization needed.
2017-05-18 23:11:41 +02:00
Glenn Ruben Bakke
952c14c4bf
nrf5/modules/machine: Quickfix. Update timer object to not allow instanciation of Timer(0) if SOFT_PWM is enabled by board.
2017-05-18 23:11:41 +02:00
Glenn Ruben Bakke
6f72e73137
nrf5/hal/timer: Quickfix. Disable IRQ handler if SOFT_PWM is configured to be enabled. Ticker driver has in current driver a seperate IRQ handler for this timer instance.
2017-05-18 23:11:41 +02:00
Glenn Ruben Bakke
086d79fbad
nrf5/drivers/ticker: Add compile config guard in ticker.c to only include the driver if SOFT_PWM is configured in by board.
2017-05-18 23:11:41 +02:00
Glenn Ruben Bakke
234c9f3688
nrf5/drivers/softpwm: Renaming pwm_init to softpwm_init to not collide on symbol name with pwm_init in nrf52 machine PWM object.
2017-05-18 23:11:41 +02:00
Glenn Ruben Bakke
2584684e06
nrf5: Add modmusic QSTR definition of notes to qstrdefsport.h.
2017-05-18 23:11:41 +02:00
Glenn Ruben Bakke
c6b36ad4ca
nrf5: Update Makefile to include ticker.c and renamed softpwm. Updating also include paths to include modules/music and drivers/.
2017-05-18 23:11:41 +02:00
Glenn Ruben Bakke
52be9eec9d
nrf5: Adding include of modmusic.h in main.c.
2017-05-18 23:11:41 +02:00
Glenn Ruben Bakke
4c5c83567e
nrf5: Call microbit_music_init0() if enabled in main.c.
2017-05-18 23:11:41 +02:00
Glenn Ruben Bakke
6330fd4f31
nrf5/modules/music: Expose public init function for music module.
2017-05-18 23:11:41 +02:00
Glenn Ruben Bakke
d412241143
nrf5/modules/music: Update modmusic to use updated includes. Add extern ticks. Add function which implements initialization of pwm and ticker, register ticker callback, and start the pwm and ticker. This corresponds to microbit port main.cpp init.
2017-05-18 23:11:41 +02:00