Skip to content

Commit

Permalink
Add IO timer channel mode for RPM and also sync up rpi configuration …
Browse files Browse the repository at this point in the history
…to work with all these drivers
  • Loading branch information
MaEtUgR committed Dec 12, 2024
1 parent 31269c7 commit d5f0959
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion src/drivers/rpm_capture/RPMCapture.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit d5f0959

Please sign in to comment.