mirror of
https://github.com/paparazzi/paparazzi.git
synced 2026-05-30 19:47:50 +08:00
[mavlink] fix freq of periodic messages
This commit is contained in:
@@ -24,7 +24,10 @@
|
||||
|
||||
<target name="nps" board="pc">
|
||||
<subsystem name="fdm" type="jsbsim"/>
|
||||
<configure name="MAVLINK_PORT" value="UDP0"/>
|
||||
<configure name="MAVLINK_PORT" value="UDP1"/>
|
||||
<define name="UDP1_PORT_OUT" value="14550"/>
|
||||
<define name="UDP1_PORT_IN" value="14555"/>
|
||||
<define name="MAVLINK_DEBUG" value="printf"/>
|
||||
</target>
|
||||
|
||||
<subsystem name="radio_control" type="spektrum">
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
|
||||
<init fun="mavlink_init()"/>
|
||||
<periodic fun="mavlink_periodic()" freq="10" autorun="TRUE"/>
|
||||
<periodic fun="mavlink_periodic_telemetry()" freq="$TELEMETRY_FREQUENCY" autorun="TRUE"/>
|
||||
<event fun="mavlink_event()"/>
|
||||
|
||||
<makefile>
|
||||
|
||||
@@ -133,17 +133,26 @@ void mavlink_init(void)
|
||||
}
|
||||
|
||||
/**
|
||||
* Periodic MAVLink calls.
|
||||
* Called at MAVLINK_PERIODIC_FREQUENCY (set in module xml to 10Hz)
|
||||
* Send periodic mavlink messages as defined in Mavlink process of telemetry xml file.
|
||||
* Called at TELEMETRY_FREQUENCY
|
||||
*/
|
||||
void mavlink_periodic(void)
|
||||
void mavlink_periodic_telemetry(void)
|
||||
{
|
||||
#if PERIODIC_TELEMETRY && defined TELEMETRY_MAVLINK_NB_MSG
|
||||
// send periodic mavlink messages as defined in the Mavlink process of the telemetry xml file
|
||||
// transport and device not used here yet...
|
||||
periodic_telemetry_send_Mavlink(&mavlink_telemetry, NULL, NULL);
|
||||
#else
|
||||
// else use these hardcoded periods
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* Periodic MAVLink calls.
|
||||
* Called at MAVLINK_PERIODIC_FREQ (set in module xml to 10Hz)
|
||||
*/
|
||||
void mavlink_periodic(void)
|
||||
{
|
||||
#if !defined (TELEMETRY_MAVLINK_NB_MSG)
|
||||
// use these hardcoded periods if no Mavlink process in telemetry file
|
||||
RunOnceEvery(2, mavlink_send_heartbeat(NULL, NULL));
|
||||
RunOnceEvery(5, mavlink_send_sys_status(NULL, NULL));
|
||||
RunOnceEvery(20, mavlink_send_system_time(NULL, NULL));
|
||||
|
||||
@@ -71,6 +71,7 @@ extern mavlink_system_t mavlink_system;
|
||||
*/
|
||||
void mavlink_init(void);
|
||||
void mavlink_periodic(void);
|
||||
void mavlink_periodic_telemetry(void);
|
||||
void mavlink_event(void);
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user