APM: expose change_command() and geofence_breached() to libraries

this makes a failsafe library easier
This commit is contained in:
Andrew Tridgell 2012-08-14 16:54:56 +10:00
parent dd17302def
commit b54ab2d72a
3 changed files with 9 additions and 2 deletions

View File

@ -2012,7 +2012,7 @@ static void gcs_send_text_P(gcs_severity severity, const prog_char_t *str)
only one fits in the queue, so if you send more than one before the
last one gets into the serial buffer then the old one will be lost
*/
static void gcs_send_text_fmt(const prog_char_t *fmt, ...)
void gcs_send_text_fmt(const prog_char_t *fmt, ...)
{
char fmtstr[40];
va_list ap;

View File

@ -2,7 +2,7 @@
// For changing active command mid-mission
//----------------------------------------
static void change_command(uint8_t cmd_index)
void change_command(uint8_t cmd_index)
{
struct Location temp = get_cmd_with_index(cmd_index);

View File

@ -316,6 +316,13 @@ static void geofence_send_status(mavlink_channel_t chan)
}
}
// public function for use in failsafe modules
bool geofence_breached(void)
{
return geofence_state?geofence_state->fence_triggered:false;
}
#else // GEOFENCE_ENABLED
static void geofence_check(bool altitude_check_only) { }