Browse Source

Plane: send_text_P bug fix for short messages

master
Randy Mackay 12 years ago
parent
commit
c7961a72fc
  1. 3
      ArduPlane/GCS_Mavlink.pde

3
ArduPlane/GCS_Mavlink.pde

@ -1040,6 +1040,9 @@ GCS_MAVLINK::send_text_P(gcs_severity severity, const prog_char_t *str) @@ -1040,6 +1040,9 @@ GCS_MAVLINK::send_text_P(gcs_severity severity, const prog_char_t *str)
uint8_t i;
for (i=0; i<sizeof(m.text); i++) {
m.text[i] = pgm_read_byte((const prog_char *)(str++));
if (m.text[i] == '\0') {
break;
}
}
if (i < sizeof(m.text)) m.text[i] = 0;
mavlink_send_text(chan, severity, (const char *)m.text);

Loading…
Cancel
Save