diff --git a/libraries/AP_GPS/AP_GPS.cpp b/libraries/AP_GPS/AP_GPS.cpp index 7b7363ce93..a82b4d249b 100644 --- a/libraries/AP_GPS/AP_GPS.cpp +++ b/libraries/AP_GPS/AP_GPS.cpp @@ -1172,7 +1172,7 @@ void AP_GPS::broadcast_first_configuration_failure_reason(void) const uint8_t unconfigured; if (first_unconfigured_gps(unconfigured)) { if (drivers[unconfigured] == nullptr) { - gcs().send_text(MAV_SEVERITY_INFO, "GPS %d: was not found", unconfigured + 1); + GCS_SEND_TEXT(MAV_SEVERITY_INFO, "GPS %d: was not found", unconfigured + 1); } else { drivers[unconfigured]->broadcast_configuration_failure_reason(); } diff --git a/libraries/AP_GPS/AP_GPS_SBF.cpp b/libraries/AP_GPS/AP_GPS_SBF.cpp index af318cb656..782a79e60f 100644 --- a/libraries/AP_GPS/AP_GPS_SBF.cpp +++ b/libraries/AP_GPS/AP_GPS_SBF.cpp @@ -351,7 +351,7 @@ AP_GPS_SBF::process_message(void) check_new_itow(temp.TOW, sbf_msg.length); RxState = temp.RxState; if ((RxError & RX_ERROR_MASK) != (temp.RxError & RX_ERROR_MASK)) { - gcs().send_text(MAV_SEVERITY_INFO, "GPS %u: SBF error changed (0x%08x/0x%08x)", (unsigned int)(state.instance + 1), + GCS_SEND_TEXT(MAV_SEVERITY_INFO, "GPS %u: SBF error changed (0x%08x/0x%08x)", (unsigned int)(state.instance + 1), (unsigned int)(RxError & RX_ERROR_MASK), (unsigned int)(temp.RxError & RX_ERROR_MASK)); } RxError = temp.RxError; @@ -382,7 +382,7 @@ void AP_GPS_SBF::broadcast_configuration_failure_reason(void) const { if (gps._auto_config != AP_GPS::GPS_AUTO_CONFIG_DISABLE && _init_blob_index < ARRAY_SIZE(_initialisation_blob)) { - gcs().send_text(MAV_SEVERITY_INFO, "GPS %u: SBF is not fully configured (%u/%u)", state.instance + 1, + GCS_SEND_TEXT(MAV_SEVERITY_INFO, "GPS %u: SBF is not fully configured (%u/%u)", state.instance + 1, _init_blob_index, (unsigned)ARRAY_SIZE(_initialisation_blob)); } } @@ -404,7 +404,7 @@ void AP_GPS_SBF::mount_disk (void) const { void AP_GPS_SBF::unmount_disk (void) const { const char* command = "emd, DSK1, Unmount\n"; - gcs().send_text(MAV_SEVERITY_DEBUG, "SBF unmounting disk"); + GCS_SEND_TEXT(MAV_SEVERITY_DEBUG, "SBF unmounting disk"); port->write((const uint8_t*)command, strlen(command)); } @@ -413,22 +413,22 @@ bool AP_GPS_SBF::prepare_for_arming(void) { if (gps._raw_data) { if (!(RxState & SBF_DISK_MOUNTED)){ is_logging = false; - gcs().send_text(MAV_SEVERITY_INFO, "GPS %d: SBF disk is not mounted", state.instance + 1); + GCS_SEND_TEXT(MAV_SEVERITY_INFO, "GPS %d: SBF disk is not mounted", state.instance + 1); // simply attempt to mount the disk, no need to check if the command was // ACK/NACK'd as we don't continuously attempt to remount the disk - gcs().send_text(MAV_SEVERITY_INFO, "GPS %d: Attempting to mount disk", state.instance + 1); + GCS_SEND_TEXT(MAV_SEVERITY_INFO, "GPS %d: Attempting to mount disk", state.instance + 1); mount_disk(); // reset the flag to indicate if we should be logging _has_been_armed = false; } else if (RxState & SBF_DISK_FULL) { is_logging = false; - gcs().send_text(MAV_SEVERITY_INFO, "GPS %d: SBF disk is full", state.instance + 1); + GCS_SEND_TEXT(MAV_SEVERITY_INFO, "GPS %d: SBF disk is full", state.instance + 1); } else if (!(RxState & SBF_DISK_ACTIVITY)) { is_logging = false; - gcs().send_text(MAV_SEVERITY_INFO, "GPS %d: SBF is not currently logging", state.instance + 1); + GCS_SEND_TEXT(MAV_SEVERITY_INFO, "GPS %d: SBF is not currently logging", state.instance + 1); } } diff --git a/libraries/AP_GPS/AP_GPS_SBP2.cpp b/libraries/AP_GPS/AP_GPS_SBP2.cpp index ba28557939..f3da3dee92 100644 --- a/libraries/AP_GPS/AP_GPS_SBP2.cpp +++ b/libraries/AP_GPS/AP_GPS_SBP2.cpp @@ -51,7 +51,7 @@ do { \ #if SBP_INFOREPORTING # define Info(fmt, args ...) \ do { \ - gcs().send_text(MAV_SEVERITY_INFO, fmt "\n", ## args); \ + GCS_SEND_TEXT(MAV_SEVERITY_INFO, fmt "\n", ## args); \ } while(0) #else # define Info(fmt, args ...) diff --git a/libraries/AP_GPS/AP_GPS_UBLOX.cpp b/libraries/AP_GPS/AP_GPS_UBLOX.cpp index e1866c3f5e..61284edc3a 100644 --- a/libraries/AP_GPS/AP_GPS_UBLOX.cpp +++ b/libraries/AP_GPS/AP_GPS_UBLOX.cpp @@ -47,12 +47,6 @@ extern const AP_HAL::HAL& hal; -#ifdef HAL_NO_GCS -#define GCS_SEND_TEXT(severity, format, args...) -#else -#define GCS_SEND_TEXT(severity, format, args...) gcs().send_text(severity, format, ##args) -#endif - #if UBLOX_DEBUGGING # define Debug(fmt, args ...) do {hal.console->printf("%s:%d: " fmt "\n", __FUNCTION__, __LINE__, ## args); hal.scheduler->delay(1); } while(0) #else