Skip to content

Commit 42c18c9

Browse files
committed
Low power variant supports Pyboard D.
1 parent 6873c0a commit 42c18c9

File tree

1 file changed

+21
-18
lines changed

1 file changed

+21
-18
lines changed

lowpower/README.md

Lines changed: 21 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
# A low power usayncio adaptation
22

3-
This is specific to Pyboards including the D series.
43
Release 0.11 9th April 2019
54

65
API change: low power applications must now import `rtc_time_cfg` and set its
76
`enabled` flag.
8-
Now supports Pyboard D.
7+
This is specific to Pyboards including the D series.
98

109
1. [Introduction](./README.md#1-introduction)
1110
2. [Installation](./README.md#2-installation)
@@ -146,9 +145,10 @@ scheduler is again paused (if `latency` > 0).
146145

147146
#### 3.2.1.1 Timing Accuracy and rollover
148147

149-
A minor limitation is that the Pyboard RTC cannot resolve times of less than
150-
4ms so there is a theoretical reduction in the accuracy of delays. In practice,
151-
as explained in the [tutorial](../TUTORIAL.md), issuing
148+
A minor limitation is that the Pyboard 1.x RTC cannot resolve times of less
149+
than 4ms so there is a theoretical reduction in the accuracy of delays. This
150+
does not apply to the Pyboard D. In practice this is somewhat academic. As
151+
explained in the [tutorial](../TUTORIAL.md), issuing
152152

153153
```python
154154
await asyncio.sleep_ms(t)
@@ -248,9 +248,10 @@ comparable to Pyboard 1.x.
248248

249249
This provides the following.
250250

251-
Variable:
251+
Variables (treat as read-only):
252252
* `use_utime` `True` if the `uasyncio` timebase is `utime`, `False` if it is
253-
the RTC. Treat as read-only.
253+
the RTC.
254+
* `d_series` `True` if running on Pyboard D, `False` if on Pyboard 1.x.
254255

255256
Functions:
256257
If the timebase is `utime` these are references to the corresponding `utime`
@@ -403,16 +404,18 @@ the design of the scheduler beyond the use of a different timebase. It does,
403404
however, rely on the fact that the scheduler algorithm behaves as described
404405
above.
405406

406-
`rtc_time` imports `rtc_time_cfg` and quits if `rtc_time_cfg.enabled` is
407-
`False`. This ensures that `uasyncio` will only be affected by the `rtc_time`
408-
module if `rtc_time` has specifically been enabled by application code.
409-
410-
The `rtc_time` module ensures that `uasyncio` uses `utime` for timing if the
411-
module is present in the path but is unused. This can occur because of an
412-
active USB connection or if running on an an incompatible platform.
413-
414-
The above precautions ensures that application behaviour and performance are
415-
unaffected unless `rtc_time` has been enabled, a USB connection is absent, and
416-
the hardware is a Pyboard 1.x or Pyboard D.
407+
By default `uasyncio` uses the `utime` module for timing. For the timing to be
408+
derived from the RTC the following conditions must be met:
409+
* Hardware must be a Pyboard 1.x, Pyboard D or compatible (i.e. able to use
410+
the `pyb` module).
411+
* The application must import `rtc_time_cfg` and set its `enabled` flag `True`
412+
before importing `uasyncio`.
413+
* `uasyncio` must be the `fast_io` version 2.4 or later.
414+
* The `rtc_time` module must be on the MicroPython search path.
415+
* There must be no active USB connection.
416+
417+
These constraints ensure there is no performance penalty unless an application
418+
specifically requires micropower operation. They also enable a USB connection
419+
to work if required for debugging.
417420

418421
###### [Contents](./README.md#a-low-power-usayncio-adaptation)

0 commit comments

Comments
 (0)