diff --git a/Tools/AP_Periph/AP_Periph.cpp b/Tools/AP_Periph/AP_Periph.cpp index 8c9b6c16bb..50dbbaa4ca 100644 --- a/Tools/AP_Periph/AP_Periph.cpp +++ b/Tools/AP_Periph/AP_Periph.cpp @@ -245,6 +245,10 @@ void AP_Periph_FW::init() temperature_sensor.init(); #endif +#if HAL_NMEA_OUTPUT_ENABLED + nmea.init(); +#endif + #ifdef HAL_PERIPH_ENABLE_NOTIFY notify.init(); #endif @@ -442,6 +446,10 @@ void AP_Periph_FW::update() #endif } +#if HAL_NMEA_OUTPUT_ENABLED + nmea.update(); +#endif + #if AP_TEMPERATURE_SENSOR_ENABLED temperature_sensor.update(); #endif diff --git a/Tools/AP_Periph/AP_Periph.h b/Tools/AP_Periph/AP_Periph.h index 543b64c942..a558976462 100644 --- a/Tools/AP_Periph/AP_Periph.h +++ b/Tools/AP_Periph/AP_Periph.h @@ -24,6 +24,13 @@ #include #include + +#include +#if HAL_NMEA_OUTPUT_ENABLED && !(HAL_GCS_ENABLED && defined(HAL_PERIPH_ENABLE_GPS)) + // Needs SerialManager + (AHRS or GPS) + #error "AP_NMEA_Output requires Serial/GCS and either AHRS or GPS. Needs HAL_GCS_ENABLED and HAL_PERIPH_ENABLE_GPS" +#endif + #if HAL_GCS_ENABLED #include "GCS_MAVLink.h" #endif @@ -128,6 +135,10 @@ public: #endif #endif +#if HAL_NMEA_OUTPUT_ENABLED + AP_NMEA_Output nmea; +#endif + #ifdef HAL_PERIPH_ENABLE_MAG Compass compass; #endif diff --git a/Tools/AP_Periph/Parameters.cpp b/Tools/AP_Periph/Parameters.cpp index a8538b50f7..2bedc723e7 100644 --- a/Tools/AP_Periph/Parameters.cpp +++ b/Tools/AP_Periph/Parameters.cpp @@ -517,6 +517,12 @@ const AP_Param::Info AP_Periph_FW::var_info[] = { GOBJECT(proximity, "PRX", AP_Proximity), #endif +#if HAL_NMEA_OUTPUT_ENABLED + // @Group: NMEA_ + // @Path: ../libraries/AP_NMEA_Output/AP_NMEA_Output.cpp + GOBJECT(nmea, "NMEA_", AP_NMEA_Output), +#endif + AP_VAREND }; diff --git a/Tools/AP_Periph/Parameters.h b/Tools/AP_Periph/Parameters.h index 1b728a9419..f62607593a 100644 --- a/Tools/AP_Periph/Parameters.h +++ b/Tools/AP_Periph/Parameters.h @@ -69,6 +69,7 @@ public: k_param_proximity_baud, k_param_proximity_port, k_param_proximity_max_rate, + k_param_nmea, }; AP_Int16 format_version; diff --git a/Tools/AP_Periph/wscript b/Tools/AP_Periph/wscript index 1388a91525..d6a733b5ff 100644 --- a/Tools/AP_Periph/wscript +++ b/Tools/AP_Periph/wscript @@ -46,6 +46,7 @@ def build(bld): 'AP_SerialManager', 'AP_RTC', 'AP_Compass', + 'AP_NMEA_Output', 'AP_Baro', 'Filter', 'AP_InternalError',