On second thought, no need to make inverter configurable. only sbus will use it, and the driver can set inversion automatically.

This commit is contained in:
dongie 2014-06-11 14:13:45 +09:00
parent 84729747b0
commit ab87a99238
4 changed files with 3 additions and 9 deletions

View File

@ -136,7 +136,6 @@ const clivalue_t valueTable[] = {
{ "fixedwing_althold_dir", VAR_INT8, &mcfg.fixedwing_althold_dir, -1, 1 },
{ "reboot_character", VAR_UINT8, &mcfg.reboot_character, 48, 126 },
{ "serial_baudrate", VAR_UINT32, &mcfg.serial_baudrate, 1200, 115200 },
{ "serial2_rx_inverted", VAR_UINT8, &mcfg.serial2_rx_inverted, 0, 1 },
{ "softserial_baudrate", VAR_UINT32, &mcfg.softserial_baudrate, 1200, 19200 },
{ "softserial_1_inverted", VAR_UINT8, &mcfg.softserial_1_inverted, 0, 1 },
{ "softserial_2_inverted", VAR_UINT8, &mcfg.softserial_2_inverted, 0, 1 },

View File

@ -18,7 +18,7 @@ master_t mcfg; // master config struct with data independent from profiles
config_t cfg; // profile config struct
const char rcChannelLetters[] = "AERT1234";
static const uint8_t EEPROM_CONF_VERSION = 65;
static const uint8_t EEPROM_CONF_VERSION = 64;
static uint32_t enabledSensors = 0;
static void resetConf(void);

View File

@ -285,8 +285,7 @@ typedef struct master_t {
uint8_t gps_type; // See GPSHardware enum.
int8_t gps_baudrate; // See GPSBaudRates enum.
uint32_t serial_baudrate;
uint8_t serial2_rx_inverted; // invert RX only for USART2 (for Sbus, etc)
uint32_t serial_baudrate; // primary serial (MSP) port baudrate
uint32_t softserial_baudrate; // shared by both soft serial ports
uint8_t softserial_1_inverted; // use inverted softserial input and output signals on port 1

View File

@ -28,11 +28,7 @@ void sbusInit(rcReadRawDataPtr *callback)
for (b = 0; b < SBUS_MAX_CHANNEL; b++)
sbusChannelData[b] = 2 * (mcfg.midrc - SBUS_OFFSET);
// Configure hardware inverter on PB2. If not available, this has no effect.
if (mcfg.serial2_rx_inverted) {
INV_ON;
} else {
INV_OFF;
}
INV_ON;
core.rcvrport = uartOpen(USART2, sbusDataReceive, 100000, (portMode_t)(MODE_RX | MODE_SBUS));
if (callback)
*callback = sbusReadRawRC;