diff --git a/Tools/AP_Periph/AP_Periph.h b/Tools/AP_Periph/AP_Periph.h index 3b8d18b044..4fa3f664cc 100644 --- a/Tools/AP_Periph/AP_Periph.h +++ b/Tools/AP_Periph/AP_Periph.h @@ -383,6 +383,13 @@ public: bool locked; } uart_monitor; #endif + +#if AP_SIM_ENABLED + SITL::SIM sitl; +#if AP_AHRS_ENABLED + AP_AHRS ahrs; +#endif +#endif }; namespace AP diff --git a/Tools/AP_Periph/Parameters.cpp b/Tools/AP_Periph/Parameters.cpp index d7702a8bdc..6e4ce775ea 100644 --- a/Tools/AP_Periph/Parameters.cpp +++ b/Tools/AP_Periph/Parameters.cpp @@ -569,6 +569,18 @@ const AP_Param::Info AP_Periph_FW::var_info[] = { GOBJECT(g_rcin, "RC", Parameters_RCIN), #endif +#if AP_SIM_ENABLED + // @Group: SIM_ + // @Path: ../libraries/SITL/SITL.cpp + GOBJECT(sitl, "SIM_", SITL::SIM), + +#if AP_AHRS_ENABLED + // @Group: AHRS_ + // @Path: ../libraries/AP_AHRS/AP_AHRS.cpp + GOBJECT(ahrs, "AHRS_", AP_AHRS), +#endif +#endif // AP_SIM_ENABLED + AP_VAREND }; diff --git a/Tools/AP_Periph/Parameters.h b/Tools/AP_Periph/Parameters.h index 7e7c96dd6a..03b9ba6282 100644 --- a/Tools/AP_Periph/Parameters.h +++ b/Tools/AP_Periph/Parameters.h @@ -79,6 +79,8 @@ public: k_param_networking, k_param_rpm_sensor, k_param_g_rcin, + k_param_sitl, + k_param_ahrs, }; AP_Int16 format_version; diff --git a/Tools/AP_Periph/can.cpp b/Tools/AP_Periph/can.cpp index 5dfc37c307..d35568f4f4 100644 --- a/Tools/AP_Periph/can.cpp +++ b/Tools/AP_Periph/can.cpp @@ -2456,7 +2456,7 @@ void AP_Periph_FW::can_rangefinder_update(void) uint32_t now = AP_HAL::millis(); static uint32_t last_update_ms; if (g.rangefinder_max_rate > 0 && - now - last_update_ms < 1000/g.rangefinder_max_rate) { + now - last_update_ms < uint32_t(1000/g.rangefinder_max_rate)) { // limit to max rate return; } diff --git a/Tools/AP_Periph/wscript b/Tools/AP_Periph/wscript index 4b87fa5bcd..f3fcdaa41a 100644 --- a/Tools/AP_Periph/wscript +++ b/Tools/AP_Periph/wscript @@ -73,6 +73,9 @@ def build(bld): 'AP_RPM', 'AP_Proximity', 'AP_RCProtocol', + 'AP_AHRS', + 'AP_Terrain', + 'AP_Torqeedo', ] bld.ap_stlib( name= 'AP_Periph_libs',