Commit Graph

46 Commits

Author SHA1 Message Date
Tom Pittenger 2646e37e2c AP_RPM: set health false if disabled during runtime 2019-02-01 09:20:30 +09:00
Peter Barker 08173796d9 APM_RPM: remove PX4 backend type 2019-01-17 12:30:56 +11: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 34008ad29c AP_RPM: add override keyword where required 2018-11-08 11:30:12 +11:00
Andrew Tridgell 9b3788c83c AP_RPM: treat RPM_TYPE 1 as type 2 on non-PX4
makes upgrades easier
2018-10-17 13:55:01 +11:00
Peter Barker a8d8e5c0ef AP_RPM: remove unused variable 2018-10-16 10:17:12 +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
Peter Barker ec6e2b9da8 AP_RPM: remove unneeded initialisations
These should always be static
2018-07-23 13:53:09 +09:00
Patrick José Pereira 00cb588257 AP_RPM: Use SITL singleton
Signed-off-by: Patrick José Pereira <patrickelectric@gmail.com>
2018-06-26 00:02:01 +01:00
Andrew Tridgell c2adc26051 AP_RPM: support RPM pin input on ChibiOS 2018-04-07 09:10:29 +10:00
LukeMike a319f6632f VRBRAIN / AP_RPM: removed RPM_PX4_PWM for VR Brain 5.1 and VR Micro Brain 5.2 (they haven't this input pin) 2018-02-05 08:26:49 +11:00
Andrew Tridgell 9b4fef4d50 AP_RPM: removed create() method for objects
See discussion here:

  https://github.com/ArduPilot/ardupilot/issues/7331

we were getting some uninitialised variables. While it only showed up in
AP_SbusOut, it means we can't be sure it won't happen on other objects,
so safest to remove the approach

Thanks to assistance from Lucas, Peter and Francisco
2017-12-14 08:12:28 +11:00
Lucas De Marchi de5e044b02 global: use static method to construct AP_RPM 2017-09-26 03:01:21 +01:00
Lucas De Marchi aefae9381e AP_RPM: add static create method 2017-09-26 03:01:21 +01:00
Pierre Kancir 09364085ed AP_RPM: example fix travis warning
missing function declaration
implicit cast
some style fix
2017-04-13 19:56:16 +01: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
Lucas De Marchi 5809e2465b AP_RPM: replace board ifdef with feature ifdef 2017-03-24 12:06:19 +11:00
Lucas De Marchi b17acfee12 Add aerofc support
Flight Controller board that comes on Intel Aero RTF Drone.
2017-03-24 12:06:19 +11:00
murata 81ef065c53 AP_RPM: Unify from print or println to printf. 2017-01-27 18:20:22 +11:00
Andrew Tridgell 0fb959a309 AP_RPM: make pwm_input driver start on demand 2016-11-11 15:49:53 +11:00
murata c808ee2f49 Global: To nullptr from NULL.
RC_Channel: To nullptr from NULL.

AC_Fence: To nullptr from NULL.

AC_Avoidance: To nullptr from NULL.

AC_PrecLand: To nullptr from NULL.

DataFlash: To nullptr from NULL.

SITL: To nullptr from NULL.

GCS_MAVLink: To nullptr from NULL.

DataFlash: To nullptr from NULL.

AP_Compass: To nullptr from NULL.

Global: To nullptr from NULL.

Global: To nullptr from NULL.
2016-11-02 16:04:47 -02:00
Peter Barker ecd061dad5 AP_RPM: add missing parameter metadata 2016-10-27 09:15:03 -07:00
Mathieu OTHACEHE 152edf7189 Global: remove mode line from headers
Using a global .dir-locals.el file is a better alternative than
reincluding the same emacs header in every file of the project.
2016-10-24 09:42:01 -02:00
Lucas De Marchi ae53920e5b build: don't build examples with old build system
We currently check examples are buildable with waf which doesn't need
the libraries to be specified in a make.inc file.  Having the makefiles
there is misleading since people try to build and realize the build is
broken.
2016-10-11 13:03:08 +11:00
Andrew Tridgell 232347569f AP_RPM: use RPM_SCALING in SITL
useful for testing low RPM warning in a GCS
2016-09-02 11:12:18 +10:00
Andrew Tridgell c6d3f07b5f AP_RPM: provide an RPM quality in SITL 2016-07-28 12:39:07 +10:00
AndersonRayner aaa8709194 AP_RPM: Added an example script 2016-05-19 19:01:03 -03:00
Andrew Tridgell 8571202199 AP_RPM: allow for low RPM measurements on PX4
this automatically adjusts the timer resolution to allow for low RPM
measurements on PX4
2016-05-14 18:05:13 +10:00
Ricardo de Almeida Gonzaga 5bd034a5a8 Global: start using cmath instead of math.h 2016-04-05 21:06:19 -07:00
Lucas De Marchi 109f807260 AP_RPM: replace header guard with pragma once 2016-03-16 18:40:43 +11:00
Will Sackfield 723e166c13 AP RPM: Initialise backend with _instance
* Unsure how this worked in the past
2016-02-29 14:14:37 +11:00
Robert Lefebvre 59a44008d7 AP_RPM: Move timeout check into synthetic quality check. 2015-12-08 08:25:19 +11:00
Robert Lefebvre fd106b20c7 AP_RPM: Add Minimum Quality Parameter 2015-12-08 08:25:19 +11:00
Robert Lefebvre 1f8b90e876 AP_RPM: Move filter step outside of min/max rpm check 2015-12-08 08:25:19 +11:00
Robert Lefebvre f04668307d AP_RPM: Add Minimum RPM parameter 2015-12-08 08:25:18 +11:00
Robert Lefebvre 968599b795 AP_RPM: Add Signal Quality synthetic method. 2015-12-08 08:25:18 +11:00
Robert Lefebvre a08fa50fda AP_RPM: Add enabled() method to check if sensor is enabled 2015-12-08 08:25:18 +11:00
Andrew Tridgell 45ea2a9b68 AP_RPM: added a SITL RPM backend 2015-11-23 14:30:42 +11:00
Andrew Tridgell 7375f395f9 AP_RPM: added optional PWM logging 2015-11-20 17:02:46 +11:00
Caio Marcelo de Oliveira Filho 9639add306 AP_RPM: use millis/micros/panic functions 2015-11-20 12:33:57 +09:00
Lucas De Marchi 831d8acca5 Remove use of PROGMEM
Now variables don't have to be declared with PROGMEM anymore, so remove
them. This was automated with:

    git grep -l -z PROGMEM | xargs -0 sed -i 's/ PROGMEM / /g'
    git grep -l -z PROGMEM | xargs -0 sed -i 's/PROGMEM//g'

The 2 commands were done so we don't leave behind spurious spaces.

AVR-specific places were not changed.
2015-10-30 14:35:16 +09:00
Andrew Tridgell ac363c5447 AP_RPM: added RPM_MAX parameter
attempt to avoid noise in the pulses
2015-09-25 12:05:43 +10:00
Andrew Tridgell fdb104b5b6 AP_RPM: fixed build error 2015-08-12 20:50:09 +10:00
Andrew Tridgell 129f33c26d AP_RPM: define a minimum acceptable period for PWM input
this will reject very short periods as invalid. This helps somewhat
with noise on the line
2015-08-12 15:03:51 +10:00
Andrew Tridgell 39c219d452 AP_RPM: first version of RPM sensor driver 2015-08-12 15:03:49 +10:00