Skip to content

Commit

Permalink
SITL: use GCS_SEND_TEXT rather than gcs().send_text
Browse files Browse the repository at this point in the history
Co-authored-by: muramura <[email protected]>
  • Loading branch information
peterbarker and muramura committed Aug 7, 2024
1 parent 887ca8e commit be2b7ed
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions libraries/SITL/SIM_Buzzer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion libraries/SITL/SIM_GeneratorEngine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;

}
4 changes: 2 additions & 2 deletions libraries/SITL/SIM_RF_Wasp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand All @@ -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),
Expand Down
2 changes: 1 addition & 1 deletion libraries/SITL/SIM_ToshibaLED.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit be2b7ed

Please sign in to comment.