XK: new subprotocol Cars

Removed:
 - deadband which was needed on the planes
- force bind since the cars remember the bind info
-
This commit is contained in:
pascallanger 2024-02-17 11:02:52 +01:00
parent 50bd4850fa
commit 72f87cade9
7 changed files with 26 additions and 12 deletions

View File

@ -188,6 +188,7 @@
30,5,WK2x01,W6HEL_I,0,Gear,Col,Gyro 30,5,WK2x01,W6HEL_I,0,Gear,Col,Gyro
62,0,XK,X450,1,FMode,TakeOf,Emerg,3D_6G,Pict,Video 62,0,XK,X450,1,FMode,TakeOf,Emerg,3D_6G,Pict,Video
62,1,XK,X420,1,FMode,TakeOf,Emerg,3D_6G,Pict,Video 62,1,XK,X420,1,FMode,TakeOf,Emerg,3D_6G,Pict,Video
62,2,XK,Cars,0,FMode,TakeOf,Emerg,3D_6G,Pict,Video
8,0,YD717,Std,1,Flip,Light,Pict,Video,HLess 8,0,YD717,Std,1,Flip,Light,Pict,Video,HLess
8,1,YD717,SkyWlkr,1,Flip,Light,Pict,Video,HLess 8,1,YD717,SkyWlkr,1,Flip,Light,Pict,Video,HLess
8,2,YD717,Simax4,1,Flip,Light,Pict,Video,HLess 8,2,YD717,Simax4,1,Flip,Light,Pict,Video,HLess

View File

@ -59,7 +59,7 @@
59,Bayang_RX,Multi,CPPM 59,Bayang_RX,Multi,CPPM
60,Pelikan,Pro,Lite,SCX24 60,Pelikan,Pro,Lite,SCX24
61,Tiger 61,Tiger
62,XK,X450,X420 62,XK,X450,X420,Cars
63,XN_DUMP,250K,1M,2M,AUTO 63,XN_DUMP,250K,1M,2M,AUTO
64,FrskyX2,CH_16,CH_8,EU_16,EU_8,Cloned 64,FrskyX2,CH_16,CH_8,EU_16,EU_8,Cloned
65,FrSkyR9,915MHz,868MHz,915_8ch,868_8ch,FCC,--,FCC_8ch,--_8ch 65,FrSkyR9,915MHz,868MHz,915_8ch,868_8ch,FCC,--,FCC_8ch,--_8ch

View File

