1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-24 00:35:39 +03:00

Add SFHSS-SPI-RX

This commit is contained in:
chibaron 2018-10-01 23:27:40 +09:00
parent 8980ba1065
commit cb5fc4fd63
23 changed files with 878 additions and 228 deletions

View file

@ -141,6 +141,7 @@ extern uint8_t __config_end;
#include "rx/spektrum.h"
#include "rx/cc2500_frsky_common.h"
#include "rx/cc2500_frsky_x.h"
#include "rx/cc2500_common.h"
#include "scheduler/scheduler.h"
@ -2560,13 +2561,14 @@ static void cliBeeper(char *cmdline)
}
#endif
#ifdef USE_RX_FRSKY_SPI
void cliFrSkyBind(char *cmdline){
#ifdef USE_RX_BIND
void cliRxBind(char *cmdline){
UNUSED(cmdline);
switch (rxSpiConfig()->rx_spi_protocol) {
case RX_SPI_FRSKY_D:
case RX_SPI_FRSKY_X:
frSkySpiBind();
case RX_SPI_SFHSS:
cc2500SpiBind();
cliPrint("Binding...");
@ -4464,8 +4466,9 @@ const clicmd_t cmdTable[] = {
CLI_COMMAND_DEF("flash_write", NULL, "<address> <message>", cliFlashWrite),
#endif
#endif
#ifdef USE_RX_FRSKY_SPI
CLI_COMMAND_DEF("frsky_bind", "initiate binding for FrSky SPI RX", NULL, cliFrSkyBind),
#ifdef USE_RX_BIND
CLI_COMMAND_DEF("frsky_bind", "initiate binding for FrSky SPI RX", NULL, cliRxBind), /* legacy */
CLI_COMMAND_DEF("rx_bind", "initiate binding for RX", NULL, cliRxBind),
#endif
CLI_COMMAND_DEF("get", "get variable value", "[name]", cliGet),
#ifdef USE_GPS

View file

@ -87,6 +87,7 @@
#include "rx/rx.h"
#include "rx/cc2500_frsky_common.h"
#include "rx/cc2500_sfhss.h"
#include "rx/spektrum.h"
#include "sensors/acceleration.h"
@ -224,7 +225,8 @@ static const char * const lookupTableRxSpi[] = {
"FRSKY_X",
"FLYSKY",
"FLYSKY_2A",
"KN"
"KN",
"SFHSS"
};
#endif
@ -1112,6 +1114,10 @@ const clivalue_t valueTable[] = {
{ "frsky_spi_bind_hop_data", VAR_UINT8 | MASTER_VALUE | MODE_ARRAY, .config.array.length = 50, PG_RX_FRSKY_SPI_CONFIG, offsetof(rxFrSkySpiConfig_t, bindHopData) },
{ "frsky_x_rx_num", VAR_UINT8 | MASTER_VALUE, .config.minmax = { 0, 255 }, PG_RX_FRSKY_SPI_CONFIG, offsetof(rxFrSkySpiConfig_t, rxNum) },
{ "frsky_spi_use_external_adc", VAR_UINT8 | MASTER_VALUE | MODE_LOOKUP, .config.lookup = { TABLE_OFF_ON }, PG_RX_FRSKY_SPI_CONFIG, offsetof(rxFrSkySpiConfig_t, useExternalAdc) },
#endif
#ifdef USE_RX_SFHSS_SPI
{ "sfhss_spi_tx_id", VAR_UINT8 | MASTER_VALUE | MODE_ARRAY, .config.array.length = 2, PG_RX_SFHSS_SPI_CONFIG, offsetof(rxSfhssSpiConfig_t, bindTxId) },
{ "sfhss_spi_offset", VAR_INT8 | MASTER_VALUE, .config.minmax = { -127, 127 }, PG_RX_SFHSS_SPI_CONFIG, offsetof(rxSfhssSpiConfig_t, bindOffset) },
#endif
{ "led_inversion", VAR_UINT8 | MASTER_VALUE, .config.minmax = { 0, ((1 << STATUS_LED_NUMBER) - 1) }, PG_STATUS_LED_CONFIG, offsetof(statusLedConfig_t, inversion) },
#ifdef USE_DASHBOARD