Added USE_ESC_SENSOR_INFO define, cleaned up USE_ESC_SENSOR define. (#5580)

This commit is contained in:
Michael Keller 2018-04-01 11:33:07 +12:00 committed by GitHub
parent b8aa6ac915
commit b5c0076bc8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
26 changed files with 37 additions and 53 deletions

View File

@ -2372,7 +2372,8 @@ static int parseOutputIndex(char *pch, bool allowAllEscs) {
return outputIndex;
}
#ifdef USE_DSHOT
#if defined(USE_DSHOT)
#if defined(USE_ESC_SENSOR) && defined(USE_ESC_SENSOR_INFO)
#define ESC_INFO_KISS_V1_EXPECTED_FRAME_SIZE 15
#define ESC_INFO_KISS_V2_EXPECTED_FRAME_SIZE 21
@ -2558,6 +2559,7 @@ static void executeEscInfoCommand(uint8_t escIndex)
printEscInfo(escInfoBuffer, getNumberEscBytesRead());
}
#endif // USE_ESC_SENSOR && USE_ESC_SENSOR_INFO
static void cliDshotProg(char *cmdline)
{
@ -2600,12 +2602,19 @@ static void cliDshotProg(char *cmdline)
if (command != DSHOT_CMD_ESC_INFO) {
pwmWriteDshotCommand(escIndex, getMotorCount(), command);
} else {
if (escIndex != ALL_MOTORS) {
executeEscInfoCommand(escIndex);
} else {
for (uint8_t i = 0; i < getMotorCount(); i++) {
executeEscInfoCommand(i);
#if defined(USE_ESC_SENSOR) && defined(USE_ESC_SENSOR_INFO)
if (feature(FEATURE_ESC_SENSOR)) {
if (escIndex != ALL_MOTORS) {
executeEscInfoCommand(escIndex);
} else {
for (uint8_t i = 0; i < getMotorCount(); i++) {
executeEscInfoCommand(i);
}
}
} else
#endif
{
cliPrintLine("Not supported.");
}
}
@ -2628,7 +2637,7 @@ static void cliDshotProg(char *cmdline)
pwmEnableMotors();
}
#endif
#endif // USE_DSHOT
#ifdef USE_ESCSERIAL
static void cliEscPassthrough(char *cmdline)

View File

@ -741,6 +741,8 @@ static bool mspProcessOutCommand(uint8_t cmdMSP, sbuf_t *dst)
static bool mspProcessOutCommand(uint8_t cmdMSP, sbuf_t *dst)
{
bool unsupportedCommand = false;
switch (cmdMSP) {
case MSP_STATUS_EX:
case MSP_STATUS:
@ -967,13 +969,19 @@ static bool mspProcessOutCommand(uint8_t cmdMSP, sbuf_t *dst)
break;
#endif
#ifdef USE_DSHOT
#if defined(USE_ESC_SENSOR)
case MSP_ESC_SENSOR_DATA:
sbufWriteU8(dst, getMotorCount());
for (int i = 0; i < getMotorCount(); i++) {
sbufWriteU8(dst, getEscSensorData(i)->temperature);
sbufWriteU16(dst, getEscSensorData(i)->rpm);
if (feature(FEATURE_ESC_SENSOR)) {
sbufWriteU8(dst, getMotorCount());
for (int i = 0; i < getMotorCount(); i++) {
const escSensorData_t *escData = getEscSensorData(i);
sbufWriteU8(dst, escData->temperature);
sbufWriteU16(dst, escData->rpm);
}
} else {
unsupportedCommand = true;
}
break;
#endif
@ -1276,9 +1284,9 @@ static bool mspProcessOutCommand(uint8_t cmdMSP, sbuf_t *dst)
break;
#endif
default:
return false;
unsupportedCommand = true;
}
return true;
return !unsupportedCommand;
}
static mspResult_e mspFcProcessOutCommandWithArg(uint8_t cmdMSP, sbuf_t *arg, sbuf_t *dst)

View File

@ -21,7 +21,7 @@
#include <platform.h>
#ifdef USE_DSHOT
#if defined(USE_ESC_SENSOR)
#include "build/debug.h"

View File

@ -21,8 +21,6 @@
#define USBD_PRODUCT_STRING "AnyFCM7"
#define USE_ESC_SENSOR
#define LED0_PIN PB6 //red
#define LED1_PIN PB9 //blue

View File

@ -47,7 +47,6 @@
#define MPU_INT_EXTI PC13
#define USE_EXTI
#define USE_ESC_SENSOR
#define REMAP_TIM16_DMA
#define REMAP_TIM17_DMA

View File

@ -20,8 +20,6 @@
#define TARGET_BOARD_IDENTIFIER "BFF4"
#define USBD_PRODUCT_STRING "BetaFlightF4"
#define USE_ESC_SENSOR
#define LED0_PIN PB5
#define USE_BEEPER

View File

@ -124,8 +124,6 @@
#define USE_MPU_DATA_READY_SIGNAL
#define ENSURE_MPU_DATA_READY_IS_LOW
#define USE_ESC_SENSOR
#define DEFAULT_RX_FEATURE FEATURE_RX_PPM
#define USE_SERIAL_4WAY_BLHELI_INTERFACE

View File

@ -148,7 +148,6 @@
/*---------------------------------*/
/*-------------ESCs----------------*/
#define USE_ESC_SENSOR
#define USE_SERIAL_4WAY_BLHELI_INTERFACE
#define USE_ESCSERIAL
#define ESCSERIAL_TIMER_TX_PIN PB0 // (HARDARE=0)

View File

@ -162,7 +162,6 @@
/*---------------------------------*/
/*-------------ESCs----------------*/
#define USE_ESC_SENSOR
#define USE_SERIAL_4WAY_BLHELI_INTERFACE
#define USE_ESCSERIAL
#define ESCSERIAL_TIMER_TX_PIN PA3 // (HARDARE=0)

View File

@ -109,8 +109,6 @@
#define SDCARD_SPI_INITIALIZATION_CLOCK_DIVIDER 256
#define SDCARD_SPI_FULL_SPEED_CLOCK_DIVIDER 4
#define USE_ESC_SENSOR
#define DEFAULT_VOLTAGE_METER_SOURCE VOLTAGE_METER_ADC
#define DEFAULT_CURRENT_METER_SOURCE CURRENT_METER_NONE

View File

@ -166,7 +166,6 @@
#define USE_SERIAL_4WAY_BLHELI_INTERFACE
#define USE_ESC_SENSOR
#define REMAP_TIM17_DMA
#define TARGET_IO_PORTA 0xffff

View File

@ -44,8 +44,6 @@
#define USE_FLASHFS
#define USE_FLASH_M25P16
#define USE_ESC_SENSOR
#define USE_VCP
#define USE_UART1
#define USE_UART2

View File

@ -23,8 +23,6 @@
#define SBUS_PORT_OPTIONS (SERIAL_STOPBITS_2 | SERIAL_PARITY_EVEN | SERIAL_INVERTED | SERIAL_BIDIR)
#define USE_ESC_SENSOR
#define USE_ESCSERIAL
#define ESCSERIAL_TIMER_TX_PIN PA13 // (Hardware=6, common to KISSFC & KISSCC)
#define REMAP_TIM17_DMA

View File

@ -23,8 +23,6 @@
#define USBD_PRODUCT_STRING "KISSFCV2F7"
#define USE_ESC_SENSOR
#define LED0 PA8 // blue
#define LED1 PC8 // blingbling
#define LED1_INVERTED

View File

@ -48,8 +48,6 @@
#define USE_MPU_DATA_READY_SIGNAL
#define ENSURE_MPU_DATA_READY_IS_LOW
#define USE_ESC_SENSOR
#define USE_SPI
#define USE_SPI_DEVICE_1
#ifdef LUXV2_RACE

View File

@ -97,8 +97,6 @@
//#define CURRENT_METER_ADC_PIN PA5
#define RSSI_ADC_PIN PB2
#define USE_ESC_SENSOR
#define USE_SERIAL_4WAY_BLHELI_INTERFACE
// IO - stm32f303cc in 48pin package

View File

@ -109,7 +109,6 @@
#define CURRENT_METER_ADC_PIN PA5
#define RSSI_ADC_PIN PB2
#define USE_ESC_SENSOR
#define REMAP_TIM17_DMA
// UART1 TX uses DMA1_Channel4, which is also used by dshot on motor 4

View File

@ -158,8 +158,6 @@
#define RSSI_ADC_PIN PC2
#define EXTERNAL1_ADC_PIN PC3
#define USE_ESC_SENSOR
#define USE_SONAR
#define SONAR_TRIGGER_PIN PB0
#define SONAR_ECHO_PIN PB1

View File

@ -29,6 +29,7 @@
#undef USE_RTC_TIME
#undef USE_COPY_PROFILE_CMS_MENU
#undef USE_RX_MSP
#undef USE_ESC_SENSOR_INFO
#define TARGET_BOARD_IDENTIFIER "OMNI" // https://en.wikipedia.org/wiki/Omnibus
@ -139,8 +140,6 @@
// Divide to under 25MHz for normal operation:
#define SDCARD_SPI_FULL_SPEED_CLOCK_DIVIDER 2
#define USE_ESC_SENSOR
// DSHOT output 4 uses DMA1_Channel5, so don't use it for the SDCARD until we find an alternative
#ifndef USE_DSHOT
#define SDCARD_DMA_CHANNEL_TX DMA1_Channel5

View File

@ -33,8 +33,6 @@
#define INVERTER_PIN_UART6 PC6
#define USE_ESC_SENSOR
// MPU9250 interrupt
#define USE_EXTI
#define MPU_INT_EXTI PC5

View File

@ -176,7 +176,6 @@
#define USE_MSP_CURRENT_METER
#define USE_ESC_SENSOR
#define REMAP_TIM17_DMA
// UART1 TX uses DMA1_Channel4, which is also used by dshot on motor 4

View File

@ -29,6 +29,7 @@
#undef USE_RTC_TIME
#undef USE_COPY_PROFILE_CMS_MENU
#undef USE_RX_MSP
#undef USE_ESC_SENSOR_INFO
#if !defined(AIORACERF3)
@ -63,8 +64,6 @@
#define USE_MAG_DATA_READY_SIGNAL
#define ENSURE_MAG_DATA_READY_IS_HIGH
#define USE_ESC_SENSOR
#define USE_GYRO
#define USE_GYRO_SPI_MPU6500

View File

@ -24,6 +24,7 @@
#undef USE_RTC_TIME
#undef USE_COPY_PROFILE_CMS_MENU
#undef USE_RX_MSP
#undef USE_ESC_SENSOR_INFO
#undef USE_COPY_PROFILE_CMS_MENU

View File

@ -190,8 +190,6 @@
#define RSSI_ADC_PIN PC2
#define EXTERNAL1_ADC_PIN PC3
#define USE_ESC_SENSOR
#define USE_RANGEFINDER
#define USE_RANGEFINDER_HCSR04
#define RANGEFINDER_HCSR04_TRIGGER_PIN PB0

View File

@ -104,8 +104,6 @@
#define CURRENT_METER_ADC_PIN PA5
#define RSSI_ADC_PIN PB2
#define USE_ESC_SENSOR
#define REMAP_TIM17_DMA
// UART1 TX uses DMA1_Channel4, which is also used by dshot on motor 4
#if defined(USE_UART1_TX_DMA) && defined(USE_DSHOT)

View File

@ -46,7 +46,6 @@
#ifdef STM32F4
#define USE_DSHOT
#define USE_ESC_SENSOR
#define I2C3_OVERCLOCK true
#define USE_GYRO_DATA_ANALYSE
#define USE_ADC
@ -65,7 +64,6 @@
#endif
#ifdef STM32F7
#define USE_DSHOT
#define USE_ESC_SENSOR
#define I2C3_OVERCLOCK true
#define I2C4_OVERCLOCK true
#define USE_GYRO_DATA_ANALYSE
@ -162,6 +160,8 @@
#define USE_VTX_SMARTAUDIO
#define USE_VTX_TRAMP
#define USE_GYRO_LPF2
#define USE_ESC_SENSOR
#define USE_ESC_SENSOR_INFO
#ifdef USE_SERIALRX_SPEKTRUM
#define USE_SPEKTRUM_BIND