From 8dbb156ea022525f5c65dcb21058d1f9d4842915 Mon Sep 17 00:00:00 2001 From: Bas Delfos Date: Tue, 28 Mar 2017 23:11:23 +0200 Subject: [PATCH] Added KISS ESC sensor information for rpm and temperature to debug fields --- src/main/build/debug.h | 2 ++ src/main/fc/cli.c | 6 ++++-- src/main/sensors/esc_sensor.c | 5 ++++- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/main/build/debug.h b/src/main/build/debug.h index cd6fc1d780..c7a0ea8473 100644 --- a/src/main/build/debug.h +++ b/src/main/build/debug.h @@ -62,5 +62,7 @@ typedef enum { DEBUG_ESC_SENSOR, DEBUG_SCHEDULER, DEBUG_STACK, + DEBUG_ESC_SENSOR_RPM, + DEBUG_ESC_SENSOR_TMP, DEBUG_COUNT } debugType_e; diff --git a/src/main/fc/cli.c b/src/main/fc/cli.c index 4aa17e24e5..07e2a50115 100755 --- a/src/main/fc/cli.c +++ b/src/main/fc/cli.c @@ -323,7 +323,9 @@ static const char * const lookupTableDebug[DEBUG_COUNT] = { "ANGLERATE", "ESC_SENSOR", "SCHEDULER", - "STACK" + "STACK", + "ESC_SENSOR_RPM", + "ESC_SENSOR_TMP" }; #ifdef OSD @@ -4041,7 +4043,7 @@ static void cliResource(char *cmdline) cliPrintf("%c%02d: %s ", IO_GPIOPortIdx(ioRecs + i) + 'A', IO_GPIOPinIdx(ioRecs + i), owner); if (ioRecs[i].index > 0) { cliPrintf("%d", ioRecs[i].index); - } + } cliPrintf("\r\n"); } diff --git a/src/main/sensors/esc_sensor.c b/src/main/sensors/esc_sensor.c index c4af56e62d..910c37b717 100644 --- a/src/main/sensors/esc_sensor.c +++ b/src/main/sensors/esc_sensor.c @@ -68,7 +68,7 @@ Byte 9: 8-bit CRC DEBUG INFORMATION ----------------- -set debug_mode = DEBUG_ESC_TELEMETRY in cli +set debug_mode = DEBUG_ESC_SENSOR in cli */ @@ -235,6 +235,9 @@ static uint8_t decodeEscFrame(void) combinedDataNeedsUpdate = true; frameStatus = ESC_SENSOR_FRAME_COMPLETE; + + DEBUG_SET(DEBUG_ESC_SENSOR_RPM, escSensorMotor, escSensorData[escSensorMotor].rpm); + DEBUG_SET(DEBUG_ESC_SENSOR_TMP, escSensorMotor, escSensorData[escSensorMotor].temperature); } else { frameStatus = ESC_SENSOR_FRAME_FAILED; }