1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-19 14:25:20 +03:00

Added USB VCP detect and debugging. (#5689)

This commit is contained in:
Michael Keller 2018-04-18 01:22:46 +12:00 committed by GitHub
parent 49139f2d6d
commit b2c247d34a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 22 additions and 1 deletions

View file

@ -36,10 +36,12 @@
#include "pg/pg_ids.h"
#include "drivers/light_led.h"
#include "drivers/serial_usb_vcp.h"
#include "drivers/sound_beeper.h"
#include "drivers/system.h"
#include "drivers/time.h"
#include "drivers/transponder_ir.h"
#include "drivers/usb_io.h"
#include "sensors/acceleration.h"
#include "sensors/barometer.h"
@ -847,7 +849,9 @@ static void subTaskPidController(timeUs_t currentTimeUs)
static void subTaskMainSubprocesses(timeUs_t currentTimeUs)
{
uint32_t startTime = 0;
if (debugMode == DEBUG_PIDLOOP) {startTime = micros();}
if (debugMode == DEBUG_PIDLOOP) {
startTime = micros();
}
// Read out gyro temperature if used for telemmetry
if (feature(FEATURE_TELEMETRY)) {
@ -904,6 +908,11 @@ static void subTaskMainSubprocesses(timeUs_t currentTimeUs)
afatfs_poll();
#endif
#if defined(USE_VCP)
DEBUG_SET(DEBUG_USB, 0, usbCableIsInserted());
DEBUG_SET(DEBUG_USB, 1, usbVcpIsConnected());
#endif
#ifdef USE_BLACKBOX
if (!cliMode && blackboxConfig()->device) {
blackboxUpdate(currentTimeUs);