From c803eeb26ac6e6e2f76402b8d60d9bb9e0720106 Mon Sep 17 00:00:00 2001 From: pascallanger Date: Thu, 28 Nov 2019 17:01:33 +0100 Subject: [PATCH] Esky150: add sub protocols 4CH and 7CH --- Multiprotocol/ESky150_nrf24l01.ino | 4 ++-- Multiprotocol/Multi.txt | 2 +- Multiprotocol/Multi_Names.ino | 5 +++-- Multiprotocol/Multiprotocol.h | 10 +++++++++- Multiprotocol/_Config.h | 3 ++- Protocols_Details.md | 8 +++++++- 6 files changed, 24 insertions(+), 8 deletions(-) diff --git a/Multiprotocol/ESky150_nrf24l01.ino b/Multiprotocol/ESky150_nrf24l01.ino index b00fee0..06ff3a9 100644 --- a/Multiprotocol/ESky150_nrf24l01.ino +++ b/Multiprotocol/ESky150_nrf24l01.ino @@ -92,8 +92,8 @@ static void __attribute__((unused)) ESKY150_send_packet() uint8_t flight_mode=0; uint16_t aux_ch6=0; uint8_t aux_ch7=0; - if(option==1) - { + if(sub_protocol) + { // 7 channels flight_mode=ESKY150_convert_2bit_channel(CH5); aux_ch6=convert_channel_16b_limit(CH6,1000,2000); aux_ch7=ESKY150_convert_2bit_channel(CH7); diff --git a/Multiprotocol/Multi.txt b/Multiprotocol/Multi.txt index eaa6896..0e379c6 100644 --- a/Multiprotocol/Multi.txt +++ b/Multiprotocol/Multi.txt @@ -13,7 +13,7 @@ 13,CG023,CG023,YD829 14,Bayang,Bayang,H8S3D,X16_AH,IRDRONE,DHD_D4 15,FrskyX,CH_16,CH_8,EU_16,EU_8 -16,ESky +16,ESky,4CH,7CH 17,MT99xx,MT,H7,YZ,LS,FY805 18,MJXq,WLH08,X600,X800,H26D,E010,H26WH,PHOENIX 19,Shenqi diff --git a/Multiprotocol/Multi_Names.ino b/Multiprotocol/Multi_Names.ino index e4c6b0d..c9ffe7a 100644 --- a/Multiprotocol/Multi_Names.ino +++ b/Multiprotocol/Multi_Names.ino @@ -108,8 +108,9 @@ const char STR_SUBTYPE_REDPINE[] = "\x04""Fast""Slow"; const char STR_SUBTYPE_POTENSIC[] = "\x03""A20"; const char STR_SUBTYPE_ZSX[] = "\x07""280JJRC"; const char STR_SUBTYPE_FLYZONE[] = "\x05""FZ410"; -const char STR_SUBTYPE_FX816[] = "\x03""P38"; +const char STR_SUBTYPE_FX816[] = "\x03""P38"; const char STR_SUBTYPE_XN297DUMP[] = "\x07""250Kbps""1Mbps\0 ""2Mbps\0 "; +const char STR_SUBTYPE_ESKY150[] = "\x03""4CH""7CH"; enum { @@ -228,7 +229,7 @@ const mm_protocol_definition multi_protocols[] = { {PROTO_CABELL, STR_CABELL, 8, STR_SUBTYPE_CABELL, OPTION_OPTION }, #endif #if defined(ESKY150_NRF24L01_INO) - {PROTO_ESKY150, STR_ESKY150, 0, NO_SUBTYPE, OPTION_NONE }, + {PROTO_ESKY150, STR_ESKY150, 2, STR_SUBTYPE_ESKY150, OPTION_NONE }, #endif #if defined(H8_3D_NRF24L01_INO) {PROTO_H8_3D, STR_H8_3D, 4, STR_SUBTYPE_H83D, OPTION_NONE }, diff --git a/Multiprotocol/Multiprotocol.h b/Multiprotocol/Multiprotocol.h index 4979144..d246b7a 100644 --- a/Multiprotocol/Multiprotocol.h +++ b/Multiprotocol/Multiprotocol.h @@ -19,7 +19,7 @@ #define VERSION_MAJOR 1 #define VERSION_MINOR 3 #define VERSION_REVISION 0 -#define VERSION_PATCH_LEVEL 45 +#define VERSION_PATCH_LEVEL 46 //****************** // Protocols @@ -292,6 +292,11 @@ enum TRAXXAS { RX6519 = 0, }; +enum ESKY150 +{ + ESKY150_4CH = 0, + ESKY150_7CH = 1, +}; #define NONE 0 #define P_HIGH 1 @@ -814,6 +819,9 @@ Serial: 100000 Baud 8e2 _ xxxx xxxx p -- RED_SLOW 1 sub_protocol==TRAXXAS RX6519 0 + sub_protocol==ESKY150 + ESKY150_4CH 0 + ESKY150_7CH 1 Power value => 0x80 0=High/1=Low Stream[3] = option_protocol; diff --git a/Multiprotocol/_Config.h b/Multiprotocol/_Config.h index d8835f1..1d90cd3 100644 --- a/Multiprotocol/_Config.h +++ b/Multiprotocol/_Config.h @@ -543,7 +543,8 @@ const PPM_Parameters PPM_prot[14*NBR_BANKS]= { PROTO_ESKY NONE PROTO_ESKY150 - NONE + ESKY150_4CH + ESKY150_7CH PROTO_FLYSKY Flysky V9X9 diff --git a/Protocols_Details.md b/Protocols_Details.md index 5f3e405..67e03c3 100644 --- a/Protocols_Details.md +++ b/Protocols_Details.md @@ -827,7 +827,13 @@ A|E|T|R|GYRO|PITCH ## ESKY150 - *35* ESky protocol for small models since 2014 (150, 300, 150X, ...) -Number of channels are set with option. option=0 4 channels and option=1 7 channels. An invalid option value will end up with 4 channels. +### Sub_protocol 4CH - *0* + +CH1|CH2|CH3|CH4 +---|---|---|--- +A|E|T|R + +### Sub_protocol 7CH - *1* CH1|CH2|CH3|CH4|CH5|CH6|CH7 ---|---|---|---|---|---|---