diff --git a/libraries/AP_RPM/RPM_PX4_PWM.cpp b/libraries/AP_RPM/RPM_PX4_PWM.cpp index bb3bff88b3..1adfe8cf78 100644 --- a/libraries/AP_RPM/RPM_PX4_PWM.cpp +++ b/libraries/AP_RPM/RPM_PX4_PWM.cpp @@ -16,6 +16,7 @@ #include #if CONFIG_HAL_BOARD == HAL_BOARD_PX4 || CONFIG_HAL_BOARD == HAL_BOARD_VRBRAIN +#include #include "RPM_PX4_PWM.h" #include @@ -35,12 +36,21 @@ extern const AP_HAL::HAL& hal; +extern "C" { + int pwm_input_main(int, char **); +}; + /* open the sensor in constructor */ AP_RPM_PX4_PWM::AP_RPM_PX4_PWM(AP_RPM &_ap_rpm, uint8_t instance, AP_RPM::RPM_State &_state) : AP_RPM_Backend(_ap_rpm, instance, _state) { +#ifndef CONFIG_ARCH_BOARD_PX4FMU_V1 + if (AP_BoardConfig::px4_start_driver(pwm_input_main, "pwm_input", "start")) { + hal.console->printf("started pwm_input driver\n"); + } +#endif _fd = open(PWMIN0_DEVICE_PATH, O_RDONLY); if (_fd == -1) { hal.console->printf("Unable to open %s\n", PWMIN0_DEVICE_PATH);