Repository navigation
#651 - #655
#651#655JakubVanek wants to merge 6 commits into
Conversation
- the kernel is smart enough to detect the tacho motor on its own - the port is by default in auto mode, so this allows the use of write-if-different to handle this attribute write; this way the mode switch can be avoided entirely in the usual cases
- other platforms cannot detect a motor, but they are probably also a lot faster than EV3 http://docs.ev3dev.org/projects/lego-linux-drivers/en/ev3dev-stretch/motors.html#motor-autodetect
|
I have now noticed that other platforms really do not work with |
|
The timeout issue can actually be reproduced with a medium motor on EV3 on the 2.3.4 kernel. EDIT: the issue is happening on a brick overclocked to 456 MHz. |
|
Tested on package issues;
import ev3dev.actuators.lego.motors.EV3MediumRegulatedMotor;
import lejos.hardware.port.MotorPort;
public class Issue655 {
public static void main(String[] args) {
for (int i = 0; i < 10; i++) {
EV3MediumRegulatedMotor m = new EV3MediumRegulatedMotor(MotorPort.D);
m.stop();
}
}
}Before the fix, with 300 MHz CPU clock and a medium motor in port D, this crashes on the first iteration. With the fix, all ten iterations succeed. |
|
This PR makes the BaseRegulatedMotor delay less necessary - it avoids triggering the udev asynchronous process if the port is already in the correct mode. This can be felt the most on the EV3 platform. The crashes were worked around by increasing the delay to 1000ms, however I have done it only in the |
|
Rejected by weighing testing difficulty |
|
Rejected |
This implements the proposed write-if-different solution. Also, to actually make use of it, it uses
automode for tacho motors.