Skip to content

Commit

Permalink
Copter: only enter CLI is link is idle when 3 enters are hit
Browse files Browse the repository at this point in the history
this will prevent binary contents of RADIO packets being interpreted
as CLI enter line-feeds
  • Loading branch information
Andrew Tridgell committed Mar 21, 2013
1 parent 7e58bde commit d22a7c6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ArduCopter/GCS_Mavlink.pde
Original file line number Diff line number Diff line change
Expand Up @@ -868,7 +868,8 @@ GCS_MAVLINK::update(void)
#if CLI_ENABLED == ENABLED
/* allow CLI to be started by hitting enter 3 times, if no
* heartbeat packets have been received */
if (mavlink_active == 0 && (millis() - _cli_timeout) < 20000 && !motors.armed()) {
if (mavlink_active == 0 && (millis() - _cli_timeout) < 20000 &&
!motors.armed() && comm_is_idle(chan)) {
if (c == '\n' || c == '\r') {
crlf_count++;
} else {
Expand Down

0 comments on commit d22a7c6

Please sign in to comment.