Skip to content

Commit d5f0959

Browse files
committed
Add IO timer channel mode for RPM and also sync up rpi configuration to work with all these drivers
1 parent 31269c7 commit d5f0959

File tree

8 files changed

+17
-7
lines changed

8 files changed

+17
-7
lines changed

platforms/nuttx/src/px4/nxp/imxrt/include/px4_arch/io_timer.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,8 @@ typedef enum io_timer_channel_mode_t {
6868
IOTimerChanMode_Dshot = 6,
6969
IOTimerChanMode_LED = 7,
7070
IOTimerChanMode_PPS = 8,
71-
IOTimerChanMode_Other = 9,
71+
IOTimerChanMode_RPM = 9,
72+
IOTimerChanMode_Other = 10,
7273
IOTimerChanModeSize
7374
} io_timer_channel_mode_t;
7475

platforms/nuttx/src/px4/nxp/kinetis/include/px4_arch/io_timer.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,8 @@ typedef enum io_timer_channel_mode_t {
6767
IOTimerChanMode_Dshot = 6,
6868
IOTimerChanMode_LED = 7,
6969
IOTimerChanMode_PPS = 8,
70-
IOTimerChanMode_Other = 9,
70+
IOTimerChanMode_RPM = 9,
71+
IOTimerChanMode_Other = 10,
7172
IOTimerChanModeSize
7273
} io_timer_channel_mode_t;
7374

platforms/nuttx/src/px4/nxp/rt106x/include/px4_arch/io_timer.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,8 @@ typedef enum io_timer_channel_mode_t {
6868
IOTimerChanMode_Dshot = 6,
6969
IOTimerChanMode_LED = 7,
7070
IOTimerChanMode_PPS = 8,
71-
IOTimerChanMode_Other = 9,
71+
IOTimerChanMode_RPM = 9,
72+
IOTimerChanMode_Other = 10,
7273
IOTimerChanModeSize
7374
} io_timer_channel_mode_t;
7475

platforms/nuttx/src/px4/nxp/s32k1xx/include/px4_arch/io_timer.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,8 @@ typedef enum io_timer_channel_mode_t {
6363
IOTimerChanMode_Dshot = 6,
6464
IOTimerChanMode_LED = 7,
6565
IOTimerChanMode_PPS = 8,
66-
IOTimerChanMode_Other = 9,
66+
IOTimerChanMode_RPM = 9,
67+
IOTimerChanMode_Other = 10,
6768
IOTimerChanModeSize
6869
} io_timer_channel_mode_t;
6970

platforms/nuttx/src/px4/nxp/s32k3xx/include/px4_arch/io_timer.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,8 @@ typedef enum io_timer_channel_mode_t {
6363
IOTimerChanMode_Dshot = 6,
6464
IOTimerChanMode_LED = 7,
6565
IOTimerChanMode_PPS = 8,
66-
IOTimerChanMode_Other = 9,
66+
IOTimerChanMode_RPM = 9,
67+
IOTimerChanMode_Other = 10,
6768
IOTimerChanModeSize
6869
} io_timer_channel_mode_t;
6970

platforms/nuttx/src/px4/rpi/rpi_common/include/px4_arch/io_timer.h

+4
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,10 @@ typedef enum io_timer_channel_mode_t {
7373
IOTimerChanMode_OneShot = 4,
7474
IOTimerChanMode_Trigger = 5,
7575
IOTimerChanMode_Dshot = 6,
76+
IOTimerChanMode_LED = 7,
77+
IOTimerChanMode_PPS = 8,
78+
IOTimerChanMode_RPM = 9,
79+
IOTimerChanMode_Other = 10,
7680
IOTimerChanModeSize
7781
} io_timer_channel_mode_t;
7882

platforms/nuttx/src/px4/stm/stm32_common/include/px4_arch/io_timer.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,8 @@ typedef enum io_timer_channel_mode_t {
7979
IOTimerChanMode_Dshot = 6,
8080
IOTimerChanMode_LED = 7,
8181
IOTimerChanMode_PPS = 8,
82-
IOTimerChanMode_Other = 9,
82+
IOTimerChanMode_RPM = 9,
83+
IOTimerChanMode_Other = 10,
8384
IOTimerChanModeSize
8485
} io_timer_channel_mode_t;
8586

src/drivers/rpm_capture/RPMCapture.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ bool RPMCapture::init()
7777
return false;
7878
}
7979

80-
int ret = io_timer_allocate_channel(_channel, IOTimerChanMode_Other); // TODO: add IOTimerChanMode_RPM
80+
int ret = io_timer_allocate_channel(_channel, IOTimerChanMode_RPM);
8181

8282
if (ret != PX4_OK) {
8383
PX4_ERR("gpio alloc failed (%i) for RPM at channel (%d)", ret, _channel);

0 commit comments

Comments
 (0)