From 88c3e067d541c193663b5787a3ddfe86318cc0ce Mon Sep 17 00:00:00 2001 From: Sebastian Reichel Date: Tue, 31 Jul 2012 01:48:33 +0200 Subject: log changes of atmostripe --- actuators/motor/atmostripe.vala | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/actuators/motor/atmostripe.vala b/actuators/motor/atmostripe.vala index b20cc44..81c1d1a 100644 --- a/actuators/motor/atmostripe.vala +++ b/actuators/motor/atmostripe.vala @@ -28,6 +28,11 @@ public class AtmostripeMotorController : SerialDevice, MotorController { nop(); nop(); nop(); + enable(); + } + + ~AtmostripeMotorController() { + disable(); } public bool disable() { @@ -37,6 +42,8 @@ public class AtmostripeMotorController : SerialDevice, MotorController { buf[2] = 0xBA; buf[3] = 0xBE; + log("Atmostripe", LogLevelFlags.LEVEL_DEBUG, "disable"); + write(buf, 4); read(buf, 1); @@ -53,6 +60,8 @@ public class AtmostripeMotorController : SerialDevice, MotorController { buf[2] = 0xBA; buf[3] = 0xBE; + log("Atmostripe", LogLevelFlags.LEVEL_DEBUG, "enable"); + write(buf, 4); read(buf, 1); @@ -69,6 +78,8 @@ public class AtmostripeMotorController : SerialDevice, MotorController { write(buf, 1); read(buf, 1); + log("Atmostripe", LogLevelFlags.LEVEL_DEBUG, "nop"); + if(buf[0] == '.') return true; else @@ -83,6 +94,8 @@ public class AtmostripeMotorController : SerialDevice, MotorController { if(engine > 5) return false; + log("Atmostripe", LogLevelFlags.LEVEL_DEBUG, "set single"); + write(buf, 2); read(buf, 2); @@ -97,6 +110,8 @@ public class AtmostripeMotorController : SerialDevice, MotorController { buf[0] = 0xff; buf[1] = speed; + log("Atmostripe", LogLevelFlags.LEVEL_DEBUG, "set all"); + write(buf, 2); read(buf, 2); -- cgit v1.2.3