Skip to content

Commit 3d545ff

Browse files
committed
Prior to v3 directory
1 parent b03296e commit 3d545ff

File tree

2 files changed

+51
-58
lines changed

2 files changed

+51
-58
lines changed

README.md

Lines changed: 30 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,23 @@ code size and high performance on bare metal targets. This repository provides
66
documentation, tutorial material and code to aid in its effective use. It also
77
contains an optional `fast_io` variant of `uasyncio`.
88

9-
Damien has completely rewritten `uasyncio`. Its release is likely to be
10-
imminent, see
9+
Damien has completely rewritten `uasyncio`. V3.0 now been released, see
1110
[PR5332](https://github.com/micropython/micropython/pull/5332) and [below](./README.md#31-the-new-version).
1211

13-
## The fast_io variant
12+
#### NOTE ON NEW RELEASE
1413

15-
This comprises two parts.
16-
1. The [fast_io](./FASTPOLL.md) version of `uasyncio` is a "drop in"
17-
replacement for the official version providing bug fixes, additional
18-
functionality and, in certain respects, higher performance.
19-
2. An optional extension module enabling the [fast_io](./FASTPOLL.md) version
20-
to run with very low power draw. This is Pyboard-only including Pyboard D.
14+
The material in this repo largely relates to the old version V2.0 and I intend
15+
a substantial revision. I believe most of the material in the tutorial is still
16+
valid as it aims to be CPython compatible. I also expect the example scripts to
17+
work, based on testing with pre-release versions.
18+
19+
There is currently no support for fast I/O scheduling: I/O is scheduled in
20+
round robin fashion with other tasks. There are situations where this is too
21+
slow, for example in I2S applications and ones involving multiple fast I/O
22+
streams. In these applications there is still a use case for the fast_io
23+
version. I hope that the new version acquires a facility to prioritise I/O.
2124

22-
## Resources for users of all versions
25+
## Resources
2326

2427
* [A tutorial](./TUTORIAL.md) An introductory tutorial on asynchronous
2528
programming and the use of the `uasyncio` library.
@@ -44,33 +47,27 @@ This comprises two parts.
4447
* [Communication between devices](./syncom_as/README.md) Enables MicroPython
4548
boards to communicate without using a UART. This is hardware agnostic but
4649
slower than the I2C version.
47-
* [Under the hood](./UNDER_THE_HOOD.md) A guide to help understand the
48-
`uasyncio` code. For scheduler geeks and those wishing to modify `uasyncio`.
4950

50-
# 2. Version and installation of uasyncio
51+
## Resources specific to V2.0
5152

52-
Paul Sokolovsky (`uasyncio` author) has released versions of `uasyncio` which
53-
supercede the official version. His latest version is that on PyPi and requires
54-
his [Pycopy](https://github.com/pfalcon/micropython) fork of MicroPython
55-
firmware. His `uasyncio` code may also be found in
56-
[his fork of micropython-lib](https://github.com/pfalcon/micropython-lib).
53+
### The fast_io variant
5754

58-
I support only the official build of MicroPython. The library code guaranteed
59-
to work with this build is in [micropython-lib](https://github.com/micropython/micropython-lib).
60-
Most of the resources in here should work with Paul's forks (most work with
61-
CPython).
55+
This comprises two parts.
56+
1. The [fast_io](./FASTPOLL.md) version of `uasyncio` is a "drop in"
57+
replacement for the official version 2 providing bug fixes, additional
58+
functionality and, in certain respects, higher performance.
59+
2. An optional extension module enabling the [fast_io](./FASTPOLL.md) version
60+
to run with very low power draw. This is Pyboard-only including Pyboard D.
6261

63-
Most documentation and code in this repository assumes the current official
64-
version of `uasyncio`. This is V2.0 from
65-
[micropython-lib](https://github.com/micropython/micropython-lib).
66-
It is recommended to use MicroPython firmware V1.11 or later. On many platforms
67-
`uasyncio` is incorporated and no installation is required.
62+
### Under the hood
6863

69-
Some examples illustrate features of the `fast_io` fork and therefore require
70-
this version.
64+
[Under the hood](./UNDER_THE_HOOD.md) A guide to help understand the V2
65+
`uasyncio` code. For scheduler geeks and those wishing to modify `uasyncio`.
66+
67+
# 2. Version and installation of uasyncio
7168

72-
See [tutorial](./TUTORIAL.md#installing-uasyncio-on-bare-metal) for
73-
installation instructions where `uasyncio` is not pre-installed.
69+
The new release of `uasyncio` is pre-installed in current daily firmware
70+
builds.
7471

7572
# 3. uasyncio development state
7673

@@ -97,12 +94,8 @@ following features will involve minor changes to application code:
9794

9895
It is planned to retain V2 under a different name. The new version fixes bugs
9996
which have been outstanding for a long time. In my view V2 is best viewed as
100-
deprecated. I will retain V2-specific code and docs in a separate directory,
101-
with the rest of this repo being adapted for the new version.
102-
103-
#### 3.1.1.1 Tutorial
104-
105-
This requires only minor changes.
97+
deprecated. I will support V3 in a separate directory, the resources in this
98+
directory being retained for existing applications and users of V2 and fast_io.
10699

107100
#### 3.1.1.2 Fast I/O
108101

nec_ir/README.md

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@ The driver and test programs run on the Pyboard and ESP8266.
1010

1111
# Files
1212

13-
1. ``aremote.py`` The device driver.
14-
2. ``art.py`` A test program to characterise a remote.
15-
3. ``art1.py`` Control an onboard LED using a remote. The data and addresss
13+
1. `aremote.py` The device driver.
14+
2. `art.py` A test program to characterise a remote.
15+
3. `art1.py` Control an onboard LED using a remote. The data and addresss
1616
values need changing to match your characterised remote.
1717

1818
# Dependencies
1919

20-
The driver requires the ``uasyncio`` library and the file ``asyn.py`` from this
20+
The driver requires the `uasyncio` library and the file `asyn.py` from this
2121
repository.
2222

2323
# Usage
@@ -36,10 +36,10 @@ Data values are 8 bit. Addresses may be 8 or 16 bit depending on whether the
3636
remote uses extended addressing.
3737

3838
If a button is held down a repeat code is sent. In this event the driver
39-
returns a data value of ``REPEAT`` and the address associated with the last
39+
returns a data value of `REPEAT` and the address associated with the last
4040
valid data block.
4141

42-
To characterise a remote run ``art.py`` and note the data value for each button
42+
To characterise a remote run `art.py` and note the data value for each button
4343
which is to be used. If the address is less than 256, extended addressing is
4444
not in use.
4545

@@ -48,7 +48,7 @@ not in use.
4848
IR reception is inevitably subject to errors, notably if the remote is operated
4949
near the limit of its range, if it is not pointed at the receiver or if its
5050
batteries are low. So applications must check for, and usually ignore, errors.
51-
These are flagged by data values < ``REPEAT``.
51+
These are flagged by data values < `REPEAT`.
5252

5353
On the ESP8266 there is a further source of errors. This results from the large
5454
and variable interrupt latency of the device which can exceed the pulse
@@ -62,21 +62,21 @@ Users tend to press the key again if no acknowledgement is received.
6262

6363
The constructor takes the following positional arguments.
6464

65-
1. ``pin`` A ``Pin`` instance for the decoder chip.
66-
2. ``cb`` The user callback function.
67-
3. ``extended`` Set ``False`` to enable extra error checking if the remote
65+
1. `pin` A `Pin` instance for the decoder chip.
66+
2. `cb` The user callback function.
67+
3. `extended` Set `False` to enable extra error checking if the remote
6868
returns an 8 bit address.
6969
4. Further arguments, if provided, are passed to the callback.
7070

7171
The callback receives the following positional arguments:
7272

7373
1. The data value returned from the remote.
7474
2. The address value returned from the remote.
75-
3. Any further arguments provided to the ``NEC_IR`` constructor.
75+
3. Any further arguments provided to the `NEC_IR` constructor.
7676

7777
Negative data values are used to signal repeat codes and transmission errors.
7878

79-
The test program ``art1.py`` provides an example of a minimal application.
79+
The test program `art1.py` provides an example of a minimal application.
8080

8181
# How it works
8282

@@ -103,7 +103,7 @@ interrupt in a burst sets an event, passing the time of the state change. A
103103
coroutine waits on the event, yields for the duration of a data burst, then
104104
decodes the stored data before calling the user-specified callback.
105105

106-
Passing the time to the ``Event`` instance enables the coro to compensate for
106+
Passing the time to the `Event` instance enables the coro to compensate for
107107
any asyncio latency when setting its delay period.
108108

109109
The algorithm promotes interrupt handler speed over RAM use: the 276 bytes used
@@ -115,19 +115,19 @@ in the interrupt service routine.
115115
Data values passed to the callback are normally positive. Negative values
116116
indicate a repeat code or an error.
117117

118-
``REPEAT`` A repeat code was received.
118+
`REPEAT` A repeat code was received.
119119

120-
Any data value < ``REPEAT`` denotes an error. In general applications do not
120+
Any data value < `REPEAT` denotes an error. In general applications do not
121121
need to decode these, but they may be of use in debugging. For completeness
122122
they are listed below.
123123

124-
``BADSTART`` A short (<= 4ms) start pulse was received. May occur due to IR
124+
`BADSTART` A short (<= 4ms) start pulse was received. May occur due to IR
125125
interference, e.g. from fluorescent lights. The TSOP4838 is prone to producing
126126
200µs pulses on occasion, especially when using the ESP8266.
127-
``BADBLOCK`` A normal data block: too few edges received. Occurs on the ESP8266
127+
`BADBLOCK` A normal data block: too few edges received. Occurs on the ESP8266
128128
owing to high interrupt latency.
129-
``BADREP`` A repeat block: an incorrect number of edges were received.
130-
``OVERRUN`` A normal data block: too many edges received.
131-
``BADDATA`` Data did not match check byte.
132-
``BADADDR`` Where ``extended`` is ``False`` the 8-bit address is checked
129+
`BADREP` A repeat block: an incorrect number of edges were received.
130+
`OVERRUN` A normal data block: too many edges received.
131+
`BADDATA` Data did not match check byte.
132+
`BADADDR` Where `extended` is `False` the 8-bit address is checked
133133
against the check byte. This code is returned on failure.

0 commit comments

Comments
 (0)