diff --git a/Lua_scripts/MultiChan.txt b/Lua_scripts/MultiChan.txt index a80961b..b968d16 100644 --- a/Lua_scripts/MultiChan.txt +++ b/Lua_scripts/MultiChan.txt @@ -192,3 +192,6 @@ 83,0,E129,E129,1,TakLan,EmStop,TrimA,TrimE,TrimR 84,0,JOYSWAY,Std,0 85,0,E016H,Std,1,Stop,Flip,n-a,HLess,RTH +87,0,IKEA +89,0,LOSI +90,0,MouldKg,Std,E,F \ No newline at end of file diff --git a/Lua_scripts/MultiChannelsUpdater.lua b/Lua_scripts/MultiChannelsUpdater.lua index 039d166..6581753 100644 --- a/Lua_scripts/MultiChannelsUpdater.lua +++ b/Lua_scripts/MultiChannelsUpdater.lua @@ -280,7 +280,7 @@ local function Multi_Init() end --Exceptions on first 4 channels... - if ( protocol == 73 or (protocol == 74 and sub_protocol == 0) or (protocol == 60 and sub_protocol == 2) ) then -- Kyosho or RadioLink Surface or Pelikan/SCX24 + if ( protocol == 73 or (protocol == 74 and sub_protocol == 0) or (protocol == 60 and sub_protocol == 2) or protocol == 89) then -- Kyosho or RadioLink Surface or Pelikan/SCX24 or Losi channel_names[1] = "ST" channel_names[2] = "THR" channel_names[3] = "CH3" @@ -296,6 +296,12 @@ local function Multi_Init() channel_names[3] = "AUX1" channel_names[4] = "AUX2" end + if ( protocol == 90 ) then -- Mould King + channel_names[1] = "A" + channel_names[2] = "B" + channel_names[3] = "C" + channel_names[4] = "D" + end --Check MultiChan.txt local f = io.open("/SCRIPTS/TOOLS/MultiChan.txt", "r") diff --git a/Multiprotocol/MouldKg_nrf24l01.ino b/Multiprotocol/MouldKg_nrf24l01.ino new file mode 100644 index 0000000..52317c9 --- /dev/null +++ b/Multiprotocol/MouldKg_nrf24l01.ino @@ -0,0 +1,162 @@ +/* + This project is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + +Multiprotocol is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Multiprotocol. If not, see . + */ +#if defined(MOULDKG_NRF24L01_INO) + +#include "iface_xn297.h" + +//#define FORCE_MOULDKG_ORIGINAL_ID + +#define MOULDKG_PACKET_PERIOD 5000 +#define MOULDKG_BIND_PACKET_PERIOD 12000 +#define MOULDKG_TX_BIND_CHANNEL 11 +#define MOULDKG_RX_BIND_CHANNEL 76 +#define MOULDKG_PAYLOAD_SIZE 5 +#define MOULDKG_BIND_PAYLOAD_SIZE 7 +#define MOULDKG_BIND_COUNT 300 +#define MOULDKG_RF_NUM_CHANNELS 4 + +enum { + MOULDKG_BINDTX=0, + MOULDKG_BINDRX, + MOULDKG_DATA, +}; + +static void __attribute__((unused)) MOULDKG_send_packet() +{ + memcpy(&packet[1],rx_tx_addr,3); + if(IS_BIND_IN_PROGRESS) + { + packet[0] = 0xC0; + memset(&packet[4], 0x00, 3); + } + else + { + XN297_RFChannel(hopping_frequency[(packet_count>>1)&0x03]); + + uint8_t val=0; + if(packet_count&1) + { + packet[0] = 0x31; + //Button B + if(Channel_data[CH2]>CHANNEL_MAX_COMMAND) val |= 0x40; + else if(Channel_data[CH2]CHANNEL_MAX_COMMAND) val |= 0x10; + else if(Channel_data[CH3]CHANNEL_MAX_COMMAND) val |= 0x01; + else if(Channel_data[CH1]CHANNEL_MAX_COMMAND) val |= 0x04; + else if(Channel_data[CH4]CC2500 PROTO_WILLIFM = 88, // 27/35ab/40/41/72 MHz module external project PROTO_LOSI = 89, // =>CYRF6936 + PROTO_MOULDKG = 90, // =>NRF24L01 PROTO_NANORF = 126, // =>NRF24L01 PROTO_TEST = 127, // =>CC2500 diff --git a/Multiprotocol/Validate.h b/Multiprotocol/Validate.h index 3c2b8c4..c932fb3 100644 --- a/Multiprotocol/Validate.h +++ b/Multiprotocol/Validate.h @@ -277,6 +277,7 @@ #undef FRSKY_RX_CC2500_INO #undef HITEC_CC2500_INO #undef HOTT_CC2500_INO + #undef IKEAANSLUTA_CC2500_INO #undef REDPINE_CC2500_INO #undef RLINK_CC2500_INO #undef SCANNER_CC2500_INO @@ -307,6 +308,7 @@ #undef JJRC345_NRF24L01_INO #undef KN_NRF24L01_INO #undef LOLI_NRF24L01_INO + #undef MOULDKG_NRF24L01_INO #undef NCC1701_NRF24L01_INO #undef POTENSIC_NRF24L01_INO #undef PROPEL_NRF24L01_INO diff --git a/Multiprotocol/_Config.h b/Multiprotocol/_Config.h index 766f316..5eb53d2 100644 --- a/Multiprotocol/_Config.h +++ b/Multiprotocol/_Config.h @@ -235,6 +235,7 @@ #define JJRC345_NRF24L01_INO #define KN_NRF24L01_INO #define LOLI_NRF24L01_INO +#define MOULDKG_NRF24L01_INO #define NCC1701_NRF24L01_INO #define POTENSIC_NRF24L01_INO #define PROPEL_NRF24L01_INO @@ -726,6 +727,8 @@ const PPM_Parameters PPM_prot[14*NBR_BANKS]= { PHOENIX PROTO_MLINK NONE + PROTO_MOULDKG + NONE PROTO_MT99XX MT99 H7 diff --git a/Protocols_Details.md b/Protocols_Details.md index efb475f..11bb6ba 100644 --- a/Protocols_Details.md +++ b/Protocols_Details.md @@ -114,9 +114,10 @@ CFlie|38|CFlie||||||||NRF24L01| [KN](Protocols_Details.md#KN---9)|9|WLTOYS|FEILUN|||||||NRF24L01| [Kyosho](Protocols_Details.md#Kyosho---73)|73|FHSS|Hype|||||||A7105| [LOLI](Protocols_Details.md#LOLI---82)|82|||||||||NRF24L01| -[Losi](Protocols_Details.md#LOLI---89)|89|||||||||CYRF6936| +[Losi](Protocols_Details.md#Losi---89)|89|||||||||CYRF6936| [MJXq](Protocols_Details.md#MJXQ---18)|18|WLH08|X600|X800|H26D|E010*|H26WH|PHOENIX*||NRF24L01|XN297 [MLINK](Protocols_Details.md#MLINK---78)|78|||||||||CYRF6936| +[MouldKg]Protocols_Details.md#MouldKg---90)|90|||||||||NRF24L01|XN297 [MT99xx](Protocols_Details.md#MT99XX---17)|17|MT|H7|YZ|LS|FY805|A180|DRAGON||NRF24L01|XN297 [NCC1701](Protocols_Details.md#NCC1701---44)|44|||||||||NRF24L01| [OMP](Protocols_Details.md#OMP---77)|77|||||||||CC2500&NRF24L01|XN297L @@ -1702,6 +1703,13 @@ CH14| CH6 | -100% | 0% | | - | - CH15| CH7 | -100% | 0% | - | - | +100% CH16| CH8 | -100% | 0% | - | - | - +## MouldKg - *90* +Mould King 2.4GHz TX + +CH1|CH2|CH3|CH4|CH5|CH6 +---|---|---|---|---|--- +A|B|C|D|E|F + ## NCC1701 - *44* Model: Air Hogs Star Trek USS Enterprise NCC-1701-A