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 19, 2024
1 parent b85ad98 commit 077ade4
Show file tree
Hide file tree
Showing 9 changed files with 18 additions and 7 deletions.
1 change: 1 addition & 0 deletions Tools/kconfig/allyesconfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -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?
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 @@ -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 077ade4

Please sign in to comment.