From 87a3fcdd0255a35e5f5ebcc82d1f58de58ee4bd6 Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Wed, 20 Jun 2018 10:29:34 +1000 Subject: [PATCH] Rover: remove usb-mux checking Nobody ever uses the result from this --- APMrover2/APMrover2.cpp | 1 - APMrover2/GCS_Mavlink.cpp | 1 - APMrover2/Rover.h | 4 ---- APMrover2/system.cpp | 16 ---------------- 4 files changed, 22 deletions(-) diff --git a/APMrover2/APMrover2.cpp b/APMrover2/APMrover2.cpp index b887ab39fe..616e6db508 100644 --- a/APMrover2/APMrover2.cpp +++ b/APMrover2/APMrover2.cpp @@ -66,7 +66,6 @@ const AP_Scheduler::Task Rover::scheduler_tasks[] = { SCHED_TASK(read_aux_switch, 10, 200), SCHED_TASK_CLASS(AP_BattMonitor, &rover.battery, read, 10, 300), SCHED_TASK_CLASS(AP_ServoRelayEvents, &rover.ServoRelayEvents, update_events, 50, 200), - SCHED_TASK(check_usb_mux, 3, 200), #if MOUNT == ENABLED SCHED_TASK_CLASS(AP_Mount, &rover.camera_mount, update, 50, 200), #endif diff --git a/APMrover2/GCS_Mavlink.cpp b/APMrover2/GCS_Mavlink.cpp index 8d86f90e75..15e2b2be1a 100644 --- a/APMrover2/GCS_Mavlink.cpp +++ b/APMrover2/GCS_Mavlink.cpp @@ -1222,7 +1222,6 @@ void Rover::mavlink_delay_cb() last_5s = tnow; gcs().send_text(MAV_SEVERITY_INFO, "Initialising APM"); } - check_usb_mux(); DataFlash.EnableWrites(true); } diff --git a/APMrover2/Rover.h b/APMrover2/Rover.h index 5d260bb062..0079c37cde 100644 --- a/APMrover2/Rover.h +++ b/APMrover2/Rover.h @@ -231,9 +231,6 @@ private: // true if initialisation has completed bool initialised; - // if USB is connected - bool usb_connected; - // This is the state of the flight control system // There are multiple states defined such as MANUAL, AUTO, ... Mode *control_mode; @@ -525,7 +522,6 @@ private: bool set_mode(Mode &new_mode, mode_reason_t reason); bool mavlink_set_mode(uint8_t mode); void startup_INS_ground(void); - void check_usb_mux(void); void print_mode(AP_HAL::BetterStream *port, uint8_t mode); void notify_mode(const Mode *new_mode); uint8_t check_digital_pin(uint8_t pin); diff --git a/APMrover2/system.cpp b/APMrover2/system.cpp index b56bd5ffed..aba01fad3b 100644 --- a/APMrover2/system.cpp +++ b/APMrover2/system.cpp @@ -70,11 +70,6 @@ void Rover::init_ardupilot() // init baro before we start the GCS, so that the CLI baro test works barometer.init(); - // we start by assuming USB connected, as we initialed the serial - // port with SERIAL0_BAUD. check_usb_mux() fixes this if need be. - usb_connected = true; - check_usb_mux(); - // setup telem slots with serial ports gcs().setup_uarts(serial_manager); @@ -288,17 +283,6 @@ void Rover::startup_INS_ground(void) ahrs.reset(); } -void Rover::check_usb_mux(void) -{ - bool usb_check = hal.gpio->usb_connected(); - if (usb_check == usb_connected) { - return; - } - - // the user has switched to/from the telemetry port - usb_connected = usb_check; -} - // update notify with mode change void Rover::notify_mode(const Mode *mode) {