|
@@ -19,6 +19,7 @@ func main() {
|
|
|
rightPort string
|
|
|
rightDriver string
|
|
|
mode driveMode
|
|
|
+ systemd bool
|
|
|
)
|
|
|
|
|
|
flag.StringVar(&device, "gamepad", "/dev/input/event0", "the gamepad device path")
|
|
@@ -28,8 +29,13 @@ func main() {
|
|
|
flag.StringVar(&rightPort, "motor-right-port", "spi0.1:MB", "the right motor port")
|
|
|
flag.StringVar(&rightDriver, "motor-right-driver", "lego-nxt-motor", "the right motor driver")
|
|
|
flag.Var(&mode, "mode", "the drive mode (default \"tank\")")
|
|
|
+ flag.BoolVar(&systemd, "systemd", false, "do not include timestamps in log since systemd already does")
|
|
|
flag.Parse()
|
|
|
|
|
|
+ if systemd {
|
|
|
+ log.SetFlags(0)
|
|
|
+ }
|
|
|
+
|
|
|
g, err := gamepad.NewGamepad(device, gamepad.All)
|
|
|
if err != nil {
|
|
|
log.Fatalf("error creating gamepad: %v", err)
|