From ae2ee399c2cfe42526f3962c1c6a5c1a1bac89bc Mon Sep 17 00:00:00 2001 From: Marco Bauer Date: Thu, 11 Jul 2013 13:18:54 +1000 Subject: [PATCH] PX4: added support for mkblctrl driver this enables runtime support for the mkblctrl I2C ESC drivers --- mk/PX4/ROMFS/init.d/rc.APM | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/mk/PX4/ROMFS/init.d/rc.APM b/mk/PX4/ROMFS/init.d/rc.APM index 7f564a7746..75024d5c2e 100644 --- a/mk/PX4/ROMFS/init.d/rc.APM +++ b/mk/PX4/ROMFS/init.d/rc.APM @@ -3,9 +3,17 @@ # APM startup script for NuttX on PX4 # To disable APM startup add a /fs/microsd/APM/nostart file +# To enable mkblctrl startup add a /fs/microsd/APM/mkblctrl file +# To enable mavlink on ttys0 add a /fs/microsd/APM/mavlink-ttys0 file set deviceA /dev/ttyACM0 -set deviceC /dev/ttyS2 + +if [ -f /fs/microsd/APM/mavlink-ttys0 ] +then + set deviceC /dev/ttyS0 +else + set deviceC /dev/ttyS2 +fi # check for an old file called APM, caused by # a bug in an earlier firmware release @@ -96,6 +104,20 @@ then else echo "No PX4IO board found" echo "No PX4IO board found" >> $logfile + + if [ -f /fs/microsd/APM/mkblctrl ] + then + echo "APM/mkblctrl found - switch to MK I2C ESCs" + echo "APM/mkblctrl found - switch to MK I2C ESCs" >> $logfile + echo "Setting up mkblctrl driver" + echo "Setting up mkblctrl driver" >> $logfile + sleep 1 + mkblctrl -mkmode x + sleep 1 + + + fi + echo "Setting up PX4FMU direct mode" fmu mode_pwm if [ $deviceC == /dev/ttyS1 ]