diff --git a/libraries/AP_HAL/AP_HAL_Boards.h b/libraries/AP_HAL/AP_HAL_Boards.h index 18bc4ad28e..8599307259 100644 --- a/libraries/AP_HAL/AP_HAL_Boards.h +++ b/libraries/AP_HAL/AP_HAL_Boards.h @@ -8,7 +8,7 @@ #define HAL_BOARD_SITL 3 #define HAL_BOARD_SMACCM 4 // unused -#define HAL_BOARD_PX4 5 +#define HAL_BOARD_PX4 5 // unused #define HAL_BOARD_LINUX 7 #define HAL_BOARD_VRBRAIN 8 #define HAL_BOARD_CHIBIOS 10 @@ -39,25 +39,6 @@ #define HAL_BOARD_SUBTYPE_LINUX_RST_ZYNQ 1021 #define HAL_BOARD_SUBTYPE_LINUX_POCKET 1022 -/* HAL PX4 sub-types, starting at 2000 */ -#define HAL_BOARD_SUBTYPE_PX4_V1 2000 -#define HAL_BOARD_SUBTYPE_PX4_V2 2001 -#define HAL_BOARD_SUBTYPE_PX4_V4 2002 -#define HAL_BOARD_SUBTYPE_PX4_V3 2003 -#define HAL_BOARD_SUBTYPE_PX4_AEROFC_V1 2004 -#define HAL_BOARD_SUBTYPE_PX4_V4PRO 2005 - -/* HAL VRBRAIN sub-types, starting at 4000 */ -#define HAL_BOARD_SUBTYPE_VRBRAIN_V45 4000 -#define HAL_BOARD_SUBTYPE_VRBRAIN_V51 4001 -#define HAL_BOARD_SUBTYPE_VRBRAIN_V52 4002 -#define HAL_BOARD_SUBTYPE_VRUBRAIN_V51 4003 -#define HAL_BOARD_SUBTYPE_VRUBRAIN_V52 4004 -#define HAL_BOARD_SUBTYPE_VRCORE_V10 4005 -#define HAL_BOARD_SUBTYPE_VRBRAIN_V54 4006 -#define HAL_BOARD_SUBTYPE_VRBRAIN_V52E 4007 - - /* HAL CHIBIOS sub-types, starting at 5000 */ #define HAL_BOARD_SUBTYPE_CHIBIOS_SKYVIPER_F412 5000 #define HAL_BOARD_SUBTYPE_CHIBIOS_FMUV3 5001 @@ -170,8 +151,6 @@ #if CONFIG_HAL_BOARD == HAL_BOARD_SITL #include -#elif CONFIG_HAL_BOARD == HAL_BOARD_PX4 - #include #elif CONFIG_HAL_BOARD == HAL_BOARD_LINUX #include #elif CONFIG_HAL_BOARD == HAL_BOARD_EMPTY diff --git a/libraries/AP_HAL/AP_HAL_Main.h b/libraries/AP_HAL/AP_HAL_Main.h index 60203568d8..0cb1cade8e 100644 --- a/libraries/AP_HAL/AP_HAL_Main.h +++ b/libraries/AP_HAL/AP_HAL_Main.h @@ -18,10 +18,6 @@ #include "HAL.h" -#if CONFIG_HAL_BOARD == HAL_BOARD_PX4 || CONFIG_HAL_BOARD == HAL_BOARD_VRBRAIN -#define AP_MAIN __EXPORT ArduPilot_main -#endif - #ifndef AP_MAIN #define AP_MAIN main #endif diff --git a/libraries/AP_HAL/board/px4.h b/libraries/AP_HAL/board/px4.h deleted file mode 100644 index eef3f2a1fc..0000000000 --- a/libraries/AP_HAL/board/px4.h +++ /dev/null @@ -1,161 +0,0 @@ -#pragma once - -#define HAL_BOARD_NAME "PX4" -#define HAL_CPU_CLASS HAL_CPU_CLASS_150 -#define HAL_OS_POSIX_IO 1 - -// put all storage of files under /fs/microsd/APM directory -#ifndef HAL_BOARD_STORAGE_DIRECTORY -#define HAL_BOARD_STORAGE_DIRECTORY "/fs/microsd/APM" -#endif - -#define HAL_BOARD_LOG_DIRECTORY HAL_BOARD_STORAGE_DIRECTORY "/LOGS" -#define HAL_BOARD_TERRAIN_DIRECTORY HAL_BOARD_STORAGE_DIRECTORY "/TERRAIN" -#define HAL_PARAM_DEFAULTS_PATH "/etc/defaults.parm" -#define HAL_INS_DEFAULT HAL_INS_PX4 -#define HAL_BARO_DEFAULT HAL_BARO_PX4 -#define HAL_COMPASS_DEFAULT HAL_COMPASS_PX4 - -#define HAL_HAVE_GETTIME_SETTIME 1 - -#ifdef CONFIG_ARCH_BOARD_PX4FMU_V1 -#define CONFIG_HAL_BOARD_SUBTYPE HAL_BOARD_SUBTYPE_PX4_V1 -#define HAL_STORAGE_SIZE 8192 -#define HAL_MINIMIZE_FEATURES 1 -#elif defined(CONFIG_ARCH_BOARD_PX4FMU_V3) -// check for V3 before V2 as V3 also defines V2 -#define CONFIG_HAL_BOARD_SUBTYPE HAL_BOARD_SUBTYPE_PX4_V3 -#define HAL_STORAGE_SIZE 16384 -#define HAL_HAVE_IMU_HEATER 1 // for Pixhawk2 -#define HAL_IMU_TEMP_DEFAULT -1 // disabled -#define HAL_WITH_UAVCAN 1 -#elif defined(CONFIG_ARCH_BOARD_PX4FMU_V2) -#define CONFIG_HAL_BOARD_SUBTYPE HAL_BOARD_SUBTYPE_PX4_V2 -#define HAL_STORAGE_SIZE 16384 -#define HAL_HAVE_IMU_HEATER 1 // for Pixhawk2 -#define HAL_IMU_TEMP_DEFAULT -1 // disabled -#define HAL_WITH_UAVCAN 1 -#define HAL_MINIMIZE_FEATURES 1 -#elif defined(CONFIG_ARCH_BOARD_PX4FMU_V4) -#define CONFIG_HAL_BOARD_SUBTYPE HAL_BOARD_SUBTYPE_PX4_V4 -#define HAL_STORAGE_SIZE 16384 -#define HAL_WITH_UAVCAN 1 -#elif defined(CONFIG_ARCH_BOARD_PX4FMU_V4PRO) -#define CONFIG_HAL_BOARD_SUBTYPE HAL_BOARD_SUBTYPE_PX4_V4PRO -#define HAL_STORAGE_SIZE 16384 -#define HAL_WITH_UAVCAN 1 -#elif defined(CONFIG_ARCH_BOARD_AEROFC_V1) -#define CONFIG_HAL_BOARD_SUBTYPE HAL_BOARD_SUBTYPE_PX4_AEROFC_V1 -#define HAL_STORAGE_SIZE 16384 -#define USE_FLASH_STORAGE 1 -#define HAL_RCOUTPUT_TAP_DEVICE "/dev/ttyS0" -// we don't have any sdcard -#undef HAL_BOARD_LOG_DIRECTORY -#undef HAL_BOARD_TERRAIN_DIRECTORY -#else -#error "Unknown PX4 board type" -#endif - -#define HAL_GPIO_A_LED_PIN 27 -#define HAL_GPIO_B_LED_PIN 26 -#define HAL_GPIO_C_LED_PIN 25 -#define HAL_GPIO_LED_ON 1 -#define HAL_GPIO_LED_OFF 0 - -#define HAL_BARO_MS5611_NAME "ms5611" -#define HAL_BARO_MS5611_SPI_INT_NAME "ms5611_int" -#define HAL_BARO_MS5611_SPI_EXT_NAME "ms5611_ext" - -#define HAL_INS_MPU60x0_NAME "mpu6000" -#define HAL_INS_MPU60x0_EXT_NAME "mpu6000_ext" - -#define HAL_INS_LSM9DS0_G_NAME "lsm9ds0_g" -#define HAL_INS_LSM9DS0_A_NAME "lsm9ds0_am" - -#define HAL_INS_LSM9DS0_EXT_G_NAME "lsm9ds0_ext_g" -#define HAL_INS_LSM9DS0_EXT_A_NAME "lsm9ds0_ext_am" - -#define HAL_INS_MPU9250_NAME "mpu9250" -#define HAL_INS_MPU9250_EXT_NAME "mpu9250_ext" - -#define HAL_INS_MPU6500_NAME "mpu6500" - -#define HAL_INS_ICM20608_NAME "icm20608" -#define HAL_INS_ICM20608_AM_NAME "icm20608-am" -#define HAL_INS_ICM20608_EXT_NAME "icm20608_ext" - -#define HAL_COMPASS_HMC5843_NAME "hmc5843" -#define HAL_COMPASS_LIS3MDL_NAME "lis3mdl" - -/* px4fmu-v1 */ -#ifdef CONFIG_ARCH_BOARD_PX4FMU_V1 -#define HAL_BARO_MS5611_I2C_ADDR 0x76 -#define HAL_BARO_MS5611_I2C_BUS 0 -#define HAL_HAVE_BOARD_VOLTAGE 0 -#define HAL_PX4_HAVE_PWM_INPUT 0 -#endif - -/* px4fmu-v4 */ -#ifdef CONFIG_ARCH_BOARD_PX4FMU_V4 -#define HAL_PX4_HAVE_PX4IO 0 -#endif - -/* aerofc-v1 */ -#ifdef CONFIG_ARCH_BOARD_AEROFC_V1 -#define HAL_BARO_MS5607_I2C_ADDR 0x77 -#define HAL_BARO_MS5607_I2C_BUS 0 -#define HAL_COMPASS_IST8310_I2C_ADDR 0x0E -#define HAL_COMPASS_IST8310_I2C_BUS 1 -#define HAL_SERIAL0_BAUD_DEFAULT 921600 - -#define HAL_HAVE_BOARD_VOLTAGE 0 -#define HAL_HAVE_SAFETY_SWITCH 0 -#define HAL_PX4_HAVE_MTD_SUPPORT 0 -#define HAL_PX4_HAVE_PX4IO 0 -#define HAL_PX4_HAVE_PWM_INPUT 0 -#endif - -/* default values */ -#ifndef HAL_SERIAL0_BAUD_DEFAULT -#define HAL_SERIAL0_BAUD_DEFAULT 115200 -#endif - -#ifndef HAL_HAVE_BOARD_VOLTAGE -#define HAL_HAVE_BOARD_VOLTAGE 1 -#endif - -#ifndef HAL_HAVE_SERVO_VOLTAGE -#define HAL_HAVE_SERVO_VOLTAGE 1 -#endif - -#ifndef HAL_PX4_HAVE_MTD_SUPPORT -#define HAL_PX4_HAVE_MTD_SUPPORT 1 -#endif - -#ifndef HAL_PX4_HAVE_PX4IO -#define HAL_PX4_HAVE_PX4IO 1 -#endif - -#ifndef HAL_PX4_HAVE_PWM_INPUT -#define HAL_PX4_HAVE_PWM_INPUT 1 -#endif - -#ifndef HAL_HAVE_SAFETY_SWITCH -#define HAL_HAVE_SAFETY_SWITCH 1 -#endif - -#ifndef AP_FEATURE_RTSCTS -#define AP_FEATURE_RTSCTS 1 -#endif - -#ifndef AP_FEATURE_SBUS_OUT -#define AP_FEATURE_SBUS_OUT 1 -#endif - -#ifndef HAL_WITH_UAVCAN -#define HAL_WITH_UAVCAN 0 -#endif - -#include -#define HAL_Semaphore PX4::Semaphore -#define HAL_Semaphore_Recursive PX4::Semaphore_Recursive diff --git a/libraries/AP_HAL/board/vrbrain.h b/libraries/AP_HAL/board/vrbrain.h deleted file mode 100644 index 7b8fe55d16..0000000000 --- a/libraries/AP_HAL/board/vrbrain.h +++ /dev/null @@ -1,104 +0,0 @@ -#pragma once - -#define HAL_BOARD_NAME "VRBRAIN" -#define HAL_CPU_CLASS HAL_CPU_CLASS_150 -#define HAL_OS_POSIX_IO 1 -#define HAL_BOARD_LOG_DIRECTORY "/fs/microsd/APM/LOGS" -#define HAL_BOARD_TERRAIN_DIRECTORY "/fs/microsd/APM/TERRAIN" -#define HAL_PARAM_DEFAULTS_PATH "/etc/defaults.parm" -#define HAL_INS_DEFAULT HAL_INS_VRBRAIN -#define HAL_BARO_DEFAULT HAL_BARO_VRBRAIN -#define HAL_COMPASS_DEFAULT HAL_COMPASS_VRBRAIN - -#define HAL_HAVE_GETTIME_SETTIME 1 - -#ifdef CONFIG_ARCH_BOARD_VRBRAIN_V45 -#define CONFIG_HAL_BOARD_SUBTYPE HAL_BOARD_SUBTYPE_VRBRAIN_V45 -#define HAL_STORAGE_SIZE 8192 -#elif defined(CONFIG_ARCH_BOARD_VRBRAIN_V51) -#define CONFIG_HAL_BOARD_SUBTYPE HAL_BOARD_SUBTYPE_VRBRAIN_V51 -#define HAL_STORAGE_SIZE 16384 -#elif defined(CONFIG_ARCH_BOARD_VRBRAIN_V52) -#define CONFIG_HAL_BOARD_SUBTYPE HAL_BOARD_SUBTYPE_VRBRAIN_V52 -#define HAL_STORAGE_SIZE 16384 -#elif defined(CONFIG_ARCH_BOARD_VRBRAIN_V52E) -#define CONFIG_HAL_BOARD_SUBTYPE HAL_BOARD_SUBTYPE_VRBRAIN_V52E -#define HAL_STORAGE_SIZE 8192 -#elif defined(CONFIG_ARCH_BOARD_VRUBRAIN_V51) -#define CONFIG_HAL_BOARD_SUBTYPE HAL_BOARD_SUBTYPE_VRUBRAIN_V51 -#define HAL_STORAGE_SIZE 8192 -#elif defined(CONFIG_ARCH_BOARD_VRUBRAIN_V52) -#define CONFIG_HAL_BOARD_SUBTYPE HAL_BOARD_SUBTYPE_VRUBRAIN_V52 -#define HAL_STORAGE_SIZE 8192 -#elif defined(CONFIG_ARCH_BOARD_VRCORE_V10) -#define CONFIG_HAL_BOARD_SUBTYPE HAL_BOARD_SUBTYPE_VRCORE_V10 -#define HAL_STORAGE_SIZE 16384 -#elif defined(CONFIG_ARCH_BOARD_VRBRAIN_V54) -#define CONFIG_HAL_BOARD_SUBTYPE HAL_BOARD_SUBTYPE_VRBRAIN_V54 -#define HAL_STORAGE_SIZE 16384 -#else -#error "Unknown VRBRAIN board type" -#endif - -#define HAL_GPIO_A_LED_PIN 25 -#define HAL_GPIO_B_LED_PIN 26 -#define HAL_GPIO_C_LED_PIN 27 -#define HAL_GPIO_LED_ON 1 -#define HAL_GPIO_LED_OFF 0 -#define EXTERNAL_LED_GPS 28 // GPS LED - AN10 -#define EXTERNAL_LED_ARMED 29 // Armed LED - AN11 -#define EXTERNAL_LED_MOTOR1 30 // Motor1 LED - AN8 -#define EXTERNAL_LED_MOTOR2 31 // Motor2 LED - AN12 -#define HAL_BUZZER_PIN 32 - -#define HAL_BARO_MS5611_NAME "ms5611" -#define HAL_BARO_MS5611_SPI_INT_NAME "ms5611_int" -#define HAL_BARO_MS5611_SPI_EXT_NAME "ms5611_ext" -#define HAL_BARO_MS5611_SPI_IMU_NAME "ms5611_imu" - -#define HAL_INS_MPU60x0_NAME "mpu6000" -#define HAL_INS_MPU60x0_EXT_NAME "mpu6000_ext" -#define HAL_INS_MPU60x0_IMU_NAME "mpu6000_imu" - -#define HAL_INS_LSM9DS0_G_NAME "lsm9ds0_g" -#define HAL_INS_LSM9DS0_A_NAME "lsm9ds0_am" - -#define HAL_INS_LSM9DS0_EXT_G_NAME "lsm9ds0_ext_g" -#define HAL_INS_LSM9DS0_EXT_A_NAME "lsm9ds0_ext_am" - -#define HAL_INS_MPU9250_NAME "mpu9250" -#define HAL_INS_MPU9250_EXT_NAME "mpu9250_ext" - -#define HAL_INS_MPU6500_NAME "mpu6500" - -#define HAL_INS_ICM20608_NAME "icm20608" -#define HAL_INS_ICM20608_AM_NAME "icm20608-am" -#define HAL_INS_ICM20608_EXT_NAME "icm20608_ext" - -#define HAL_COMPASS_HMC5843_NAME "hmc5843" -#define HAL_COMPASS_HMC5843_EXT_NAME "hmc5843_ext" -#define HAL_COMPASS_HMC5843_IMU_NAME "hmc5843_imu" -#define HAL_COMPASS_LIS3MDL_NAME "lis3mdl" - -#ifndef HAL_HAVE_BOARD_VOLTAGE -#define HAL_HAVE_BOARD_VOLTAGE 0 -#endif - -#ifndef HAL_HAVE_BOARD_VOLTAGE -#define HAL_HAVE_SERVO_VOLTAGE 1 -#endif - -#ifndef HAL_PX4_HAVE_MTD_SUPPORT -#define HAL_PX4_HAVE_MTD_SUPPORT 1 -#endif -#ifndef HAL_PX4_HAVE_PWM_INPUT -#define HAL_PX4_HAVE_PWM_INPUT 1 -#endif - -#ifndef HAL_HAVE_SAFETY_SWITCH -#define HAL_HAVE_SAFETY_SWITCH 1 -#endif - -#include -#define HAL_Semaphore VRBRAIN::Semaphore - diff --git a/libraries/AP_HAL/examples/RCInput/RCInput.cpp b/libraries/AP_HAL/examples/RCInput/RCInput.cpp index e8e59f9b36..b233ade9d6 100644 --- a/libraries/AP_HAL/examples/RCInput/RCInput.cpp +++ b/libraries/AP_HAL/examples/RCInput/RCInput.cpp @@ -6,7 +6,7 @@ // we need a boardconfig created so that the io processor's enable // parameter is available -#if HAL_WITH_IO_MCU || CONFIG_HAL_BOARD == HAL_BOARD_PX4 || CONFIG_HAL_BOARD == HAL_BOARD_VRBRAIN +#if HAL_WITH_IO_MCU #include #include AP_BoardConfig BoardConfig; @@ -25,7 +25,7 @@ static uint16_t last_value[MAX_CHANNELS]; void setup(void) { hal.console->printf("Starting RCInput test\n"); -#if HAL_WITH_IO_MCU || CONFIG_HAL_BOARD == HAL_BOARD_PX4 || CONFIG_HAL_BOARD == HAL_BOARD_VRBRAIN +#if HAL_WITH_IO_MCU BoardConfig.init(); #endif } diff --git a/libraries/AP_HAL/utility/RCOutput_Tap_Nuttx.cpp b/libraries/AP_HAL/utility/RCOutput_Tap_Nuttx.cpp deleted file mode 100644 index ff0a5bb2b9..0000000000 --- a/libraries/AP_HAL/utility/RCOutput_Tap_Nuttx.cpp +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (C) 2017 Intel Corporation. All rights reserved. - * - * This file is free software: you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This file is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * See the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program. If not, see . - */ -#include - -#if CONFIG_HAL_BOARD == HAL_BOARD_PX4 && CONFIG_HAL_BOARD_SUBTYPE == HAL_BOARD_SUBTYPE_PX4_AEROFC_V1 - -#include "RCOutput_Tap.h" - -#include -#include - -namespace ap { - -bool RCOutput_Tap::_uart_set_speed(int speed) -{ - if (_uart_fd < 0) { - return false; - } - - struct termios uart_config; - memset(&uart_config, 0, sizeof(uart_config)); - tcgetattr(_uart_fd, &uart_config); - - // set baud rate - if (cfsetispeed(&uart_config, speed) < 0 || cfsetospeed(&uart_config, speed) < 0) { - return false; - } - - if (tcsetattr(_uart_fd, TCSANOW, &uart_config) < 0) { - return false; - } - - return true; -} - -} - -#endif