Copter: consider health of primary compass in SYS_STATUS, pre-arm and compassmot

this should prevent users from taking off with only secondary compass
AP_NavEKF : Clean up angle and mag field initialisation

This path reduces duplicated code, eliminates unused variables and
causes the earth magnetic field states to be reset when exiting static mode
which will occur every time copter is armed. This enables copters to be
powered on and initialised inside vehicles or houses, without bad earth
field values affecting flight.
HAL_PX4: fixes for merged upstream PX4Firmware
DataFlash: fixed a build warning
AP_HAL: removed RCInput valid_channels() and added new_input() and num_channels()

the valid_channels() method was inconsistently implemented between
boards, and served two quite different purposes. It is clearer as two
functions
Rover: updates for new RCInput API
Copter: updates for new RCInput API
Plane: updates for new RCInput API
Rover: support 14 RC channels on PX4
Copter: support 14 RC channels on PX4
Plane: support 14 RC channels on PX4
GCS_MAVLink: merge latest msgs from upstream
GCS_MAVLink: rebuild MAVLink headers
Plane: report up to 18 RC input channels via MAVLink
Rover: support 18 input channels in MAVLink
Copter: support 18 input channels in MAVLink
RC_Channel: support up to 12 aux channels on PX4

this allows RC13 and RC14 to work correctly as aux outputs on Pixhawk
DataFlash: support logging up to 14 RC input channels
build: added APM_BUILD_DIRECTORY define to build

this makes it possible to have different default parameter values for
different vehicle types in libraries, as long as you use the makefile
based build
AP_Vehicle: added defines for main vehicle types