From a3fed608a6b47ad0473f2bbfc5893db109a79f1b Mon Sep 17 00:00:00 2001 From: Daniel Agar Date: Fri, 30 Nov 2018 14:38:06 -0500 Subject: [PATCH] move airmind_mindpx-v2 init to rc.board --- ROMFS/px4fmu_common/init.d/rc.sensors | 14 -------- ROMFS/px4fmu_common/init.d/rcS | 8 ----- ROMFS/px4fmu_test/init.d/rc.sensors | 25 ------------- boards/airmind/mindpx-v2/init/rc.board | 49 ++++++++++++++++++++++++++ boards/px4/fmu-v4/init/rc.board | 2 ++ 5 files changed, 51 insertions(+), 47 deletions(-) create mode 100644 boards/airmind/mindpx-v2/init/rc.board diff --git a/ROMFS/px4fmu_common/init.d/rc.sensors b/ROMFS/px4fmu_common/init.d/rc.sensors index 4e7e32d08a..29a1db04e6 100644 --- a/ROMFS/px4fmu_common/init.d/rc.sensors +++ b/ROMFS/px4fmu_common/init.d/rc.sensors @@ -51,20 +51,6 @@ then fi -if ver hwcmp AIRMIND_MINDPX_V2 -then - # External I2C bus - hmc5883 -C -T -X start - - # Internal I2C bus - hmc5883 -C -T -I -R 12 start - - mpu6000 -s -R 8 start - mpu9250 -s -R 8 start - lsm303d -R 10 start - l3gd20 -R 14 start -fi - if ver hwcmp ATMEL_SAME70XPLAINED_V1 then # External I2C bus diff --git a/ROMFS/px4fmu_common/init.d/rcS b/ROMFS/px4fmu_common/init.d/rcS index 86c801266d..22a070ac3f 100644 --- a/ROMFS/px4fmu_common/init.d/rcS +++ b/ROMFS/px4fmu_common/init.d/rcS @@ -461,14 +461,6 @@ else vmount start fi - # - # Launch the flow sensor as a background task. - # - if ver hwcmp PX4_FMU_V4 AIRMIND_MINDPX_V2 - then - px4flow start & - fi - # # Start any custom addons. # diff --git a/ROMFS/px4fmu_test/init.d/rc.sensors b/ROMFS/px4fmu_test/init.d/rc.sensors index faba7263a0..7c6b4e17a6 100644 --- a/ROMFS/px4fmu_test/init.d/rc.sensors +++ b/ROMFS/px4fmu_test/init.d/rc.sensors @@ -21,31 +21,6 @@ if adc start then fi -if ver hwcmp AIRMIND_MINDPX_V2 -then - # External I2C bus - if hmc5883 -C -T -X start - then - fi - - # Internal I2C bus - if hmc5883 -C -T -I -R 12 start - then - fi - - if mpu9250 -s -R 8 start - then - fi - - if lsm303d -R 10 start - then - fi - - if l3gd20 -R 14 start - then - fi -fi - if sdp3x_airspeed start then fi diff --git a/boards/airmind/mindpx-v2/init/rc.board b/boards/airmind/mindpx-v2/init/rc.board new file mode 100644 index 0000000000..fc11c75e68 --- /dev/null +++ b/boards/airmind/mindpx-v2/init/rc.board @@ -0,0 +1,49 @@ +#!nsh +# +# Airmind Mindpx-v2 specific board init +# +#------------------------------------------------------------------------------ +# +# UART mapping: +# +# UART1 /dev/ttyS0 wifi +# USART2 /dev/ttyS1 TELEM1 (flow control) +# USART3 /dev/ttyS2 TELEM2 (flow control) +# UART4 +# UART7 CONSOLE +# UART8 /dev/ttyS6 SERIAL4/TELEM4 +# +#------------------------------------------------------------------------------ +# + +# We know there are sketchy boards out there +# as chinese companies produce Pixracers without +# fully understanding the critical parts of the +# schematic and BOM, leading to sensor brownouts +# on boot. Original Pixracers following the +# open hardware design do not require this. +fmu sensor_reset 50 + +if [ $AUTOCNF = yes ] +then + # Disable safety switch by default + param set CBRK_IO_SAFETY 22027 + + param set SYS_FMU_TASK 1 +fi + +set MIXER_AUX none + + +# External I2C bus +hmc5883 -C -T -X start + +# Internal I2C bus +hmc5883 -C -T -I -R 12 start + +mpu6000 -s -R 8 start +mpu9250 -s -R 8 start +lsm303d -R 10 start +l3gd20 -R 14 start + +px4flow start & diff --git a/boards/px4/fmu-v4/init/rc.board b/boards/px4/fmu-v4/init/rc.board index f3f394c179..9c35de5a59 100644 --- a/boards/px4/fmu-v4/init/rc.board +++ b/boards/px4/fmu-v4/init/rc.board @@ -90,3 +90,5 @@ if param compare TEL_FRSKY_CONFIG 0 then frsky_telemetry start -d /dev/ttyS6 -t 15 fi + +px4flow start &