1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-23 16:25:31 +03:00
betaflight/src/config.h
Dominic Clifton 5484e5fddd Replace PWM RSSI with ADC RSSI.
The primary reason is to support the D4R-II with it's much faster PWM
frequency.  The PWM RSSI code could not keep up, and since there are no
timers free for using capture compare of PWM signals in hardware one
solution is to use the ADC at a slow sample rate.

RC2 is used as before and it expects a signal between 0 and 3.3v.  An
inline smoothing capacitor may help.

This commit also removes the cli command adc_power_channel since the
reading was never actually exposed anywhere.
2014-05-28 03:30:53 +01:00

40 lines
1.1 KiB
C

#pragma once
typedef enum {
FEATURE_RX_PPM = 1 << 0,
FEATURE_VBAT = 1 << 1,
FEATURE_INFLIGHT_ACC_CAL = 1 << 2,
FEATURE_RX_SERIAL = 1 << 3,
FEATURE_MOTOR_STOP = 1 << 4,
FEATURE_SERVO_TILT = 1 << 5,
FEATURE_SOFTSERIAL = 1 << 6,
FEATURE_LED_RING = 1 << 7,
FEATURE_GPS = 1 << 8,
FEATURE_FAILSAFE = 1 << 9,
FEATURE_SONAR = 1 << 10,
FEATURE_TELEMETRY = 1 << 11,
FEATURE_POWERMETER = 1 << 12,
FEATURE_VARIO = 1 << 13,
FEATURE_3D = 1 << 14,
FEATURE_RX_PARALLEL_PWM = 1 << 15,
FEATURE_RX_MSP = 1 << 16,
FEATURE_RSSI_ADC = 1 << 17,
} AvailableFeatures;
bool feature(uint32_t mask);
void featureSet(uint32_t mask);
void featureClear(uint32_t mask);
void featureClearAll(void);
uint32_t featureMask(void);
void copyCurrentProfileToProfileSlot(uint8_t profileSlotIndex);
void resetEEPROM(void);
void readEEPROM(void);
void readEEPROMAndNotify(void);
void writeEEPROM();
void ensureEEPROMContainsValidData(void);
void saveAndReloadCurrentProfileToCurrentProfileSlot(void);
bool canSoftwareSerialBeUsed(void);