|
| 1 | +--- |
| 2 | +author: "@dlech" |
| 3 | +title: "Kernel Release Cycle 16" |
| 4 | +--- |
| 5 | + |
| 6 | +There is nothing too exciting in this release. Most of the changes are for |
| 7 | +adding support for a new BeagleBone cape that is being developed. |
| 8 | + |
| 9 | +This release includes one bug fix. Support for polling the `status` attribute |
| 10 | +of the tacho motor class has been restored for EV3. (It is still broken for |
| 11 | +BrickPi and PiStorms.) |
| 12 | + |
| 13 | +<!--more--> |
| 14 | + |
| 15 | +Here is an example of how to make use of this feature: |
| 16 | + |
| 17 | +{% highlight python %} |
| 18 | +#!/usr/bin/env python3 |
| 19 | + |
| 20 | +# 1. Connect motors first! |
| 21 | +# 2. Run this program in a terminal |
| 22 | +# 3. Control the motors in a second terminal |
| 23 | +# 4. Watch the output of this program |
| 24 | +# 5. Press CTRL+C to stop this program |
| 25 | + |
| 26 | +import glob |
| 27 | +import select |
| 28 | + |
| 29 | +motors = glob.glob('/sys/class/tacho-motor/motor*') |
| 30 | +p = select.poll() |
| 31 | +lookup = {} |
| 32 | + |
| 33 | +for m in motors: |
| 34 | + # get the output port name for each motor |
| 35 | + with open(m + '/address', 'r') as a: |
| 36 | + name = a.read().strip() |
| 37 | + |
| 38 | + # get a handle to the status attribute |
| 39 | + s = open(m + '/state', 'r') |
| 40 | + |
| 41 | + # register the status attribute with the poll object. POLLPRI is important! |
| 42 | + p.register(s, select.POLLPRI) |
| 43 | + |
| 44 | + # save these for later |
| 45 | + lookup[s.fileno()] = (name, s) |
| 46 | + |
| 47 | +while True: |
| 48 | + # wait for a an event |
| 49 | + for fd, event in p.poll(): |
| 50 | + # get the info for the motor that caused the event |
| 51 | + name, s = lookup[fd] |
| 52 | + |
| 53 | + if event & select.POLLPRI: |
| 54 | + # print info about the event |
| 55 | + s.seek(0) |
| 56 | + print(name, s.read().strip()) |
| 57 | + else: |
| 58 | + print(name, 'Poll error!') |
| 59 | +{% endhighlight %} |
| 60 | + |
| 61 | +### Version Info |
| 62 | + |
| 63 | +In this round of releases, we have: |
| 64 | + |
| 65 | +* `v4.4.24-16-ev3dev-ev3` for EV3. |
| 66 | +* `v4.4.24-ti-rt-r55-16-ev3dev-bb.org` for BeagleBone. |
| 67 | +* `v4.4.23-16-ev3dev-rpi` for Raspberry Pi 0/1. |
| 68 | +* `v4.4.23-16-ev3dev-rpi2` for Raspberry Pi 2/3. |
| 69 | + |
| 70 | +You can also find this kernel in [snapshot build][download] `2016-10-15`. |
| 71 | + |
| 72 | +[download]: https://oss.jfrog.org/list/oss-snapshot-local/org/ev3dev/brickstrap/ |
| 73 | + |
| 74 | +### Changelogs |
| 75 | + |
| 76 | +For a more complete changelog, follow the link for your platform: |
| 77 | +[EV3][ev3-changelog], [BB][bb.org-changelog], [RPi][rpi-changelog] or [RPi2][rpi2-changelog]. |
| 78 | + |
| 79 | +[ev3-changelog]: https://github.com/ev3dev/ev3dev-kpkg/blob/560058bd7d84fd2a0a086c3b24117f0fedb1dd01/ev3dev-ev3/changelog |
| 80 | +[bb.org-changelog]: https://github.com/ev3dev/ev3dev-kpkg/blob/560058bd7d84fd2a0a086c3b24117f0fedb1dd01/ev3dev-bb.org/changelog |
| 81 | +[rpi-changelog]: https://github.com/ev3dev/ev3dev-kpkg/blob/560058bd7d84fd2a0a086c3b24117f0fedb1dd01/ev3dev-rpi/changelog |
| 82 | +[rpi2-changelog]: https://github.com/ev3dev/ev3dev-kpkg/blob/560058bd7d84fd2a0a086c3b24117f0fedb1dd01/ev3dev-rpi2/changelog |
0 commit comments