From e23e58fc17ee9e32816b54525c942462fac2f136 Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Wed, 7 Aug 2024 13:17:22 +1000 Subject: [PATCH] SITL: use GCS_SEND_TEXT rather than gcs().send_text Co-authored-by: muramura --- libraries/SITL/SIM_Buzzer.cpp | 6 +++--- libraries/SITL/SIM_GeneratorEngine.cpp | 2 +- libraries/SITL/SIM_RF_Wasp.cpp | 4 ++-- libraries/SITL/SIM_ToshibaLED.cpp | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/libraries/SITL/SIM_Buzzer.cpp b/libraries/SITL/SIM_Buzzer.cpp index 0cd1545052..3e7a1b05e2 100644 --- a/libraries/SITL/SIM_Buzzer.cpp +++ b/libraries/SITL/SIM_Buzzer.cpp @@ -102,19 +102,19 @@ void Buzzer::update(const struct sitl_input &input) const uint32_t now = AP_HAL::millis(); if (on) { if (!was_on) { - gcs().send_text(MAV_SEVERITY_WARNING, "%u: Buzzer on", now); + GCS_SEND_TEXT(MAV_SEVERITY_WARNING, "%u: Buzzer on", now); on_time = now; was_on = true; xdemoSound.play(); } if (now - on_time > duration_ms/2) { - gcs().send_text(MAV_SEVERITY_WARNING, "%u: Buzzer on again", now); + GCS_SEND_TEXT(MAV_SEVERITY_WARNING, "%u: Buzzer on again", now); on_time = now; xdemoSound.play(); } } else { if (was_on) { - gcs().send_text(MAV_SEVERITY_WARNING, "%u: Buzzer off", now); + GCS_SEND_TEXT(MAV_SEVERITY_WARNING, "%u: Buzzer off", now); xdemoSound.stop(); was_on = false; } diff --git a/libraries/SITL/SIM_GeneratorEngine.cpp b/libraries/SITL/SIM_GeneratorEngine.cpp index 5e862cf1d7..d0d5ba25cf 100644 --- a/libraries/SITL/SIM_GeneratorEngine.cpp +++ b/libraries/SITL/SIM_GeneratorEngine.cpp @@ -42,7 +42,7 @@ void SIM_GeneratorEngine::update() temperature = MIN(temperature, 150); // now lose some heat to the environment const float heat_loss = ((temperature * heat_environment_loss_factor * (time_delta_ms * (1/1000.0f)))); // lose some % of heat per second - // gcs().send_text(MAV_SEVERITY_INFO, "heat=%f loss=%f", temperature, heat_loss); + // GCS_SEND_TEXT(MAV_SEVERITY_INFO, "heat=%f loss=%f", temperature, heat_loss); temperature -= heat_loss; } diff --git a/libraries/SITL/SIM_RF_Wasp.cpp b/libraries/SITL/SIM_RF_Wasp.cpp index 48338346b0..cf8b2fb04e 100644 --- a/libraries/SITL/SIM_RF_Wasp.cpp +++ b/libraries/SITL/SIM_RF_Wasp.cpp @@ -57,7 +57,7 @@ void RF_Wasp::check_configuration() offs += 1; // for '>' offs += 1; // for space strncpy(string_configs[i].value, &_buffer[offs], MIN(ARRAY_SIZE(config.format), unsigned(cr - _buffer - offs - 1))); // -1 for the lf, -1 for the cr -// gcs().send_text(MAV_SEVERITY_INFO, "Wasp: config (%s) (%s)", string_configs[i].name, string_configs[i].value); +// GCS_SEND_TEXT(MAV_SEVERITY_INFO, "Wasp: config (%s) (%s)", string_configs[i].name, string_configs[i].value); char response[128]; const size_t x = snprintf(response, ARRAY_SIZE(response), @@ -80,7 +80,7 @@ void RF_Wasp::check_configuration() char tmp[32]{}; strncpy(tmp, &_buffer[offs], MIN(ARRAY_SIZE(config.format), unsigned(cr - _buffer - offs - 1))); // -1 for the lf, -1 for the cr *(integer_configs[i].value) = atoi(tmp); -// gcs().send_text(MAV_SEVERITY_INFO, "Wasp: config (%s) (%d)", integer_configs[i].name, *(integer_configs[i].value)); +// GCS_SEND_TEXT(MAV_SEVERITY_INFO, "Wasp: config (%s) (%d)", integer_configs[i].name, *(integer_configs[i].value)); char response[128]; const size_t x = snprintf(response, ARRAY_SIZE(response), diff --git a/libraries/SITL/SIM_ToshibaLED.cpp b/libraries/SITL/SIM_ToshibaLED.cpp index 7d54c7cc7f..82a55311a9 100644 --- a/libraries/SITL/SIM_ToshibaLED.cpp +++ b/libraries/SITL/SIM_ToshibaLED.cpp @@ -17,7 +17,7 @@ void SITL::ToshibaLED::update(const class Aircraft &aircraft) last_print_pwm1 = get_register(ToshibaLEDDevReg::PWM1); last_print_pwm2 = get_register(ToshibaLEDDevReg::PWM2); last_print_enable = get_register(ToshibaLEDDevReg::ENABLE); - // gcs().send_text(MAV_SEVERITY_INFO, "SIM_ToshibaLED: PWM0=%u PWM1=%u PWM2=%u ENABLE=%u", last_print_pwm0, last_print_pwm1, last_print_pwm2, last_print_enable); + // GCS_SEND_TEXT(MAV_SEVERITY_INFO, "SIM_ToshibaLED: PWM0=%u PWM1=%u PWM2=%u ENABLE=%u", last_print_pwm0, last_print_pwm1, last_print_pwm2, last_print_enable); if (get_register(ToshibaLEDDevReg::ENABLE)) { // here we convert from 0-15 BGR (the PWM values from the i2c bus)