@ -158,7 +158,7 @@ const char STR_SUBTYPE_XN297DUMP[] = "\x07""250Kbps""1Mbps\0 ""2Mbps\0 ""Auto\0
const char STR_SUBTYPE_ESKY150[] = "\x03""4ch""7ch"; const char STR_SUBTYPE_ESKY150[] = "\x03""4ch""7ch";
const char STR_SUBTYPE_ESKY150V2[] = "\x05""150V2"; const char STR_SUBTYPE_ESKY150V2[] = "\x05""150V2";
const char STR_SUBTYPE_V911S[] = "\x05""V911S""E119\0"; const char STR_SUBTYPE_V911S[] = "\x05""V911S""E119\0";
const char STR_SUBTYPE_XK[] = "\x04""X450""X420"; const char STR_SUBTYPE_XK[] = "\x04""X450""X420""Cars";
const char STR_SUBTYPE_FRSKYR9[] = "\x07""915MHz\0""868MHz\0""915 8ch""868 8ch""FCC\0 ""--\0 ""FCC 8ch""-- 8ch\0"; const char STR_SUBTYPE_FRSKYR9[] = "\x07""915MHz\0""868MHz\0""915 8ch""868 8ch""FCC\0 ""--\0 ""FCC 8ch""-- 8ch\0";
const char STR_SUBTYPE_ESKY[] = "\x03""Std""ET4"; const char STR_SUBTYPE_ESKY[] = "\x03""Std""ET4";
const char STR_SUBTYPE_PROPEL[] = "\x04""74-Z"; const char STR_SUBTYPE_PROPEL[] = "\x04""74-Z";
@ -489,7 +489,7 @@ const mm_protocol_definition multi_protocols[] = {
{PROTO_XERALL, STR_XERALL, NO_SUBTYPE, 0, OPTION_NONE, 0, 0, SW_NRF, XERALL_init, XERALL_callback }, {PROTO_XERALL, STR_XERALL, NO_SUBTYPE, 0, OPTION_NONE, 0, 0, SW_NRF, XERALL_init, XERALL_callback },
#endif #endif
#if defined(XK_CCNRF_INO) #if defined(XK_CCNRF_INO)
{PROTO_XK, STR_XK, STR_SUBTYPE_XK, 2, OPTION_RFTUNE, 0, 0, SW_NRF, XK_init, XK_callback }, {PROTO_XK, STR_XK, STR_SUBTYPE_XK, 3, OPTION_RFTUNE, 0, 0, SW_NRF, XK_init, XK_callback },
#endif #endif
#if defined(XN297DUMP_NRF24L01_INO) #if defined(XN297DUMP_NRF24L01_INO)
{PROTO_XN297DUMP, STR_XN297DUMP, STR_SUBTYPE_XN297DUMP, 6, OPTION_RFCHAN, 0, 0, SW_NRF, XN297Dump_init, XN297Dump_callback }, {PROTO_XN297DUMP, STR_XN297DUMP, STR_SUBTYPE_XN297DUMP, 6, OPTION_RFCHAN, 0, 0, SW_NRF, XN297Dump_init, XN297Dump_callback },

View File

@ -376,6 +376,7 @@ enum XK
{ {
X450 = 0, X450 = 0,
X420 = 1, X420 = 1,
XK_CARS = 2,
}; };
enum XN297DUMP enum XN297DUMP
{ {

View File

@ -29,10 +29,17 @@ Multiprotocol is distributed in the hope that it will be useful,
static uint16_t __attribute__((unused)) XK_convert_channel(uint8_t num) static uint16_t __attribute__((unused)) XK_convert_channel(uint8_t num)
{ {
uint16_t val;
if(sub_protocol != XK_CARS)
{
// Introduce deadband on all channels to prevent twitching // Introduce deadband on all channels to prevent twitching
//debug("val:%d",val); //debug("val:%d",val);
uint16_t val=convert_channel_8b_limit_deadband(num,0x00,0x80, 0xFF, 40)<<2; val=convert_channel_8b_limit_deadband(num,0x00,0x80, 0xFF, 40)<<2;
//debugln(",%d",val); //debugln(",%d",val);
}
else
val=convert_channel_16b_limit(num,0x00,0x3FF);
// 1FF..01=left, 00=center, 200..3FF=right // 1FF..01=left, 00=center, 200..3FF=right
if(val==0x200) if(val==0x200)
@ -187,7 +194,7 @@ static void __attribute__((unused)) XK_initialize_txid()
static void __attribute__((unused)) XK_RF_init() static void __attribute__((unused)) XK_RF_init()
{ {
XN297_Configure(XN297_CRCEN, XN297_SCRAMBLED, sub_protocol==X420 ? XN297_1M : XN297_250K); XN297_Configure(XN297_CRCEN, XN297_SCRAMBLED, sub_protocol==X450 ? XN297_250K : XN297_1M );
XN297_SetTXAddr((uint8_t*)"\x68\x94\xA6\xD5\xC3", 5); // Bind address XN297_SetTXAddr((uint8_t*)"\x68\x94\xA6\xD5\xC3", 5); // Bind address
XN297_HoppingCalib(XK_RF_BIND_NUM_CHANNELS+XK_RF_NUM_CHANNELS); // Calibrate all channels XN297_HoppingCalib(XK_RF_BIND_NUM_CHANNELS+XK_RF_NUM_CHANNELS); // Calibrate all channels
} }
@ -209,6 +216,7 @@ uint16_t XK_callback()
void XK_init() void XK_init()
{ {
if(sub_protocol != XK_CARS)
BIND_IN_PROGRESS; // Autobind protocol BIND_IN_PROGRESS; // Autobind protocol
XK_initialize_txid(); XK_initialize_txid();
XK_RF_init(); XK_RF_init();

View File

@ -846,6 +846,7 @@ const PPM_Parameters PPM_prot[14*NBR_BANKS]= {
PROTO_XK PROTO_XK
X450 X450
X420 X420
XK_CARS
PROTO_YD717 PROTO_YD717
YD717 YD717
SKYWLKR SKYWLKR

View File

@ -131,7 +131,7 @@ CFlie|38|CFlie||||||||NRF24L01|
[Q2X2](Protocols_Details.md#Q2X2---29)|29|Q222|Q242|Q282||||||NRF24L01| [Q2X2](Protocols_Details.md#Q2X2---29)|29|Q222|Q242|Q282||||||NRF24L01|
[Q303](Protocols_Details.md#Q303---31)|31|Q303|CX35|CX10D|CX10WD|||||NRF24L01|XN297 [Q303](Protocols_Details.md#Q303---31)|31|Q303|CX35|CX10D|CX10WD|||||NRF24L01|XN297
[Q90C](Protocols_Details.md#Q90C---72)|72|Q90C*||||||||NRF24L01|XN297 [Q90C](Protocols_Details.md#Q90C---72)|72|Q90C*||||||||NRF24L01|XN297
[RadioLink](Protocols_Details.md#RadioLink---74)|74|Surface|Air|DumboRC||||||CC2500| [RadioLink](Protocols_Details.md#RadioLink---74)|74|Surface|Air|DumboRC|RC4G|||||CC2500|
[Realacc](Protocols_Details.md#Realacc---76)|76|R11||||||||NRF24L01| [Realacc](Protocols_Details.md#Realacc---76)|76|R11||||||||NRF24L01|
[Redpine](Protocols_Details.md#Redpine---50)|50|FAST|SLOW|||||||NRF24L01|XN297 [Redpine](Protocols_Details.md#Redpine---50)|50|FAST|SLOW|||||||NRF24L01|XN297
[Scanner](Protocols_Details.md#Scanner---54)|54|||||||||CC2500| [Scanner](Protocols_Details.md#Scanner---54)|54|||||||||CC2500|
@ -150,7 +150,7 @@ CFlie|38|CFlie||||||||NRF24L01|
[WFLY2](Protocols_Details.md#WFLY2---79)|79|RF20x||||||||A7105| [WFLY2](Protocols_Details.md#WFLY2---79)|79|RF20x||||||||A7105|
[WK2x01](Protocols_Details.md#WK2X01---30)|30|WK2801|WK2401|W6_5_1|W6_6_1|W6_HEL|W6_HEL_I|||CYRF6936| [WK2x01](Protocols_Details.md#WK2X01---30)|30|WK2801|WK2401|W6_5_1|W6_6_1|W6_HEL|W6_HEL_I|||CYRF6936|
[XERALL](Protocols_Details.md#XERALL---91)|91|Tank||||||||NRF24L01|XN297 [XERALL](Protocols_Details.md#XERALL---91)|91|Tank||||||||NRF24L01|XN297
[XK](Protocols_Details.md#XK---62)|62|X450|X420|||||||NRF24L01|XN297 [XK](Protocols_Details.md#XK---62)|62|X450|X420|Cars||||||NRF24L01|XN297
[YD717](Protocols_Details.md#YD717---8)|8|YD717|SKYWLKR|SYMAX4|XINXUN|NIHUI||||NRF24L01| [YD717](Protocols_Details.md#YD717---8)|8|YD717|SKYWLKR|SYMAX4|XINXUN|NIHUI||||NRF24L01|
[ZSX](Protocols_Details.md#ZSX---52)|52|280||||||||NRF24L01|XN297 [ZSX](Protocols_Details.md#ZSX---52)|52|280||||||||NRF24L01|XN297
* "*" Sub Protocols designated by * suffix are using a XN297L@250kbps which will be emulated by default with the NRF24L01. If option (freq tune) is diffrent from 0, the CC2500 module (if installed) will be used instead. Each specific sub protocol has a more detailed explanation. * "*" Sub Protocols designated by * suffix are using a XN297L@250kbps which will be emulated by default with the NRF24L01. If option (freq tune) is diffrent from 0, the CC2500 module (if installed) will be used instead. Each specific sub protocol has a more detailed explanation.
@ -1430,6 +1430,9 @@ If only a NRF24L01 is installed then this sub protocol might be problematic beca
### Sub_protocol X420 - *1* ### Sub_protocol X420 - *1*
Models: XK X420/X520 (TX=X4), WLtoys 284131/284161/284010 Models: XK X420/X520 (TX=X4), WLtoys 284131/284161/284010
### Sub_protocol Cars - *2*
Models: WLtoys cars 284131/284161/284010/...
*** ***
# NRF24L01 RF Module # NRF24L01 RF Module