[mavlink] fix freq of periodic messages

This commit is contained in:
Felix Ruess
2015-12-02 11:29:37 +01:00
parent ed3408c4b8
commit 62d176cef3
4 changed files with 20 additions and 6 deletions
@@ -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">
+1
View File
@@ -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>
+14 -5
View File
@@ -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));
+1
View File
@@ -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);
/**