diff --git a/Tools/kconfig/allyesconfig.py b/Tools/kconfig/allyesconfig.py index 889b659195ed..04d89477816d 100644 --- a/Tools/kconfig/allyesconfig.py +++ b/Tools/kconfig/allyesconfig.py @@ -40,6 +40,7 @@ 'DRIVERS_DISTANCE_SENSOR_SRF05', # Requires hardcoded GPIO_ULTRASOUND 'DRIVERS_PPS_CAPTURE', # Requires PPS GPIO config 'DRIVERS_PWM_INPUT', # Requires PWM config + 'DRIVERS_RPM_CAPTURE', # Requires PPS GPIO config 'DRIVERS_TEST_PPM', # PIN config not portable 'DRIVERS_TATTU_CAN', # Broken needs fixing 'MODULES_REPLAY', # Fails on NuttX targets maybe force POSIX dependency? diff --git a/platforms/nuttx/src/px4/nxp/imxrt/include/px4_arch/io_timer.h b/platforms/nuttx/src/px4/nxp/imxrt/include/px4_arch/io_timer.h index 9ce7b374456d..f9e341a43cd9 100644 --- a/platforms/nuttx/src/px4/nxp/imxrt/include/px4_arch/io_timer.h +++ b/platforms/nuttx/src/px4/nxp/imxrt/include/px4_arch/io_timer.h @@ -68,7 +68,8 @@ typedef enum io_timer_channel_mode_t { IOTimerChanMode_Dshot = 6, IOTimerChanMode_LED = 7, IOTimerChanMode_PPS = 8, - IOTimerChanMode_Other = 9, + IOTimerChanMode_RPM = 9, + IOTimerChanMode_Other = 10, IOTimerChanModeSize } io_timer_channel_mode_t; diff --git a/platforms/nuttx/src/px4/nxp/kinetis/include/px4_arch/io_timer.h b/platforms/nuttx/src/px4/nxp/kinetis/include/px4_arch/io_timer.h index 788da87485fd..836e214472b8 100644 --- a/platforms/nuttx/src/px4/nxp/kinetis/include/px4_arch/io_timer.h +++ b/platforms/nuttx/src/px4/nxp/kinetis/include/px4_arch/io_timer.h @@ -67,7 +67,8 @@ typedef enum io_timer_channel_mode_t { IOTimerChanMode_Dshot = 6, IOTimerChanMode_LED = 7, IOTimerChanMode_PPS = 8, - IOTimerChanMode_Other = 9, + IOTimerChanMode_RPM = 9, + IOTimerChanMode_Other = 10, IOTimerChanModeSize } io_timer_channel_mode_t; diff --git a/platforms/nuttx/src/px4/nxp/rt106x/include/px4_arch/io_timer.h b/platforms/nuttx/src/px4/nxp/rt106x/include/px4_arch/io_timer.h index 9945e28de6c0..ca93f14a4f84 100644 --- a/platforms/nuttx/src/px4/nxp/rt106x/include/px4_arch/io_timer.h +++ b/platforms/nuttx/src/px4/nxp/rt106x/include/px4_arch/io_timer.h @@ -68,7 +68,8 @@ typedef enum io_timer_channel_mode_t { IOTimerChanMode_Dshot = 6, IOTimerChanMode_LED = 7, IOTimerChanMode_PPS = 8, - IOTimerChanMode_Other = 9, + IOTimerChanMode_RPM = 9, + IOTimerChanMode_Other = 10, IOTimerChanModeSize } io_timer_channel_mode_t; diff --git a/platforms/nuttx/src/px4/nxp/s32k1xx/include/px4_arch/io_timer.h b/platforms/nuttx/src/px4/nxp/s32k1xx/include/px4_arch/io_timer.h index 2454056a0354..82369986b517 100644 --- a/platforms/nuttx/src/px4/nxp/s32k1xx/include/px4_arch/io_timer.h +++ b/platforms/nuttx/src/px4/nxp/s32k1xx/include/px4_arch/io_timer.h @@ -63,7 +63,8 @@ typedef enum io_timer_channel_mode_t { IOTimerChanMode_Dshot = 6, IOTimerChanMode_LED = 7, IOTimerChanMode_PPS = 8, - IOTimerChanMode_Other = 9, + IOTimerChanMode_RPM = 9, + IOTimerChanMode_Other = 10, IOTimerChanModeSize } io_timer_channel_mode_t; diff --git a/platforms/nuttx/src/px4/nxp/s32k3xx/include/px4_arch/io_timer.h b/platforms/nuttx/src/px4/nxp/s32k3xx/include/px4_arch/io_timer.h index d093130b5180..d6e0ad6eb56a 100644 --- a/platforms/nuttx/src/px4/nxp/s32k3xx/include/px4_arch/io_timer.h +++ b/platforms/nuttx/src/px4/nxp/s32k3xx/include/px4_arch/io_timer.h @@ -63,7 +63,8 @@ typedef enum io_timer_channel_mode_t { IOTimerChanMode_Dshot = 6, IOTimerChanMode_LED = 7, IOTimerChanMode_PPS = 8, - IOTimerChanMode_Other = 9, + IOTimerChanMode_RPM = 9, + IOTimerChanMode_Other = 10, IOTimerChanModeSize } io_timer_channel_mode_t; diff --git a/platforms/nuttx/src/px4/rpi/rpi_common/include/px4_arch/io_timer.h b/platforms/nuttx/src/px4/rpi/rpi_common/include/px4_arch/io_timer.h index c9fbedd8f0bc..0d042d85ce05 100644 --- a/platforms/nuttx/src/px4/rpi/rpi_common/include/px4_arch/io_timer.h +++ b/platforms/nuttx/src/px4/rpi/rpi_common/include/px4_arch/io_timer.h @@ -73,6 +73,10 @@ typedef enum io_timer_channel_mode_t { IOTimerChanMode_OneShot = 4, IOTimerChanMode_Trigger = 5, IOTimerChanMode_Dshot = 6, + IOTimerChanMode_LED = 7, + IOTimerChanMode_PPS = 8, + IOTimerChanMode_RPM = 9, + IOTimerChanMode_Other = 10, IOTimerChanModeSize } io_timer_channel_mode_t; diff --git a/platforms/nuttx/src/px4/stm/stm32_common/include/px4_arch/io_timer.h b/platforms/nuttx/src/px4/stm/stm32_common/include/px4_arch/io_timer.h index 31d6e9b1c7e4..8f64a825b664 100644 --- a/platforms/nuttx/src/px4/stm/stm32_common/include/px4_arch/io_timer.h +++ b/platforms/nuttx/src/px4/stm/stm32_common/include/px4_arch/io_timer.h @@ -79,7 +79,8 @@ typedef enum io_timer_channel_mode_t { IOTimerChanMode_Dshot = 6, IOTimerChanMode_LED = 7, IOTimerChanMode_PPS = 8, - IOTimerChanMode_Other = 9, + IOTimerChanMode_RPM = 9, + IOTimerChanMode_Other = 10, IOTimerChanModeSize } io_timer_channel_mode_t; diff --git a/src/drivers/rpm_capture/RPMCapture.cpp b/src/drivers/rpm_capture/RPMCapture.cpp index 127fc633c315..1e054719032b 100644 --- a/src/drivers/rpm_capture/RPMCapture.cpp +++ b/src/drivers/rpm_capture/RPMCapture.cpp @@ -77,7 +77,7 @@ bool RPMCapture::init() return false; } - int ret = io_timer_allocate_channel(_channel, IOTimerChanMode_Other); // TODO: add IOTimerChanMode_RPM + int ret = io_timer_allocate_channel(_channel, IOTimerChanMode_RPM); if (ret != PX4_OK) { PX4_ERR("gpio alloc failed (%i) for RPM at channel (%d)", ret, _channel);