Commit Graph

13 Commits

Author SHA1 Message Date
Peter Barker 5a0f0915ed AP_RPM: tidy constructors and use of config.h 2023-08-17 09:22:41 +10:00
Tom Pittenger 0de754bff3 AP_RPM: prepare for AP_Periph 2023-08-11 13:31:45 -07:00
Pierre Kancir 0959f926f4 AP_RPM: More const and remove useless default assignement.
We don't need to set quality to 0 as it will be always setted after.
2023-06-14 17:58:43 +10:00
Pierre Kancir 5a9542be81 AP_RPM: make dt_avg a float value by using float division
Previously, it was using interger division and thus lost the fractional part
2023-06-14 17:58:43 +10:00
Peter Barker 63c551ce13 AP_RPM: add and use AP_RPM_ENABLED
... and backend-specific equivalents
2022-09-20 09:28:27 +10:00
Randy Mackay bfd168dd4f AP_RPM: avoid attach interrupt retry and spam to GCS if PIN = -1 2022-04-25 08:59:03 +09:00
Gone4Dirt df1280e999 AP_RPM: Whitespace changes 2021-08-25 09:36:58 +10:00
Gone4Dirt 5bb4729d61 AP_RPM: Restructure params to be per instance of _params 2021-08-25 09:36:58 +10:00
Andrew Tridgell e862c349e8 AP_RPM: set pin to input before attaching interrupt
this fixes input on AUX6 on CubeBlack
2018-11-08 18:25:14 +11:00
Peter Barker 20027bad17 AP_RPM: attach_interrupt now takes a functor
AP_RPM: move PX4 IRQ handling into AP_HAL_PX4

AP_RPM: correct RPM sensor initialisation

The initialisation code used the type from the wrong configuration
parameters (if the first rpm sensor wasn't configured then the sensing
for the second sensor would use the type from the first).

The packing of drivers[...] was done in a non-sparse manner - i.e. if a
sensor wasn't detected then it would not take up space in the array.
The PX4 PWM backend relies on the instance number (offset in the drivers
array) corresponding to the parameters, so making this sparse is
required.

The main detection block fills in drivers based on the number of
instances detected so far, but the nullptr check checks based on the
number of detected backends.  If the second instance wasn't configured we
wouldn't attempt to configure a third.

AP_RPM: add error reporting for attaching of interrupts

AP_RPM: use detach_interrupt method

AP_RPM: use (uint8_t)-1 in place of 255
2018-08-21 20:34:01 +09:00
Andrew Tridgell c2adc26051 AP_RPM: support RPM pin input on ChibiOS 2018-04-07 09:10:29 +10:00
Andrew Tridgell 1c5607b42d AP_RPM: fixed build for aero-fc 2017-04-07 17:45:10 +10:00
Andrew Tridgell 9e2cfabb8a AP_RPM: support RPM input on any AUX pin 2017-04-04 16:33:45 +10:00