Old behaviour is that anything that wasn't claimed (or failed to
allocate) would become a SITL RPM sensor. This meant we always had at
least one RPM sensor which was allocated but never provided valid data.
New behaviour is that if you want a SITL RPM sensor you have to set type
to 10.
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
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.
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.