diff options
| author | Scott Shawcroft <scott.shawcroft@gmail.com> | 2017-06-20 10:56:05 -0700 |
|---|---|---|
| committer | Scott Shawcroft <scott.shawcroft@gmail.com> | 2017-06-20 10:56:05 -0700 |
| commit | 30ee7019ca651bce1fe966c1089fe977d51dc92b (patch) | |
| tree | 0114b6f744dd175b7722dd8edcbe24f4ee84bb45 /examples/hwapi | |
| parent | 97fcdfbd08c922efd7470d6482d7c7c703ffc0ae (diff) | |
| parent | 869cdcfdfc860b1177baf9b0f8818915ba54f3f5 (diff) | |
Merge tag 'v1.9.1'2.0.0-alpha.0
Fixes for stmhal USB mass storage, lwIP bindings and VFS regressions
This release provides an important fix for the USB mass storage device in
the stmhal port by implementing the SCSI SYNCHRONIZE_CACHE command, which
is now require by some Operating Systems. There are also fixes for the
lwIP bindings to improve non-blocking sockets and error codes. The VFS has
some regressions fixed including the ability to statvfs the root.
All changes are listed below.
py core:
- modbuiltins: add core-provided version of input() function
- objstr: catch case of negative "maxsplit" arg to str.rsplit()
- persistentcode: allow to compile with complex numbers disabled
- objstr: allow to compile with obj-repr D, and unicode disabled
- modsys: allow to compile with obj-repr D and PY_ATTRTUPLE disabled
- provide mp_decode_uint_skip() to help reduce stack usage
- makeqstrdefs.py: make script run correctly with Python 2.6
- objstringio: if created from immutable object, follow copy on write policy
extmod:
- modlwip: connect: for non-blocking mode, return EINPROGRESS
- modlwip: fix error codes for duplicate calls to connect()
- modlwip: accept: fix error code for non-blocking mode
- vfs: allow to statvfs the root directory
- vfs: allow "buffering" and "encoding" args to VFS's open()
- modframebuf: fix signed/unsigned comparison pendantic warning
lib:
- libm: use isfinite instead of finitef, for C99 compatibility
- utils/interrupt_char: remove support for KBD_EXCEPTION disabled
tests:
- basics/string_rsplit: add tests for negative "maxsplit" argument
- float: convert "sys.exit()" to "raise SystemExit"
- float/builtin_float_minmax: PEP8 fixes
- basics: convert "sys.exit()" to "raise SystemExit"
- convert remaining "sys.exit()" to "raise SystemExit"
unix port:
- convert to use core-provided version of built-in import()
- Makefile: replace references to make with $(MAKE)
windows port:
- convert to use core-provided version of built-in import()
qemu-arm port:
- Makefile: adjust object-file lists to get correct dependencies
- enable micropython.mem_*() functions to allow more tests
stmhal port:
- boards: enable DAC for NUCLEO_F767ZI board
- add support for NUCLEO_F446RE board
- pass USB handler as parameter to allow more than one USB handler
- usb: use local USB handler variable in Start-of-Frame handler
- usb: make state for USB device private to top-level USB driver
- usbdev: for MSC implement SCSI SYNCHRONIZE_CACHE command
- convert from using stmhal's input() to core provided version
cc3200 port:
- convert from using stmhal's input() to core provided version
teensy port:
- convert from using stmhal's input() to core provided version
esp8266 port:
- Makefile: replace references to make with $(MAKE)
- Makefile: add clean-modules target
- convert from using stmhal's input() to core provided version
zephyr port:
- modusocket: getaddrinfo: Fix mp_obj_len() usage
- define MICROPY_PY_SYS_PLATFORM (to "zephyr")
- machine_pin: use native Zephyr types for Zephyr API calls
docs:
- machine.Pin: remove out_value() method
- machine.Pin: add on() and off() methods
- esp8266: consistently replace Pin.high/low methods with .on/off
- esp8266/quickref: polish Pin.on()/off() examples
- network: move confusingly-named cc3200 Server class to its reference
- uos: deconditionalize, remove minor port-specific details
- uos: move cc3200 port legacy VFS mounting functions to its ref doc
- machine: sort machine classes in logical order, not alphabetically
- network: first step to describe standard network class interface
examples:
- embedding: use core-provided KeyboardInterrupt object
Diffstat (limited to 'examples/hwapi')
| -rw-r--r-- | examples/hwapi/button_reaction.py | 8 | ||||
| -rw-r--r-- | examples/hwapi/hwconfig_dragonboard410c.py | 6 | ||||
| -rw-r--r-- | examples/hwapi/hwconfig_esp8266_esp12.py | 6 | ||||
| -rw-r--r-- | examples/hwapi/hwconfig_pyboard.py | 13 | ||||
| -rw-r--r-- | examples/hwapi/hwconfig_z_96b_carbon.py | 9 | ||||
| -rw-r--r-- | examples/hwapi/hwconfig_z_frdm_k64f.py | 4 | ||||
| -rw-r--r-- | examples/hwapi/soft_pwm.py | 4 | ||||
| -rw-r--r-- | examples/hwapi/soft_pwm2_uasyncio.py | 2 |
8 files changed, 37 insertions, 15 deletions
diff --git a/examples/hwapi/button_reaction.py b/examples/hwapi/button_reaction.py index 5e1890d5a..b72e813e4 100644 --- a/examples/hwapi/button_reaction.py +++ b/examples/hwapi/button_reaction.py @@ -11,9 +11,9 @@ Ready? Cliiiiick! """) while 1: - try: - delay = machine.time_pulse_us(BUTTON, 1, 10*1000*1000) - print("You are as slow as %d microseconds!" % delay) - except OSError: + delay = machine.time_pulse_us(BUTTON, 1, 10*1000*1000) + if delay < 0: print("Well, you're *really* slow") + else: + print("You are as slow as %d microseconds!" % delay) utime.sleep_ms(10) diff --git a/examples/hwapi/hwconfig_dragonboard410c.py b/examples/hwapi/hwconfig_dragonboard410c.py index 8061d7b74..eec358203 100644 --- a/examples/hwapi/hwconfig_dragonboard410c.py +++ b/examples/hwapi/hwconfig_dragonboard410c.py @@ -1,4 +1,4 @@ -from machine import Pin +from machine import Pin, Signal # 96Boards/Qualcomm DragonBoard 410c # @@ -13,10 +13,10 @@ from machine import Pin # echo -n "gpio_keys" >/sys/class/input/input1/device/driver/unbind # User LED 1 on gpio21 -LED = Pin(21, Pin.OUT) +LED = Signal(Pin(21, Pin.OUT)) # User LED 2 on gpio120 -LED2 = Pin(120, Pin.OUT) +LED2 = Signal(Pin(120, Pin.OUT)) # Button S3 on gpio107 BUTTON = Pin(107, Pin.IN) diff --git a/examples/hwapi/hwconfig_esp8266_esp12.py b/examples/hwapi/hwconfig_esp8266_esp12.py index e8cf2d12e..2e855ee3d 100644 --- a/examples/hwapi/hwconfig_esp8266_esp12.py +++ b/examples/hwapi/hwconfig_esp8266_esp12.py @@ -1,5 +1,5 @@ -from machine import Pin +from machine import Pin, Signal # ESP12 module as used by many boards -# Blue LED on pin 2 -LED = Pin(2, Pin.OUT) +# Blue LED on pin 2, active low (inverted) +LED = Signal(2, Pin.OUT, invert=True) diff --git a/examples/hwapi/hwconfig_pyboard.py b/examples/hwapi/hwconfig_pyboard.py new file mode 100644 index 000000000..fb260033e --- /dev/null +++ b/examples/hwapi/hwconfig_pyboard.py @@ -0,0 +1,13 @@ +from machine import Pin, Signal + +# Red LED on pin LED_RED also kown as A13 +LED = Signal('LED_RED', Pin.OUT) + +# Green LED on pin LED_GREEN also known as A14 +LED2 = Signal('LED_GREEN', Pin.OUT) + +# Yellow LED on pin LED_YELLOW also known as A15 +LED3 = Signal('LED_YELLOW', Pin.OUT) + +# Blue LED on pin LED_BLUE also known as B4 +LED4 = Signal('LED_BLUE', Pin.OUT) diff --git a/examples/hwapi/hwconfig_z_96b_carbon.py b/examples/hwapi/hwconfig_z_96b_carbon.py new file mode 100644 index 000000000..97fd57a07 --- /dev/null +++ b/examples/hwapi/hwconfig_z_96b_carbon.py @@ -0,0 +1,9 @@ +from machine import Signal + +# 96Boards Carbon board +# USR1 - User controlled led, connected to PD2 +# USR2 - User controlled led, connected to PA15 +# BT - Bluetooth indicator, connected to PB5. +# Note - 96b_carbon uses (at the time of writing) non-standard +# for Zephyr port device naming convention. +LED = Signal(("GPIOA", 15), Pin.OUT) diff --git a/examples/hwapi/hwconfig_z_frdm_k64f.py b/examples/hwapi/hwconfig_z_frdm_k64f.py index c45e3e756..377c63878 100644 --- a/examples/hwapi/hwconfig_z_frdm_k64f.py +++ b/examples/hwapi/hwconfig_z_frdm_k64f.py @@ -1,5 +1,5 @@ -from machine import Pin +from machine import Pin, Signal # Freescale/NXP FRDM-K64F board # Blue LED on port B, pin 21 -LED = Pin(("GPIO_1", 21), Pin.OUT) +LED = Signal(("GPIO_1", 21), Pin.OUT) diff --git a/examples/hwapi/soft_pwm.py b/examples/hwapi/soft_pwm.py index a9a556171..72291b0ec 100644 --- a/examples/hwapi/soft_pwm.py +++ b/examples/hwapi/soft_pwm.py @@ -14,10 +14,10 @@ def pwm_cycle(led, duty, cycles): duty_off = 20 - duty for i in range(cycles): if duty: - led.value(1) + led.on() utime.sleep_ms(duty) if duty_off: - led.value(0) + led.off() utime.sleep_ms(duty_off) diff --git a/examples/hwapi/soft_pwm2_uasyncio.py b/examples/hwapi/soft_pwm2_uasyncio.py index abeb4b1bf..908ef2d8a 100644 --- a/examples/hwapi/soft_pwm2_uasyncio.py +++ b/examples/hwapi/soft_pwm2_uasyncio.py @@ -27,5 +27,5 @@ async def fade_in_out(LED): loop = uasyncio.get_event_loop() loop.create_task(fade_in_out(LED)) -loop.call_later_ms_(800, fade_in_out(LED2)) +loop.call_later_ms(800, fade_in_out(LED2)) loop.run_forever() |
