Compare commits

...

24 Commits

Author SHA1 Message Date
pascallanger
e9b09ffecd Update Protocols_Details.md 2019-12-04 10:58:40 +01:00
pascallanger
0008633d6e Bayang RX: Sync 2019-11-30 12:11:08 +01:00
pascallanger
396c005b0a BAYANG RX: enables 6 analog channels
Fix channels range -100%..+100%
2019-11-29 20:26:10 +01:00
pascallanger
d3c3fac4f7 Multi_names mandatory when using multi_telemetry
Validate that sub_proto is valid for the current protocol
Validate that disable channel mapping is valid for the current protocol
2019-11-29 18:50:57 +01:00
pascallanger
cf4acc1d4c Bayang RX: fix warnings 2019-11-29 18:46:24 +01:00
pascallanger
5bd95f8414 Merge pull request #300 from goebish/protocol_bayang_rx
Protocol Bayang rx
2019-11-29 16:37:13 +01:00
Goebish
a31d9a83a3 Use table for channel mapping 2019-11-29 14:26:59 +01:00
Goebish
9b24589897 Fix linefeeds 2019-11-29 14:24:23 +01:00
Goebish
8f3d634132 Fix documentation tag 2019-11-29 14:21:58 +01:00
Goebish
5ef1ccb99b Update protocol details 2019-11-29 13:36:36 +01:00
Goebish
e7d91bc76a Update protocol details 2019-11-29 12:10:56 +01:00
Goebish
e4309824c2 Add missing stuffs 2019-11-29 11:57:06 +01:00
Goebish
cc6a35ac8a Fix channel count 2019-11-29 02:53:19 +01:00
Goebish
1f13a6c281 Add Bayang RX protocol 2019-11-29 02:06:58 +01:00
Goebish
69519bdf14 Add skeleton for Bayang RX protocol 2019-11-28 20:02:59 +01:00
Ben Lye
2e5a8f384a Add '-inv-' to file names for the xn297dump builds 2019-11-28 18:59:40 +00:00
pascallanger
c803eeb26a Esky150: add sub protocols 4CH and 7CH 2019-11-28 17:01:33 +01:00
pascallanger
6a7497cdf8 Update FX816_nrf24l01.ino 2019-11-27 12:24:49 +01:00
pascallanger
3067ea3a5c New protocol: FX816
Model P38
Protocol number: 58
Sub protocol: None
Channels: A & T
2019-11-27 12:12:13 +01:00
pascallanger
9a5309d84b V911S: revert to nrf24l01 2019-11-27 12:10:49 +01:00
pascallanger
fff18f825a DSM: change timing to see if it improves long range telemetry RX range 2019-11-27 12:08:17 +01:00
Ben Lye
e70bdd4152 Update .travis.yml
Put the 'v' back in the version number in the file names
2019-11-26 09:28:45 +00:00
Ben Lye
cf77a1981f Travis CI test changes (#297) 2019-11-26 07:51:00 +00:00
pascallanger
10e33f5d5c Update _Config.h 2019-11-21 08:49:39 +01:00
15 changed files with 920 additions and 291 deletions

View File

@@ -1,8 +1,7 @@
dist: trusty
dist: bionic
sudo: true
#
language: c
#
env:
global:
- IDE_VERSION=1.8.9
@@ -11,41 +10,20 @@ env:
- BOARD="multi4in1:avr:multiatmega328p:bootloader=optiboot"
- BOARD="multi4in1:avr:multixmega32d4"
- BOARD="multi4in1:STM32F1:multistm32f103c:debug_option=none"
# - BOARD="multi4in1:STM32F1:multistm32f103c:debug_option=native"
- BOARD="multi4in1:STM32F1:multistm32f103c:debug_option=native"
- BOARD="multi4in1:STM32F1:multistm32f103c:debug_option=ftdi"
#
notifications:
email: false
#
before_install:
#
# Fetch the tag information for the current branch
- git fetch origin --tags
#
# Publish the buildroot script folder
- chmod +x ${TRAVIS_BUILD_DIR}/buildroot/bin/*
- export PATH=${TRAVIS_BUILD_DIR}/buildroot/bin/:${PATH}
#
# Install Arduino IDE
- wget http://downloads.arduino.cc/arduino-$IDE_VERSION-linux64.tar.xz
- tar xf arduino-$IDE_VERSION-linux64.tar.xz
- mv arduino-$IDE_VERSION $HOME/arduino-ide
- export PATH=$PATH:$HOME/arduino-ide
# Set the Multi boards package URL
- arduino --pref "boardsmanager.additional.urls=https://raw.githubusercontent.com/pascallanger/DIY-Multiprotocol-TX-Module-Boards/master/package_multi_4in1_board_index.json" --save-prefs
#
- if [[ "$BOARD" =~ "multi4in1:STM32F1:" ]]; then
arduino --install-boards multi4in1:STM32F1;
fi
#
- if [[ "$BOARD" =~ "multi4in1:avr:" ]]; then
arduino --install-boards multi4in1:avr;
fi
#
- buildMulti() { start_fold config_diff; travis_time_start; git diff Multiprotocol/_Config.h; end_fold config_diff; exitcode=0; BUILDCMD="arduino --verify --board $BOARD Multiprotocol/Multiprotocol.ino --pref build.path=./build/"; echo $BUILDCMD; $BUILDCMD; if [ $? -ne 0 ]; then exitcode=1; fi; echo; return $exitcode; }
- buildProtocol() { exitcode=0; opt_disable $ALL_PROTOCOLS; opt_enable $1; buildMulti; if [ $? -ne 0 ]; then exitcode=1; fi; return $exitcode; }
- buildEachProtocol() { exitcodesum=0; for PROTOCOL in $ALL_PROTOCOLS ; do printf "\e[33;1mBuilding $PROTOCOL\e[0m"; buildProtocol $PROTOCOL; if [ $? -ne 0 ]; then exitcodesum=$((exitcodesum + 1)); fi; done; return $exitcodesum; }
#
# Arduino IDE adds a lot of noise caused by network traffic; firewall it
- sudo iptables -P INPUT DROP
- sudo iptables -P FORWARD DROP
@@ -53,16 +31,230 @@ before_install:
- sudo iptables -A INPUT -i lo -j ACCEPT
- sudo iptables -A OUTPUT -o lo -j ACCEPT
- sudo iptables -A INPUT -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT
#
install: true
# Helper functions for the builds
- buildMulti() { start_fold config_diff; travis_time_start; git diff Multiprotocol/_Config.h; end_fold config_diff; exitcode=0; BUILDCMD="arduino --verify --board $BOARD Multiprotocol/Multiprotocol.ino --pref build.path=./build/"; echo $BUILDCMD; $BUILDCMD; if [ $? -ne 0 ]; then exitcode=1; fi; echo; return $exitcode; }
- buildProtocol() { exitcode=0; opt_disable $ALL_PROTOCOLS; opt_enable $1; buildMulti; if [ $? -ne 0 ]; then exitcode=1; fi; return $exitcode; }
- buildEachProtocol() { exitcodesum=0; for PROTOCOL in $ALL_PROTOCOLS ; do printf "\e[33;1mBuilding $PROTOCOL\e[0m"; buildProtocol $PROTOCOL; if [ $? -ne 0 ]; then exitcodesum=$((exitcodesum + 1)); fi; done; return $exitcodesum; }
- buildRFModule() { exitcode=0; opt_disable $ALL_RFMODULES; opt_enable $1; buildMulti; if [ $? -ne 0 ]; then exitcode=1; fi; return $exitcode; }
- buildEachRFModule() { exitcodesum=0; for RFMODULE in $ALL_RFMODULES; do printf "\e[33;1mBuilding $RFMODULE\e[0m"; buildRFModule $RFMODULE; if [ $? -ne 0 ]; then exitcodesum=$((exitcodesum + 1)); fi; done; return $exitcodesum; }
- buildDefault() { exitcode=0; printf "\n\e[33;1mBuilding default configuration\e[0m\n"; buildMulti; if [ $? -ne 0 ]; then exitcode=1; fi; return $exitcode; }
- buildSerialOnly() { exitcode=0; printf "\n\e[33;1mBuilding serial mode only\e[0m\n"; opt_disable ENABLE_PPM; opt_enable ENABLE_SERIAL; buildMulti; if [ $? -ne 0 ]; then exitcode=1; fi; return $exitcode; }
- buildPPMOnly() { exitcode=0; printf "\n\e[33;1mBuilding PPM mode only\e[0m\n"; opt_enable ENABLE_PPM; opt_disable ENABLE_SERIAL; buildMulti; if [ $? -ne 0 ]; then exitcode=1; fi; return $exitcode; }
# Function to build the release files - dependent on board type
- if [[ "$BOARD" == "multi4in1:avr:multixmega32d4" ]]; then
buildReleaseFiles(){
printf "\n\e[33;1mBuilding multi-orangerx-aetr-green-inv-v$MULTI_VERSION.bin\e[0m";
opt_enable $ALL_PROTOCOLS;
opt_disable ORANGE_TX_BLUE;
buildMulti;
mv build/Multiprotocol.ino.bin ./binaries/multi-orangerx-aetr-green-inv-v$MULTI_VERSION.bin;
printf "\n\e[33;1mBuilding multi-orangerx-aetr-blue-inv-v$MULTI_VERSION.bin\e[0m";
opt_enable ORANGE_TX_BLUE;
buildMulti;
mv build/Multiprotocol.ino.bin ./binaries/multi-orangerx-aetr-blue-inv-v$MULTI_VERSION.bin;
cp Multiprotocol/Multi.txt ./binaries/Multi.txt; };
elif [[ "$BOARD" == "multi4in1:avr:multiatmega328p:bootloader=none" ]]; then
buildReleaseFiles(){
printf "\n\e[33;1mBuilding multi-avr-usbasp-aetr-A7105-inv-v$MULTI_VERSION.bin\e[0m";
opt_disable CHECK_FOR_BOOTLOADER;
opt_disable $ALL_PROTOCOLS;
opt_enable $A7105_PROTOCOLS;
buildMulti;
mv build/Multiprotocol.ino.bin ./binaries/multi-avr-usbasp-aetr-A7105-inv-v$MULTI_VERSION.bin;
printf "\n\e[33;1mBuilding multi-avr-usbasp-aetr-CC2500-inv-v$MULTI_VERSION.bin\e[0m";
opt_disable $ALL_PROTOCOLS;
opt_enable $CC2500_PROTOCOLS;
buildMulti;
mv build/Multiprotocol.ino.bin ./binaries/multi-avr-usbasp-aetr-CC2500-inv-v$MULTI_VERSION.bin;
printf "\n\e[33;1mBuilding multi-avr-usbasp-aetr-CYRF6936-inv-v$MULTI_VERSION.bin\e[0m";
opt_disable $ALL_PROTOCOLS;
opt_enable $CYRF6936_PROTOCOLS;
buildMulti;
mv build/Multiprotocol.ino.bin ./binaries/multi-avr-usbasp-aetr-CYRF6936-inv-v$MULTI_VERSION.bin; };
elif [[ "$BOARD" == "multi4in1:avr:multiatmega328p:bootloader=optiboot" ]]; then
buildReleaseFiles(){
printf "\n\e[33;1mBuilding multi-avr-txflash-aetr-A7105-inv-v$MULTI_VERSION.bin\e[0m";
opt_enable CHECK_FOR_BOOTLOADER;
opt_disable $ALL_PROTOCOLS;
opt_enable $A7105_PROTOCOLS;
buildMulti;
mv build/Multiprotocol.ino.bin ./binaries/multi-avr-txflash-aetr-A7105-inv-v$MULTI_VERSION.bin;
printf "\n\e[33;1mBuilding multi-avr-txflash-aetr-CC2500-inv-v$MULTI_VERSION.bin\e[0m";
opt_disable $ALL_PROTOCOLS;
opt_enable $CC2500_PROTOCOLS;
buildMulti;
mv build/Multiprotocol.ino.bin ./binaries/multi-avr-txflash-aetr-CC2500-inv-v$MULTI_VERSION.bin;
printf "\n\e[33;1mBuilding multi-avr-txflash-aetr-CYRF6936-inv-v$MULTI_VERSION.bin\e[0m";
opt_disable $ALL_PROTOCOLS;
opt_enable $CYRF6936_PROTOCOLS;
buildMulti;
mv build/Multiprotocol.ino.bin ./binaries/multi-avr-txflash-aetr-CYRF6936-inv-v$MULTI_VERSION.bin; };
elif [[ "$BOARD" == "multi4in1:STM32F1:multistm32f103c:debug_option=none" ]]; then
buildReleaseFiles(){
printf "\n\e[33;1mBuilding multi-stm-erskytx-aetr-inv-v$MULTI_VERSION.bin\e[0m";
opt_enable CHECK_FOR_BOOTLOADER;
opt_enable $ALL_PROTOCOLS;
opt_enable MULTI_STATUS;
opt_disable MULTI_TELEMETRY;
buildMulti;
mv build/Multiprotocol.ino.bin ./binaries/multi-stm-erskytx-aetr-inv-v$MULTI_VERSION.bin;
printf "\n\e[33;1mBuilding multi-stm-erskytx-taer-inv-v$MULTI_VERSION.bin\e[0m";
opt_replace AETR TAER;
buildMulti;
mv build/Multiprotocol.ino.bin ./binaries/multi-stm-erskytx-taer-inv-v$MULTI_VERSION.bin;
printf "\n\e[33;1mBuilding multi-stm-erskytx-reta-inv-v$MULTI_VERSION.bin\e[0m";
opt_replace TAER RETA;
buildMulti;
mv build/Multiprotocol.ino.bin ./binaries/multi-stm-erskytx-reta-inv-v$MULTI_VERSION.bin;
printf "\n\e[33;1mBuilding multi-stm-erskytx-aetr-noinv-v$MULTI_VERSION.bin\e[0m";
opt_replace RETA AETR;
opt_disable INVERT_TELEMETRY;
buildMulti;
mv build/Multiprotocol.ino.bin ./binaries/multi-stm-erskytx-aetr-noinv-v$MULTI_VERSION.bin;
printf "\n\e[33;1mBuilding multi-stm-erskytx-taer-noinv-v$MULTI_VERSION.bin\e[0m";
opt_replace AETR TAER;
buildMulti;
mv build/Multiprotocol.ino.bin ./binaries/multi-stm-erskytx-taer-noinv-v$MULTI_VERSION.bin;
printf "\n\e[33;1mBuilding multi-stm-erskytx-reta-noinv-v$MULTI_VERSION.bin\e[0m";
opt_replace TAER RETA;
buildMulti;
mv build/Multiprotocol.ino.bin ./binaries/multi-stm-erskytx-reta-noinv-v$MULTI_VERSION.bin;
printf "\n\e[33;1mBuilding multi-stm-opentx-aetr-inv-v$MULTI_VERSION.bin\e[0m";
opt_replace RETA AETR;
opt_disable MULTI_STATUS;
opt_enable MULTI_TELEMETRY;
opt_enable INVERT_TELEMETRY;
buildMulti;
mv build/Multiprotocol.ino.bin ./binaries/multi-stm-opentx-aetr-inv-v$MULTI_VERSION.bin;
printf "\n\e[33;1mBuilding multi-stm-opentx-taer-inv-v$MULTI_VERSION.bin\e[0m";
opt_replace AETR TAER;
buildMulti;
mv build/Multiprotocol.ino.bin ./binaries/multi-stm-opentx-taer-inv-v$MULTI_VERSION.bin;
printf "\n\e[33;1mBuilding multi-stm-opentx-reta-inv-v$MULTI_VERSION.bin\e[0m";
opt_replace TAER RETA;
buildMulti;
mv build/Multiprotocol.ino.bin ./binaries/multi-stm-opentx-reta-inv-v$MULTI_VERSION.bin;
printf "\n\e[33;1mBuilding multi-stm-opentx-aetr-noinv-v$MULTI_VERSION.bin\e[0m";
opt_replace RETA AETR;
opt_disable INVERT_TELEMETRY;
buildMulti;
mv build/Multiprotocol.ino.bin ./binaries/multi-stm-opentx-aetr-noinv-v$MULTI_VERSION.bin;
printf "\n\e[33;1mBuilding multi-stm-opentx-taer-noinv-v$MULTI_VERSION.bin\e[0m";
opt_replace AETR TAER;
buildMulti;
mv build/Multiprotocol.ino.bin ./binaries/multi-stm-opentx-taer-noinv-v$MULTI_VERSION.bin;
printf "\n\e[33;1mBuilding multi-stm-opentx-reta-noinv-v$MULTI_VERSION.bin\e[0m";
opt_replace TAER RETA;
buildMulti;
mv build/Multiprotocol.ino.bin ./binaries/multi-stm-opentx-reta-noinv-v$MULTI_VERSION.bin;
printf "\n\e[33;1mBuilding multi-stm-ppm-aetr-noinv-v$MULTI_VERSION.bin\e[0m";
opt_replace RETA AETR;
opt_disable MULTI_STATUS;
opt_disable MULTI_TELEMETRY;
opt_set NBR_BANKS 5;
buildMulti;
mv build/Multiprotocol.ino.bin ./binaries/multi-stm-ppm-aetr-noinv-v$MULTI_VERSION.bin;
printf "\n\e[33;1mBuilding multi-stm-ppm-taer-noinv-v$MULTI_VERSION.bin\e[0m";
opt_replace AETR TAER;
buildMulti;
mv build/Multiprotocol.ino.bin ./binaries/multi-stm-ppm-taer-noinv-v$MULTI_VERSION.bin;
printf "\n\e[33;1mBuilding multi-stm-ppm-reta-noinv-v$MULTI_VERSION.bin\e[0m";
opt_replace TAER RETA;
buildMulti;
mv build/Multiprotocol.ino.bin ./binaries/multi-stm-ppm-reta-noinv-v$MULTI_VERSION.bin; };
elif [[ "$BOARD" == "multi4in1:STM32F1:multistm32f103c:debug_option=native" ]]; then
buildReleaseFiles(){
printf "\n\e[33;1mBuilding multi-stm-erskytx-xn297dump-inv-usbdebug-v$MULTI_VERSION.bin\e[0m";
opt_enable CHECK_FOR_BOOTLOADER;
opt_disable $ALL_PROTOCOLS;
opt_add XN297DUMP_NRF24L01_INO;
opt_enable MULTI_STATUS;
opt_disable MULTI_TELEMETRY;
opt_enable INVERT_TELEMETRY;
buildMulti;
mv build/Multiprotocol.ino.bin ./binaries/multi-stm-erskytx-xn297dump-inv-usbdebug-v$MULTI_VERSION.bin;
printf "\n\e[33;1mBuilding multi-stm-opentx-xn297dump-inv-usbdebug-v$MULTI_VERSION.bin\e[0m";
opt_disable $ALL_PROTOCOLS;
opt_disable MULTI_STATUS;
opt_enable MULTI_TELEMETRY;
opt_enable INVERT_TELEMETRY;
buildMulti;
mv build/Multiprotocol.ino.bin ./binaries/multi-stm-opentx-xn297dump-inv-usbdebug-v$MULTI_VERSION.bin; };
elif [[ "$BOARD" == "multi4in1:STM32F1:multistm32f103c:debug_option=ftdi" ]]; then
buildReleaseFiles(){
printf "\n\e[33;1mBuilding multi-stm-erskytx-xn297dump-inv-ftdidebug-v$MULTI_VERSION.bin\e[0m";
opt_enable CHECK_FOR_BOOTLOADER;
opt_disable $ALL_PROTOCOLS;
opt_add XN297DUMP_NRF24L01_INO;
opt_enable MULTI_STATUS;
opt_disable MULTI_TELEMETRY;
opt_enable INVERT_TELEMETRY;
buildMulti;
mv build/Multiprotocol.ino.bin ./binaries/multi-stm-erskytx-xn297dump-inv-ftdidebug-v$MULTI_VERSION.bin;
printf "\n\e[33;1mBuilding multi-stm-opentx-xn297dump-inv-ftdidebug-v$MULTI_VERSION.bin\e[0m";
opt_disable $ALL_PROTOCOLS;
opt_disable MULTI_STATUS;
opt_enable MULTI_TELEMETRY;
opt_enable INVERT_TELEMETRY;
buildMulti;
mv build/Multiprotocol.ino.bin ./binaries/multi-stm-opentx-xn297dump-inv-ftdidebug-v$MULTI_VERSION.bin;
printf "\n\e[33;1mBuilding multi-stm-erskytx-aetr-inv-ftdidebug-v$MULTI_VERSION.bin\e[0m";
opt_enable $ALL_PROTOCOLS;
opt_enable MULTI_STATUS;
opt_disable MULTI_TELEMETRY;
buildMulti;
mv build/Multiprotocol.ino.bin ./binaries/multi-stm-erskytx-aetr-inv-ftdidebug-v$MULTI_VERSION.bin;
printf "\n\e[33;1mBuilding multi-stm-opentx-aetr-inv-ftdidebug-v$MULTI_VERSION.bin\e[0m";
opt_disable MULTI_STATUS;
opt_enable MULTI_TELEMETRY;
buildMulti;
mv build/Multiprotocol.ino.bin ./binaries/multi-stm-opentx-aetr-inv-ftdidebug-v$MULTI_VERSION.bin; };
else
buildReleaseFiles() { echo "No release files for this board."; };
fi
install:
# Install Arduino IDE
- wget http://downloads.arduino.cc/arduino-$IDE_VERSION-linux64.tar.xz
- tar xf arduino-$IDE_VERSION-linux64.tar.xz
- mv arduino-$IDE_VERSION $HOME/arduino-ide
- export PATH=$PATH:$HOME/arduino-ide
# Set the Multi boards package URL
- arduino --pref "boardsmanager.additional.urls=https://raw.githubusercontent.com/pascallanger/DIY-Multiprotocol-TX-Module-Boards/master/package_multi_4in1_board_index.json" --save-prefs
# Install the STM32 board if needed
- if [[ "$BOARD" =~ "multi4in1:STM32F1:" ]]; then
arduino --install-boards multi4in1:STM32F1;
fi
# Install the AVR board if needed
- if [[ "$BOARD" =~ "multi4in1:avr:" ]]; then
arduino --install-boards multi4in1:avr;
fi
before_script:
#
# Change current working directory to the build dir
- cd ${TRAVIS_BUILD_DIR}
# Create somwhere to put the exported binaries
- mkdir ./binaries
# Log the initial Multi config
- cat Multiprotocol/_Config.h
# Back up the configuration
- cp Multiprotocol/_Config.h ./_Config.h.bak
# Get the firmware version number from the source
- MAJOR_VERSION=$(grep "VERSION_MAJOR" "Multiprotocol/Multiprotocol.h" | awk -v N=3 '{gsub(/\r/,""); print $N}')
- MINOR_VERSION=$(grep "VERSION_MINOR" "Multiprotocol/Multiprotocol.h" | awk -v N=3 '{gsub(/\r/,""); print $N}')
- REVISION_VERSION=$(grep "VERSION_REVISION" "Multiprotocol//Multiprotocol.h" | awk -v N=3 '{gsub(/\r/,""); print $N}')
- PATCH_VERSION=$(grep "VERSION_PATCH" "Multiprotocol//Multiprotocol.h" | awk -v N=3 '{gsub(/\r/,""); print $N}')
- MULTI_VERSION=$MAJOR_VERSION.$MINOR_VERSION.$REVISION_VERSION.$PATCH_VERSION
# Derive the Multi protocols from the Multi source
- A7105_PROTOCOLS=$(sed -n 's/[\/\/]*[[:blank:]]*#define[[:blank:]]*\([[:alnum:]_]*_A7105_INO\)\(.*\)/\1/p' Multiprotocol/_Config.h)
- CC2500_PROTOCOLS=$(sed -n 's/[\/\/]*[[:blank:]]*#define[[:blank:]]*\([[:alnum:]_]*_CC2500_INO\)\(.*\)/\1/p' Multiprotocol/_Config.h)
@@ -74,204 +266,63 @@ before_script:
ALL_PROTOCOLS=$(echo $A7105_PROTOCOLS $CC2500_PROTOCOLS $CYRF6936_PROTOCOLS $NRF24L01_PROTOCOLS);
fi
- echo $ALL_PROTOCOLS
#
# Declare all the installed modules
- ALL_RFMODULES=$(echo A7105_INSTALLED CYRF6936_INSTALLED CC2500_INSTALLED NRF24L01_INSTALLED);
# Disable CHECK_FOR_BOOTLOADER when not needed
- if [[ "$BOARD" == "multi4in1:avr:multiatmega328p:bootloader=none" ]]; then
opt_disable CHECK_FOR_BOOTLOADER;
fi
#
# Trim the build down for the Atmega328p board
# Trim the enabled protocols down for the STM32 board with USB debugging
- if [[ "$BOARD" == "multi4in1:STM32F1:multistm32f103c:debug_option=native" ]]; then
opt_disable AFHDS2A_RX_A7105_INO FRSKY_RX_CC2500_INO SCANNER_CC2500_INO WK2x01_CYRF6936_INO HUBSAN_A7105_INO;
fi
# Trim the enabled protocols down for the Atmega328p board
- if [[ "$BOARD" =~ "multi4in1:avr:multiatmega328p:" ]]; then
opt_disable $ALL_PROTOCOLS;
opt_enable FRSKYX_CC2500_INO AFHDS2A_A7105_INO MJXQ_NRF24L01_INO DSM_CYRF6936_INO;
fi
#
# Useful Travis functions
- export -f travis_fold
- export -f travis_nanoseconds
- export -f travis_time_start
- export -f travis_time_finish
- start_fold() { echo -e "travis_fold:start:$1"; }
- end_fold() { echo -e "\ntravis_fold:end:$1\r"; }
script:
# Build with all protocols enabled for STM32; a subset of protocols for Atmega
- buildMulti
#
# Build with default configuration - all protocols are enabled for STM32; a subset of protocols for Atmega
- buildDefault
# Serial only
- opt_disable ENABLE_PPM
- opt_enable ENABLE_SERIAL
- buildMulti
#
- buildSerialOnly
# PPM only
- opt_enable ENABLE_PPM
- opt_disable ENABLE_SERIAL
- buildMulti
#
- buildPPMOnly
# Re-enable PPM and serial
- opt_enable ENABLE_SERIAL
- opt_enable ENABLE_PPM
#
# Build each protocol individually
- buildEachProtocol
before_deploy:
# Create somwhere to put the binaries
- mkdir ./binaries
# Build for each RF module individually
- buildEachRFModule
# Restore the default configuration
- cp ./_Config.h.bak Multiprotocol/_Config.h
# Build the release files for OrangeRX
- if [[ "$BOARD" == "multi4in1:avr:multixmega32d4" ]]; then
printf "\n\e[33;1mBuilding multi-orangerx-aetr-green-inv-$TRAVIS_TAG.bin\e[0m";
opt_enable $ALL_PROTOCOLS;
opt_disable ORANGE_TX_BLUE;
buildMulti;
mv build/Multiprotocol.ino.bin ./binaries/multi-orangerx-aetr-green-inv-$TRAVIS_TAG.bin;
printf "\n\e[33;1mBuilding multi-orangerx-aetr-blue-inv-$TRAVIS_TAG.bin\e[0m";
opt_enable ORANGE_TX_BLUE;
buildMulti;
mv build/Multiprotocol.ino.bin ./binaries/multi-orangerx-aetr-blue-inv-$TRAVIS_TAG.bin;
cp Multiprotocol/Multi.txt ./binaries/Multi.txt;
fi
# Build the release files for AVR without bootloader
- if [[ "$BOARD" == "multi4in1:avr:multiatmega328p:bootloader=none" ]]; then
printf "\n\e[33;1mBuilding multi-avr-usbasp-aetr-A7105-inv-$TRAVIS_TAG.bin\e[0m";
opt_disable CHECK_FOR_BOOTLOADER;
opt_disable $ALL_PROTOCOLS;
opt_enable $A7105_PROTOCOLS;
buildMulti;
mv build/Multiprotocol.ino.bin ./binaries/multi-avr-usbasp-aetr-A7105-inv-$TRAVIS_TAG.bin;
printf "\n\e[33;1mBuilding multi-avr-usbasp-aetr-CC2500-inv-$TRAVIS_TAG.bin\e[0m";
opt_disable $ALL_PROTOCOLS;
opt_enable $CC2500_PROTOCOLS;
buildMulti;
mv build/Multiprotocol.ino.bin ./binaries/multi-avr-usbasp-aetr-CC2500-inv-$TRAVIS_TAG.bin;
printf "\n\e[33;1mBuilding multi-avr-usbasp-aetr-CYRF6936-inv-$TRAVIS_TAG.bin\e[0m";
opt_disable $ALL_PROTOCOLS;
opt_enable $CYRF6936_PROTOCOLS;
buildMulti;
mv build/Multiprotocol.ino.bin ./binaries/multi-avr-usbasp-aetr-CYRF6936-inv-$TRAVIS_TAG.bin;
fi
# Build the release files for AVR with bootloader
- if [[ "$BOARD" == "multi4in1:avr:multiatmega328p:bootloader=optiboot" ]]; then
printf "\n\e[33;1mBuilding multi-avr-txflash-aetr-A7105-inv-$TRAVIS_TAG.bin\e[0m";
opt_enable CHECK_FOR_BOOTLOADER;
opt_disable $ALL_PROTOCOLS;
opt_enable $A7105_PROTOCOLS;
buildMulti;
mv build/Multiprotocol.ino.bin ./binaries/multi-avr-txflash-aetr-A7105-inv-$TRAVIS_TAG.bin;
printf "\n\e[33;1mBuilding multi-avr-txflash-aetr-CC2500-inv-$TRAVIS_TAG.bin\e[0m";
opt_disable $ALL_PROTOCOLS;
opt_enable $CC2500_PROTOCOLS;
buildMulti;
mv build/Multiprotocol.ino.bin ./binaries/multi-avr-txflash-aetr-CC2500-inv-$TRAVIS_TAG.bin;
printf "\n\e[33;1mBuilding multi-avr-txflash-aetr-CYRF6936-inv-$TRAVIS_TAG.bin\e[0m";
opt_disable $ALL_PROTOCOLS;
opt_enable $CYRF6936_PROTOCOLS;
buildMulti;
mv build/Multiprotocol.ino.bin ./binaries/multi-avr-txflash-aetr-CYRF6936-inv-$TRAVIS_TAG.bin;
fi
# Build the release files for STM32 without debug
- if [[ "$BOARD" == "multi4in1:STM32F1:multistm32f103c:debug_option=none" ]]; then
printf "\n\e[33;1mBuilding multi-stm-erskytx-aetr-inv-$TRAVIS_TAG.bin\e[0m";
opt_enable CHECK_FOR_BOOTLOADER;
opt_enable $ALL_PROTOCOLS;
opt_enable MULTI_STATUS;
opt_disable MULTI_TELEMETRY;
buildMulti;
mv build/Multiprotocol.ino.bin ./binaries/multi-stm-erskytx-aetr-inv-$TRAVIS_TAG.bin;
printf "\n\e[33;1mBuilding multi-stm-erskytx-taer-inv-$TRAVIS_TAG.bin\e[0m";
opt_replace AETR TAER;
buildMulti;
mv build/Multiprotocol.ino.bin ./binaries/multi-stm-erskytx-taer-inv-$TRAVIS_TAG.bin;
printf "\n\e[33;1mBuilding multi-stm-erskytx-reta-inv-$TRAVIS_TAG.bin\e[0m";
opt_replace TAER RETA;
buildMulti;
mv build/Multiprotocol.ino.bin ./binaries/multi-stm-erskytx-reta-inv-$TRAVIS_TAG.bin;
printf "\n\e[33;1mBuilding multi-stm-erskytx-aetr-noinv-$TRAVIS_TAG.bin\e[0m";
opt_replace RETA AETR;
opt_disable INVERT_TELEMETRY;
buildMulti;
mv build/Multiprotocol.ino.bin ./binaries/multi-stm-erskytx-aetr-noinv-$TRAVIS_TAG.bin;
printf "\n\e[33;1mBuilding multi-stm-erskytx-taer-noinv-$TRAVIS_TAG.bin\e[0m";
opt_replace AETR TAER;
buildMulti;
mv build/Multiprotocol.ino.bin ./binaries/multi-stm-erskytx-taer-noinv-$TRAVIS_TAG.bin;
printf "\n\e[33;1mBuilding multi-stm-erskytx-reta-noinv-$TRAVIS_TAG.bin\e[0m";
opt_replace TAER RETA;
buildMulti;
mv build/Multiprotocol.ino.bin ./binaries/multi-stm-erskytx-reta-noinv-$TRAVIS_TAG.bin;
printf "\n\e[33;1mBuilding multi-stm-opentx-aetr-inv-$TRAVIS_TAG.bin\e[0m";
opt_replace RETA AETR;
opt_disable MULTI_STATUS;
opt_enable MULTI_TELEMETRY;
opt_enable INVERT_TELEMETRY;
buildMulti;
mv build/Multiprotocol.ino.bin ./binaries/multi-stm-opentx-aetr-inv-$TRAVIS_TAG.bin;
printf "\n\e[33;1mBuilding multi-stm-opentx-taer-inv-$TRAVIS_TAG.bin\e[0m";
opt_replace AETR TAER;
buildMulti;
mv build/Multiprotocol.ino.bin ./binaries/multi-stm-opentx-taer-inv-$TRAVIS_TAG.bin;
printf "\n\e[33;1mBuilding multi-stm-opentx-reta-inv-$TRAVIS_TAG.bin\e[0m";
opt_replace TAER RETA;
buildMulti;
mv build/Multiprotocol.ino.bin ./binaries/multi-stm-opentx-reta-inv-$TRAVIS_TAG.bin;
printf "\n\e[33;1mBuilding multi-stm-opentx-aetr-noinv-$TRAVIS_TAG.bin\e[0m";
opt_replace RETA AETR;
opt_disable INVERT_TELEMETRY;
buildMulti;
mv build/Multiprotocol.ino.bin ./binaries/multi-stm-opentx-aetr-noinv-$TRAVIS_TAG.bin;
printf "\n\e[33;1mBuilding multi-stm-opentx-taer-noinv-$TRAVIS_TAG.bin\e[0m";
opt_replace AETR TAER;
buildMulti;
mv build/Multiprotocol.ino.bin ./binaries/multi-stm-opentx-taer-noinv-$TRAVIS_TAG.bin;
printf "\n\e[33;1mBuilding multi-stm-opentx-reta-noinv-$TRAVIS_TAG.bin\e[0m";
opt_replace TAER RETA;
buildMulti;
mv build/Multiprotocol.ino.bin ./binaries/multi-stm-opentx-reta-noinv-$TRAVIS_TAG.bin;
printf "\n\e[33;1mBuilding multi-stm-ppm-aetr-noinv-$TRAVIS_TAG.bin\e[0m";
opt_replace RETA AETR;
opt_disable MULTI_STATUS;
opt_disable MULTI_TELEMETRY;
opt_set NBR_BANKS 5;
buildMulti;
mv build/Multiprotocol.ino.bin ./binaries/multi-stm-ppm-aetr-noinv-$TRAVIS_TAG.bin;
printf "\n\e[33;1mBuilding multi-stm-ppm-taer-noinv-$TRAVIS_TAG.bin\e[0m";
opt_replace AETR TAER;
buildMulti;
mv build/Multiprotocol.ino.bin ./binaries/multi-stm-ppm-taer-noinv-$TRAVIS_TAG.bin;
printf "\n\e[33;1mBuilding multi-stm-ppm-reta-noinv-$TRAVIS_TAG.bin\e[0m";
opt_replace TAER RETA;
buildMulti;
mv build/Multiprotocol.ino.bin ./binaries/multi-stm-ppm-reta-noinv-$TRAVIS_TAG.bin;
fi
# Build the release files for STM32 with Native USB debugging
- if [[ "$BOARD" == "multi4in1:STM32F1:multistm32f103c:debug_option=native" ]]; then
printf "\n\e[33;1mBuilding multi-stm-erskytx-aetr-inv-usbdebug-$TRAVIS_TAG.bin\e[0m";
opt_enable CHECK_FOR_BOOTLOADER;
opt_enable $ALL_PROTOCOLS;
opt_enable MULTI_STATUS;
opt_disable MULTI_TELEMETRY;
buildMulti;
mv build/Multiprotocol.ino.bin ./binaries/multi-stm-erskytx-aetr-inv-usbdebug-$TRAVIS_TAG.bin;
printf "\n\e[33;1mBuilding multi-stm-opentx-aetr-inv-usbdebug-$TRAVIS_TAG.bin\e[0m";
opt_disable MULTI_STATUS;
opt_enable MULTI_TELEMETRY;
buildMulti;
mv build/Multiprotocol.ino.bin ./binaries/multi-stm-opentx-aetr-inv-usbdebug-$TRAVIS_TAG.bin;
fi
# Build the release files for STM32 with FTDI USB debugging
- if [[ "$BOARD" == "multi4in1:STM32F1:multistm32f103c:debug_option=ftdi" ]]; then
printf "\n\e[33;1mBuilding multi-stm-erskytx-aetr-inv-ftdidebug-$TRAVIS_TAG.bin\e[0m";
opt_enable CHECK_FOR_BOOTLOADER;
opt_enable $ALL_PROTOCOLS;
opt_enable MULTI_STATUS;
opt_disable MULTI_TELEMETRY;
buildMulti;
mv build/Multiprotocol.ino.bin ./binaries/multi-stm-erskytx-aetr-inv-ftdidebug-$TRAVIS_TAG.bin;
printf "\n\e[33;1mBuilding multi-stm-opentx-aetr-inv-ftdidebug-$TRAVIS_TAG.bin\e[0m";
opt_disable MULTI_STATUS;
opt_enable MULTI_TELEMETRY;
buildMulti;
mv build/Multiprotocol.ino.bin ./binaries/multi-stm-opentx-aetr-inv-ftdidebug-$TRAVIS_TAG.bin;
fi
# Build each protocol individually
- buildEachProtocol
# Restore the default configuration
- cp ./_Config.h.bak Multiprotocol/_Config.h
# Builds the files for a release - always built, but only copied to Github if the test is tagged as a release
- buildReleaseFiles
deploy:
provider: releases
api_key:

View File

@@ -0,0 +1,207 @@
/*
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 <http://www.gnu.org/licenses/>.
*/
#if defined(BAYANG_RX_NRF24L01_INO)
#include "iface_nrf24l01.h"
#define BAYANG_RX_PACKET_SIZE 15
#define BAYANG_RX_RF_NUM_CHANNELS 4
#define BAYANG_RX_RF_BIND_CHANNEL 0
#define BAYANG_RX_ADDRESS_LENGTH 5
enum {
BAYANG_RX_BIND = 0,
BAYANG_RX_DATA
};
static void __attribute__((unused)) Bayang_Rx_init_nrf24l01()
{
const uint8_t bind_address[BAYANG_RX_ADDRESS_LENGTH] = { 0,0,0,0,0 };
NRF24L01_Initialize();
XN297_SetTXAddr(bind_address, BAYANG_RX_ADDRESS_LENGTH);
XN297_SetRXAddr(bind_address, BAYANG_RX_ADDRESS_LENGTH);
NRF24L01_FlushRx();
NRF24L01_WriteReg(NRF24L01_07_STATUS, 0x70); // Clear data ready, data sent, and retransmit
NRF24L01_WriteReg(NRF24L01_01_EN_AA, 0x00); // No Auto Acknowldgement on all data pipes
NRF24L01_WriteReg(NRF24L01_02_EN_RXADDR, 0x01); // Enable data pipe 0 only
NRF24L01_WriteReg(NRF24L01_11_RX_PW_P0, BAYANG_RX_PACKET_SIZE + 2); // 2 extra bytes for xn297 crc
NRF24L01_WriteReg(NRF24L01_05_RF_CH, BAYANG_RX_RF_BIND_CHANNEL);
NRF24L01_SetBitrate(NRF24L01_BR_1M); // 1Mbps
NRF24L01_SetPower();
NRF24L01_Activate(0x73); // Activate feature register
NRF24L01_WriteReg(NRF24L01_1C_DYNPD, 0x00); // Disable dynamic payload length on all pipes
NRF24L01_WriteReg(NRF24L01_1D_FEATURE, 0x01);
NRF24L01_Activate(0x73);
NRF24L01_SetTxRxMode(TXRX_OFF);
NRF24L01_FlushRx();
NRF24L01_SetTxRxMode(RX_EN);
XN297_Configure(_BV(NRF24L01_00_EN_CRC) | _BV(NRF24L01_00_CRCO) | _BV(NRF24L01_00_PWR_UP) | _BV(NRF24L01_00_PRIM_RX));
}
static uint8_t __attribute__((unused)) Bayang_Rx_check_validity() {
uint8_t sum = packet[0];
for (uint8_t i = 1; i < BAYANG_RX_PACKET_SIZE - 1; i++)
sum += packet[i];
return sum == packet[14];
}
static void __attribute__((unused)) Bayang_Rx_build_telemetry_packet()
{
uint32_t bits = 0;
uint8_t bitsavailable = 0;
uint8_t idx = 0;
packet_in[idx++] = RX_LQI;
packet_in[idx++] = RX_LQI>>1; // no RSSI: 125..0
packet_in[idx++] = 0; // start channel
packet_in[idx++] = 10; // number of channels in packet
// convert & pack channels
for (uint8_t i = 0; i < packet_in[3]; i++) {
uint32_t val = CHANNEL_MIN_100;
if (i < 4) {
// AETR
//val = (((packet[4 + i * 2] & ~0x7C) << 8) | packet[5 + i * 2]) << 1;
val=packet[4 + i * 2]&0x03;
val=(val<<8)+packet[5 + i * 2];
val=((val+128)<<3)/5;
} else if (i == 4 || i == 5) {
val=packet[i==4?1:13];
val=((val+32)<<5)/5; // extra analog channel
} else if (((i == 6) && (packet[2] & 0x08)) || // flip
((i == 7) && (packet[2] & 0x01)) || // rth
((i == 8) && (packet[2] & 0x20)) || // picture
((i == 9) && (packet[2] & 0x10))) { // video
// set channel to 100% if feature is enabled
val = CHANNEL_MAX_100;
}
bits |= val << bitsavailable;
bitsavailable += 11;
while (bitsavailable >= 8) {
packet_in[idx++] = bits & 0xff;
bits >>= 8;
bitsavailable -= 8;
}
}
}
uint16_t initBayang_Rx()
{
uint8_t i;
Bayang_Rx_init_nrf24l01();
hopping_frequency_no = 0;
rx_data_started = false;
rx_data_received = false;
if (IS_BIND_IN_PROGRESS) {
phase = BAYANG_RX_BIND;
}
else {
uint16_t temp = BAYANG_RX_EEPROM_OFFSET;
for (i = 0; i < 5; i++)
rx_tx_addr[i] = eeprom_read_byte((EE_ADDR)temp++);
for (i = 0; i < BAYANG_RX_RF_NUM_CHANNELS; i++)
hopping_frequency[i] = eeprom_read_byte((EE_ADDR)temp++);
XN297_SetTXAddr(rx_tx_addr, BAYANG_RX_ADDRESS_LENGTH);
XN297_SetRXAddr(rx_tx_addr, BAYANG_RX_ADDRESS_LENGTH);
phase = BAYANG_RX_DATA;
}
return 1000;
}
uint16_t Bayang_Rx_callback()
{
uint8_t i;
static int8_t read_retry;
static uint16_t pps_counter;
static uint32_t pps_timer = 0;
switch (phase) {
case BAYANG_RX_BIND:
if (NRF24L01_ReadReg(NRF24L01_07_STATUS) & _BV(NRF24L01_07_RX_DR)) {
// data received from TX
if (XN297_ReadPayload(packet, BAYANG_RX_PACKET_SIZE) && ( packet[0] == 0xA4 || packet[0] == 0xA2 ) && Bayang_Rx_check_validity()) {
// store tx info into eeprom
uint16_t temp = BAYANG_RX_EEPROM_OFFSET;
for (i = 0; i < 5; i++) {
rx_tx_addr[i] = packet[i + 1];
eeprom_write_byte((EE_ADDR)temp++, rx_tx_addr[i]);
}
for (i = 0; i < 4; i++) {
hopping_frequency[i] = packet[i + 6];
eeprom_write_byte((EE_ADDR)temp++, hopping_frequency[i]);
}
XN297_SetTXAddr(rx_tx_addr, BAYANG_RX_ADDRESS_LENGTH);
XN297_SetRXAddr(rx_tx_addr, BAYANG_RX_ADDRESS_LENGTH);
BIND_DONE;
phase = BAYANG_RX_DATA;
}
NRF24L01_FlushRx();
NRF24L01_WriteReg(NRF24L01_07_STATUS, 0x70);
}
break;
case BAYANG_RX_DATA:
if (NRF24L01_ReadReg(NRF24L01_07_STATUS) & _BV(NRF24L01_07_RX_DR)) {
if (XN297_ReadPayload(packet, BAYANG_RX_PACKET_SIZE) && packet[0] == 0xA5 && Bayang_Rx_check_validity()) {
if (telemetry_link == 0) {
Bayang_Rx_build_telemetry_packet();
telemetry_link = 1;
}
rx_data_started = true;
rx_data_received = true;
read_retry = 8;
pps_counter++;
}
}
// packets per second
if (millis() - pps_timer >= 1000) {
pps_timer = millis();
debugln("%d pps", pps_counter);
RX_LQI = pps_counter >> 1;
pps_counter = 0;
}
// frequency hopping
if (read_retry++ >= 8) {
hopping_frequency_no++;
if (hopping_frequency_no >= BAYANG_RX_RF_NUM_CHANNELS)
hopping_frequency_no = 0;
NRF24L01_WriteReg(NRF24L01_05_RF_CH, hopping_frequency[hopping_frequency_no]);
NRF24L01_FlushRx();
NRF24L01_WriteReg(NRF24L01_07_STATUS, 0x70);
if (rx_data_started)
{
if(rx_data_received)
{ // In sync
rx_data_received = false;
read_retry = 5;
return 1500;
}
else
{ // packet lost
read_retry = 0;
if(RX_LQI==0) // communication lost
rx_data_started=false;
}
}
else
read_retry = -16; // retry longer until first packet is caught
}
return 250;
}
return 1000;
}
#endif

View File

@@ -380,7 +380,7 @@ uint16_t ReadDsm()
{
#define DSM_CH1_CH2_DELAY 4010 // Time between write of channel 1 and channel 2
#ifdef STM32_BOARD
#define DSM_WRITE_DELAY 1500 // Time after write to verify write complete
#define DSM_WRITE_DELAY 1600 // Time after write to verify write complete
#else
#define DSM_WRITE_DELAY 1950 // Time after write to verify write complete
#endif

View File

@@ -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);

View File

@@ -0,0 +1,113 @@
/*
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 <http://www.gnu.org/licenses/>.
*/
// Compatible with FEI XIONG P38 plane.
#if defined(FX816_NRF24L01_INO)
#include "iface_nrf24l01.h"
#define FX816_INITIAL_WAIT 500
#define FX816_PACKET_PERIOD 10000
#define FX816_RF_BIND_CHANNEL 0x28 //40
#define FX816_RF_NUM_CHANNELS 4
#define FX816_PAYLOAD_SIZE 6
#define FX816_BIND_COUNT 300 //3sec
static void __attribute__((unused)) FX816_send_packet()
{
packet[0] = IS_BIND_IN_PROGRESS?0x55:0xAA;
packet[1] = rx_tx_addr[0];
packet[2] = rx_tx_addr[1];
uint8_t val=convert_channel_8b(AILERON);
#define FX816_SWITCH 20
if(val>127+FX816_SWITCH)
packet[3] = 1;
else if(val<127-FX816_SWITCH)
packet[3] = 2;
else
packet[3] = 0;
packet[4] = convert_channel_16b_limit(THROTTLE,0,100);
val=0;
for(uint8_t i=0;i<FX816_PAYLOAD_SIZE-1;i++)
val+=packet[i];
packet[5]=val;
NRF24L01_WriteReg(NRF24L01_05_RF_CH, IS_BIND_IN_PROGRESS ? FX816_RF_BIND_CHANNEL:hopping_frequency[hopping_frequency_no++]);
hopping_frequency_no%=FX816_RF_NUM_CHANNELS;
// clear packet status bits and TX FIFO
NRF24L01_WriteReg(NRF24L01_07_STATUS, 0x70);
NRF24L01_FlushTx();
XN297_WritePayload(packet, FX816_PAYLOAD_SIZE);
// Power on, TX mode, 2byte CRC
XN297_Configure(_BV(NRF24L01_00_EN_CRC) | _BV(NRF24L01_00_CRCO) | _BV(NRF24L01_00_PWR_UP));
NRF24L01_SetPower(); // Set tx_power
}
static void __attribute__((unused)) FX816_init()
{
NRF24L01_Initialize();
NRF24L01_SetTxRxMode(TX_EN);
XN297_SetTXAddr((uint8_t *)"\xcc\xcc\xcc\xcc\xcc", 5);
NRF24L01_FlushTx();
NRF24L01_FlushRx();
NRF24L01_WriteReg(NRF24L01_07_STATUS, 0x70); // Clear data ready, data sent, and retransmit
NRF24L01_WriteReg(NRF24L01_01_EN_AA, 0x00); // No Auto Acknowldgement on all data pipes
NRF24L01_WriteReg(NRF24L01_02_EN_RXADDR, 0x01); // Enable data pipe 0 only
NRF24L01_SetBitrate(NRF24L01_BR_1M); // 1Mbps
NRF24L01_WriteReg(NRF24L01_04_SETUP_RETR, 0x00); // No retransmits
NRF24L01_SetPower();
NRF24L01_Activate(0x73); // Activate feature register
NRF24L01_WriteReg(NRF24L01_1C_DYNPD, 0x00); // Disable dynamic payload length on all pipes
NRF24L01_WriteReg(NRF24L01_1D_FEATURE, 0x01);
NRF24L01_Activate(0x73);
}
static void __attribute__((unused)) FX816_initialize_txid()
{
//Only 8 IDs: the RX led does not indicate frame loss.
//I didn't open the plane to find out if I could connect there so this is the best I came up with with few trial and errors...
rx_tx_addr[0]=0x35+(rx_tx_addr[3]&0x07); //Original dump=0x35
rx_tx_addr[1]=0x09; //Original dump=0x09
memcpy(hopping_frequency,"\x09\x1B\x30\x42",FX816_RF_NUM_CHANNELS); //Original dump=9=0x09,27=0x1B,48=0x30,66=0x42
for(uint8_t i=0;i<FX816_RF_NUM_CHANNELS;i++)
hopping_frequency[i]+=rx_tx_addr[3]&0x07;
}
uint16_t FX816_callback()
{
#ifdef MULTI_SYNC
telemetry_set_input_sync(FX816_PACKET_PERIOD);
#endif
if(IS_BIND_IN_PROGRESS)
if(--bind_counter==0)
BIND_DONE;
FX816_send_packet();
return FX816_PACKET_PERIOD;
}
uint16_t initFX816()
{
BIND_IN_PROGRESS; // autobind protocol
FX816_initialize_txid();
FX816_init();
hopping_frequency_no = 0;
bind_counter=FX816_BIND_COUNT;
return FX816_INITIAL_WAIT;
}
#endif

View File

@@ -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
@@ -55,4 +55,5 @@
55,Frsky_RX
56,AFHDS2A_RX
57,HoTT
58,FX816,P38
63,XN_DUMP,250K,1M,2M

View File

@@ -71,6 +71,8 @@ const char STR_SCANNER[] ="Scanner";
const char STR_FRSKY_RX[] ="FrSkyRX";
const char STR_AFHDS2A_RX[] ="FS2A_RX";
const char STR_HOTT[] ="HoTT";
const char STR_FX816[] ="FX816";
const char STR_BAYANG_RX[] ="BayanRX";
const char STR_XN297DUMP[] ="XN297DP";
const char STR_SUBTYPE_FLYSKY[] = "\x04""Std\0""V9x9""V6x6""V912""CX20";
@@ -107,7 +109,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_XN297DUMP[] = "\x07""250Kbps""1Mbps\0 ""2Mbps\0 ";
const char STR_SUBTYPE_ESKY150[] = "\x03""4CH""7CH";
enum
{
@@ -226,7 +230,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 },
@@ -259,7 +263,7 @@ const mm_protocol_definition multi_protocols[] = {
{PROTO_E01X, STR_E01X, 3, STR_SUBTYPE_E01X, OPTION_OPTION },
#endif
#if defined(V911S_NRF24L01_INO)
{PROTO_V911S, STR_V911S, 0, NO_SUBTYPE, OPTION_RFTUNE },
{PROTO_V911S, STR_V911S, 0, NO_SUBTYPE, OPTION_NONE },
#endif
#if defined(GD00X_NRF24L01_INO)
{PROTO_GD00X, STR_GD00X, 2, STR_SUBTYPE_GD00X, OPTION_RFTUNE },
@@ -294,6 +298,12 @@ const mm_protocol_definition multi_protocols[] = {
#if defined(HOTT_CC2500_INO)
{PROTO_HOTT, STR_HOTT, 0, NO_SUBTYPE, OPTION_RFTUNE },
#endif
#if defined(FX816_NRF24L01_INO)
{PROTO_FX816, STR_FX816, 1, STR_SUBTYPE_FX816, OPTION_NONE },
#endif
#if defined(BAYANG_RX_NRF24L01_INO)
{PROTO_BAYANG_RX, STR_BAYANG_RX, 0, NO_SUBTYPE, OPTION_NONE },
#endif
#if defined(XN297DUMP_NRF24L01_INO)
{PROTO_XN297DUMP, STR_XN297DUMP, 3, STR_SUBTYPE_XN297DUMP, OPTION_RFCHAN },
#endif

View File

@@ -19,7 +19,7 @@
#define VERSION_MAJOR 1
#define VERSION_MINOR 3
#define VERSION_REVISION 0
#define VERSION_PATCH_LEVEL 44
#define VERSION_PATCH_LEVEL 47
//******************
// Protocols
@@ -84,6 +84,8 @@ enum PROTOCOLS
PROTO_FRSKY_RX = 55, // =>CC2500
PROTO_AFHDS2A_RX= 56, // =>A7105
PROTO_HOTT = 57, // =>CC2500
PROTO_FX816 = 58, // =>NRF24L01
PROTO_BAYANG_RX = 59, // =>NRF24L01
PROTO_XN297DUMP = 63, // =>NRF24L01
};
@@ -291,6 +293,11 @@ enum TRAXXAS
{
RX6519 = 0,
};
enum ESKY150
{
ESKY150_4CH = 0,
ESKY150_7CH = 1,
};
#define NONE 0
#define P_HIGH 1
@@ -331,6 +338,12 @@ enum MultiPacketTypes
// Macros
#define NOP() __asm__ __volatile__("nop")
//***************
//*** Tests ***
//***************
#define IS_FAILSAFE_PROTOCOL ( (protocol==PROTO_HISKY && sub_protocol==HK310) || protocol==PROTO_AFHDS2A || protocol==PROTO_DEVO || protocol==PROTO_SFHSS || protocol==PROTO_WK2x01 || protocol== PROTO_HOTT || protocol==PROTO_FRSKYX )
#define IS_CHMAP_PROTOCOL ( (protocol==PROTO_HISKY && sub_protocol==HK310) || protocol==PROTO_AFHDS2A || protocol==PROTO_DEVO || protocol==PROTO_SFHSS || protocol==PROTO_WK2x01 || protocol== PROTO_DSM || protocol==PROTO_SLT || protocol==PROTO_FLYSKY || protocol==PROTO_ESKY || protocol==PROTO_J6PRO )
//***************
//*** Flags ***
//***************
@@ -595,7 +608,8 @@ enum {
#define AFHDS2A_RX_EEPROM_OFFSET 230 // (4) TX ID + (16) channels, 20 bytes, end is 230+20=250
#define AFHDS2A_EEPROM_OFFSET2 250 // RX ID, 4 bytes per model id, end is 250+192=442
#define HOTT_EEPROM_OFFSET 442 // RX ID, 5 bytes per model id, end is 320+442=762
//#define CONFIG_EEPROM_OFFSET 762 // Current configuration of the multimodule
#define BAYANG_RX_EEPROM_OFFSET 762 // (5) TX ID + (4) channels, 9 bytes, end is 771
//#define CONFIG_EEPROM_OFFSET 771 // Current configuration of the multimodule
//****************************************
//*** MULTI protocol serial definition ***
@@ -671,6 +685,8 @@ Serial: 100000 Baud 8e2 _ xxxx xxxx p --
FRSKY_RX 55
AFHDS2A_RX 56
HOTT 57
FX816 58
BAYANG_RX 59
BindBit=> 0x80 1=Bind/0=No
AutoBindBit=> 0x40 1=Yes /0=No
RangeCheck=> 0x20 1=Yes /0=No
@@ -812,6 +828,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;

View File

@@ -227,8 +227,9 @@ uint8_t packet_in[TELEMETRY_BUFFER_SIZE];//telemetry receiving packets
#endif
//RX protocols
#if defined(AFHDS2A_RX_A7105_INO) || defined(FRSKY_RX_CC2500_INO)
#if defined(AFHDS2A_RX_A7105_INO) || defined(FRSKY_RX_CC2500_INO) || defined(BAYANG_RX_NRF24L01_INO)
bool rx_data_started;
bool rx_data_received;
bool rx_disable_lna;
uint16_t rx_rc_chan[16];
#endif
@@ -699,7 +700,7 @@ bool Update_All()
update_led_status();
#if defined(TELEMETRY)
#if ( !( defined(MULTI_TELEMETRY) || defined(MULTI_STATUS) ) )
if( (protocol == PROTO_FRSKY_RX) || (protocol == PROTO_SCANNER) || (protocol==PROTO_FRSKYD) || (protocol==PROTO_BAYANG) || (protocol==PROTO_NCC1701) || (protocol==PROTO_BUGS) || (protocol==PROTO_BUGSMINI) || (protocol==PROTO_HUBSAN) || (protocol==PROTO_AFHDS2A) || (protocol==PROTO_FRSKYX) || (protocol==PROTO_DSM) || (protocol==PROTO_CABELL) || (protocol==PROTO_HITEC) || (protocol==PROTO_HOTT))
if((protocol == PROTO_BAYANG_RX) || (protocol == PROTO_AFHDS2A_RX) || (protocol == PROTO_FRSKY_RX) || (protocol == PROTO_SCANNER) || (protocol==PROTO_FRSKYD) || (protocol==PROTO_BAYANG) || (protocol==PROTO_NCC1701) || (protocol==PROTO_BUGS) || (protocol==PROTO_BUGSMINI) || (protocol==PROTO_HUBSAN) || (protocol==PROTO_AFHDS2A) || (protocol==PROTO_FRSKYX) || (protocol==PROTO_DSM) || (protocol==PROTO_CABELL) || (protocol==PROTO_HITEC) || (protocol==PROTO_HOTT))
#endif
if(IS_DISABLE_TELEM_off)
TelemetryUpdate();
@@ -991,7 +992,7 @@ static void protocol_init()
TX_RX_PAUSE_off;
TX_MAIN_PAUSE_off;
tx_resume();
#if defined(AFHDS2A_RX_A7105_INO) || defined(FRSKY_RX_CC2500_INO)
#if defined(AFHDS2A_RX_A7105_INO) || defined(FRSKY_RX_CC2500_INO) || defined(BAYANG_RX_NRF24L01_INO)
for(uint8_t ch=0; ch<16; ch++)
rx_rc_chan[ch] = 1024;
#endif
@@ -1415,6 +1416,18 @@ static void protocol_init()
remote_callback = ZSX_callback;
break;
#endif
#if defined(FX816_NRF24L01_INO)
case PROTO_FX816:
next_callback=initFX816();
remote_callback = FX816_callback;
break;
#endif
#if defined(BAYANG_RX_NRF24L01_INO)
case PROTO_BAYANG_RX:
next_callback=initBayang_Rx();
remote_callback = Bayang_Rx_callback;
break;
#endif
#if defined(XN297DUMP_NRF24L01_INO)
case PROTO_XN297DUMP:
next_callback=initXN297Dump();
@@ -1609,24 +1622,6 @@ void update_serial_data()
#endif
}
if(prev_ch_mapping!=IS_DISABLE_CH_MAP_on)
{
prev_ch_mapping=IS_DISABLE_CH_MAP_on;
if(IS_DISABLE_CH_MAP_on)
{
for(uint8_t i=0;i<4;i++)
CH_AETR[i]=CH_TAER[i]=CH_EATR[i]=i;
debugln("DISABLE_CH_MAP_on");
}
else
{
CH_AETR[0]=AILERON;CH_AETR[1]=ELEVATOR;CH_AETR[2]=THROTTLE;CH_AETR[3]=RUDDER;
CH_TAER[0]=THROTTLE;CH_TAER[1]=AILERON;CH_TAER[2]=ELEVATOR;CH_TAER[3]=RUDDER;
CH_EATR[0]=ELEVATOR;CH_EATR[1]=AILERON;CH_EATR[2]=THROTTLE;CH_EATR[3]=RUDDER;
debugln("DISABLE_CH_MAP_off");
}
}
if( (rx_ok_buff[0] != cur_protocol[0]) || ((rx_ok_buff[1]&0x5F) != (cur_protocol[1]&0x5F)) || ( (rx_ok_buff[2]&0x7F) != (cur_protocol[2]&0x7F) ) )
{ // New model has been selected
CHANGE_PROTOCOL_FLAG_on; //change protocol
@@ -1667,6 +1662,27 @@ void update_serial_data()
for(uint8_t i=0;i<3;i++)
cur_protocol[i] = rx_ok_buff[i];
//disable channel mapping
if(!IS_CHMAP_PROTOCOL) //not a protocol supporting ch map to be disabled
DISABLE_CH_MAP_off;
if(prev_ch_mapping!=IS_DISABLE_CH_MAP_on)
{
prev_ch_mapping=IS_DISABLE_CH_MAP_on;
if(IS_DISABLE_CH_MAP_on)
{
for(uint8_t i=0;i<4;i++)
CH_AETR[i]=CH_TAER[i]=CH_EATR[i]=i;
debugln("DISABLE_CH_MAP_on");
}
else
{
CH_AETR[0]=AILERON;CH_AETR[1]=ELEVATOR;CH_AETR[2]=THROTTLE;CH_AETR[3]=RUDDER;
CH_TAER[0]=THROTTLE;CH_TAER[1]=AILERON;CH_TAER[2]=ELEVATOR;CH_TAER[3]=RUDDER;
CH_EATR[0]=ELEVATOR;CH_EATR[1]=AILERON;CH_EATR[2]=THROTTLE;CH_EATR[3]=RUDDER;
debugln("DISABLE_CH_MAP_off");
}
}
// decode channel/failsafe values
volatile uint8_t *p=rx_ok_buff+3;
uint8_t dec=-3;

View File

@@ -136,37 +136,25 @@ static void multi_send_status()
if (remote_callback != 0)
{
flags |= 0x04;
#ifdef MULTI_NAMES
if((sub_protocol&0x07) && multi_protocols_index != 0xFF)
{
uint8_t nbr=multi_protocols[multi_protocols_index].nbrSubProto;
if((sub_protocol&0x07)>=nbr)
flags &= ~0x04; //Invalid sub protocol
}
#endif
if (IS_WAIT_BIND_on)
flags |= 0x10;
else
if (IS_BIND_IN_PROGRESS)
flags |= 0x08;
switch (protocol)
{
case PROTO_HISKY:
if(sub_protocol!=HK310)
break;
case PROTO_AFHDS2A:
case PROTO_DEVO:
case PROTO_SFHSS:
case PROTO_WK2x01:
#ifdef FAILSAFE_ENABLE
flags |= 0x20; //Failsafe supported
#endif
case PROTO_DSM:
case PROTO_SLT:
case PROTO_FLYSKY:
case PROTO_ESKY:
case PROTO_J6PRO:
flags |= 0x40; //Disable_ch_mapping supported
break;
#ifdef FAILSAFE_ENABLE
case PROTO_HOTT:
case PROTO_FRSKYX:
flags |= 0x20; //Failsafe supported
break;
#endif
}
if(IS_CHMAP_PROTOCOL)
flags |= 0x40; //Disable_ch_mapping supported
#ifdef FAILSAFE_ENABLE
if(IS_FAILSAFE_PROTOCOL)
flags |= 0x20; //Failsafe supported
#endif
if(IS_DATA_BUFFER_LOW_on)
flags |= 0x80;
}
@@ -197,8 +185,8 @@ static void multi_send_status()
for(uint8_t i=0;i<7;i++)
Serial_write(multi_protocols[multi_protocols_index].ProtoString[i]); // protocol name
// Sub-protocol
uint8_t nbr=multi_protocols[multi_protocols_index].nbrSubProto | (multi_protocols[multi_protocols_index].optionType<<4); // add option display type
Serial_write(nbr); // number of sub protocols
uint8_t nbr=multi_protocols[multi_protocols_index].nbrSubProto;
Serial_write(nbr | (multi_protocols[multi_protocols_index].optionType<<4)); // number of sub protocols && option type
uint8_t j=0;
if(nbr && (sub_protocol&0x07)<nbr)
{
@@ -258,7 +246,7 @@ static void multi_send_status()
}
#endif
#if defined (FRSKY_RX_TELEMETRY) || defined (AFHDS2A_RX_TELEMETRY)
#if defined (FRSKY_RX_TELEMETRY) || defined (AFHDS2A_RX_TELEMETRY) || defined (BAYANG_RX_TELEMETRY)
void receiver_channels_frame()
{
uint16_t len = packet_in[3] * 11; // 11 bit per channel
@@ -930,11 +918,11 @@ void TelemetryUpdate()
}
#endif
#if defined (FRSKY_RX_TELEMETRY) || defined(AFHDS2A_RX_TELEMETRY)
if (telemetry_link && (protocol == PROTO_FRSKY_RX || protocol == PROTO_AFHDS2A_RX))
#if defined (FRSKY_RX_TELEMETRY) || defined(AFHDS2A_RX_TELEMETRY) || defined (BAYANG_RX_TELEMETRY)
if ((telemetry_link & 1) && (protocol == PROTO_FRSKY_RX || protocol == PROTO_AFHDS2A_RX || protocol == PROTO_BAYANG_RX))
{
receiver_channels_frame();
telemetry_link = 0;
telemetry_link &= ~1;
return;
}
#endif

View File

@@ -16,7 +16,7 @@
#if defined(V911S_NRF24L01_INO)
#include "iface_xn297l.h"
#include "iface_nrf24l01.h"
//#define V911S_ORIGINAL_ID
@@ -75,25 +75,35 @@ static void __attribute__((unused)) V911S_send_packet(uint8_t bind)
packet[12] = ch>>5;
}
// Power on, TX mode, 2byte CRC
XN297_Configure(_BV(NRF24L01_00_EN_CRC) | _BV(NRF24L01_00_CRCO) | _BV(NRF24L01_00_PWR_UP));
if (!bind)
{
XN297L_Hopping(channel);
NRF24L01_WriteReg(NRF24L01_05_RF_CH, hopping_frequency[channel]);
hopping_frequency_no++;
hopping_frequency_no&=7; // 8 RF channels
}
// clear packet status bits and TX FIFO
NRF24L01_WriteReg(NRF24L01_07_STATUS, 0x70);
NRF24L01_FlushTx();
XN297_WritePayload(packet, V911S_PACKET_SIZE);
XN297L_WritePayload(packet, V911S_PACKET_SIZE);
XN297L_SetPower(); // Set tx_power
XN297L_SetFreqOffset(); // Set frequency offset
NRF24L01_SetPower(); // Set tx_power
}
static void __attribute__((unused)) V911S_init()
{
XN297L_Init();
XN297L_SetTXAddr((uint8_t *)"KNBND",5); // Bind address
XN297L_HoppingCalib(V911S_NUM_RF_CHANNELS); // Calibrate all channels
XN297L_RFChannel(V911S_RF_BIND_CHANNEL); // Set bind channel
NRF24L01_Initialize();
NRF24L01_SetTxRxMode(TX_EN);
XN297_SetTXAddr((uint8_t *)"\x4B\x4E\x42\x4E\x44", 5); // Bind address
NRF24L01_WriteReg(NRF24L01_05_RF_CH, V911S_RF_BIND_CHANNEL); // Bind channel
NRF24L01_FlushTx();
NRF24L01_FlushRx();
NRF24L01_WriteReg(NRF24L01_07_STATUS, 0x70); // Clear data ready, data sent, and retransmit
NRF24L01_WriteReg(NRF24L01_01_EN_AA, 0x00); // No Auto Acknowldgement on all data pipes
NRF24L01_WriteReg(NRF24L01_02_EN_RXADDR, 0x01); // Enable data pipe 0 only
NRF24L01_SetBitrate(NRF24L01_BR_250K); // 250Kbps
NRF24L01_SetPower();
}
static void __attribute__((unused)) V911S_initialize_txid()

View File

@@ -0,0 +1,170 @@
/*
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 <http://www.gnu.org/licenses/>.
*/
// compatible with V911S
#if defined(V911S_XN297L_INO)
#include "iface_xn297l.h"
//#define V911S_ORIGINAL_ID
#define V911S_PACKET_PERIOD 5000
#define V911S_BIND_PACKET_PERIOD 3300
#define V911S_INITIAL_WAIT 500
#define V911S_PACKET_SIZE 16
#define V911S_RF_BIND_CHANNEL 35
#define V911S_NUM_RF_CHANNELS 8
#define V911S_BIND_COUNT 200
// flags going to packet[1]
#define V911S_FLAG_EXPERT 0x04
// flags going to packet[2]
#define V911S_FLAG_CALIB 0x01
static void __attribute__((unused)) V911S_send_packet(uint8_t bind)
{
if(bind)
{
packet[0] = 0x42;
packet[1] = 0x4E;
packet[2] = 0x44;
for(uint8_t i=0;i<5;i++)
packet[i+3] = rx_tx_addr[i];
for(uint8_t i=0;i<8;i++)
packet[i+8] = hopping_frequency[i];
}
else
{
uint8_t channel=hopping_frequency_no;
if(rf_ch_num&1)
{
if((hopping_frequency_no&1)==0)
channel+=8;
channel>>=1;
}
if(rf_ch_num&2)
channel=7-channel;
packet[ 0]=(rf_ch_num<<3)|channel;
packet[ 1]=V911S_FLAG_EXPERT; // short press on left button
packet[ 2]=GET_FLAG(CH5_SW,V911S_FLAG_CALIB); // long press on right button
memset(packet+3, 0x00, V911S_PACKET_SIZE - 3);
//packet[3..6]=trims TAER signed
uint16_t ch=convert_channel_16b_limit(THROTTLE ,0,0x7FF);
packet[ 7] = ch;
packet[ 8] = ch>>8;
ch=convert_channel_16b_limit(AILERON ,0x7FF,0);
packet[ 8]|= ch<<3;
packet[ 9] = ch>>5;
ch=convert_channel_16b_limit(ELEVATOR,0,0x7FF);
packet[10] = ch;
packet[11] = ch>>8;
ch=convert_channel_16b_limit(RUDDER ,0x7FF,0);
packet[11]|= ch<<3;
packet[12] = ch>>5;
}
if (!bind)
{
XN297L_Hopping(channel);
hopping_frequency_no++;
hopping_frequency_no&=7; // 8 RF channels
}
XN297L_WritePayload(packet, V911S_PACKET_SIZE);
XN297L_SetPower(); // Set tx_power
XN297L_SetFreqOffset(); // Set frequency offset
}
static void __attribute__((unused)) V911S_init()
{
XN297L_Init();
XN297L_SetTXAddr((uint8_t *)"KNBND",5); // Bind address
XN297L_HoppingCalib(V911S_NUM_RF_CHANNELS); // Calibrate all channels
XN297L_RFChannel(V911S_RF_BIND_CHANNEL); // Set bind channel
}
static void __attribute__((unused)) V911S_initialize_txid()
{
//channels
uint8_t offset=rx_tx_addr[3]%5; // 0-4
for(uint8_t i=0;i<V911S_NUM_RF_CHANNELS;i++)
hopping_frequency[i]=0x10+i*5+offset;
if(!offset) hopping_frequency[0]++;
// channels order
rf_ch_num=random(0xfefefefe)&0x03; // 0-3
}
uint16_t V911S_callback()
{
if(IS_BIND_DONE)
{
#ifdef MULTI_SYNC
telemetry_set_input_sync(V911S_PACKET_PERIOD);
#endif
V911S_send_packet(0);
}
else
{
if (bind_counter == 0)
{
BIND_DONE;
XN297_SetTXAddr(rx_tx_addr, 5);
packet_period=V911S_PACKET_PERIOD;
}
else
{
V911S_send_packet(1);
bind_counter--;
if(bind_counter==100) // same as original TX...
packet_period=V911S_BIND_PACKET_PERIOD*3;
}
}
return packet_period;
}
uint16_t initV911S(void)
{
V911S_initialize_txid();
#ifdef V911S_ORIGINAL_ID
rx_tx_addr[0]=0xA5;
rx_tx_addr[1]=0xFF;
rx_tx_addr[2]=0x70;
rx_tx_addr[3]=0x8D;
rx_tx_addr[4]=0x76;
for(uint8_t i=0;i<V911S_NUM_RF_CHANNELS;i++)
hopping_frequency[i]=0x10+i*5;
hopping_frequency[0]++;
rf_ch_num=0;
#endif
V911S_init();
if(IS_BIND_IN_PROGRESS)
{
bind_counter = V911S_BIND_COUNT;
packet_period= V911S_BIND_PACKET_PERIOD;
}
else
{
XN297_SetTXAddr(rx_tx_addr, 5);
packet_period= V911S_PACKET_PERIOD;
}
hopping_frequency_no=0;
return V911S_INITIAL_WAIT;
}
#endif

View File

@@ -218,6 +218,7 @@
#undef MT99XX_NRF24L01_INO
#undef MJXQ_NRF24L01_INO
#undef SHENQI_NRF24L01_INO
#undef FX816_NRF24L01_INO
#undef FY326_NRF24L01_INO
#undef FQ777_NRF24L01_INO
#undef ASSAN_NRF24L01_INO
@@ -238,6 +239,7 @@
#undef XN297L_CC2500_EMU
#undef POTENSIC_NRF24L01_INO
#undef ZSX_NRF24L01_INO
#undef BAYANG_RX_NRF24L01_INO
#endif
//Make sure telemetry is selected correctly
@@ -265,6 +267,8 @@
#undef AFHDS2A_RX_TELEMETRY
#undef AFHDS2A_RX_A7105_INO
#undef HOTT_FW_TELEMETRY
#undef BAYANG_RX_TELEMETRY
#undef BAYANG_RX_NRF24L01_INO
#else
#if defined(MULTI_TELEMETRY) && defined(MULTI_STATUS)
#error You should choose either MULTI_TELEMETRY or MULTI_STATUS but not both.
@@ -281,6 +285,10 @@
#undef AFHDS2A_RX_TELEMETRY
#undef AFHDS2A_RX_A7105_INO
#endif
#if not defined(BAYANG_RX_NRF24L01_INO) || not defined(BAYANG_RX_TELEMETRY)
#undef BAYANG_RX_TELEMETRY
#undef BAYANG_RX_NRF24L01_INO
#endif
#if not defined(BAYANG_NRF24L01_INO)
#undef BAYANG_HUB_TELEMETRY
#endif
@@ -320,7 +328,7 @@
#if not defined(HOTT_CC2500_INO)
#undef HOTT_FW_TELEMETRY
#endif
#if not defined(HOTT_FW_TELEMETRY) && not defined(DSM_TELEMETRY) && not defined(SPORT_TELEMETRY) && not defined(HUB_TELEMETRY) && not defined(HUBSAN_HUB_TELEMETRY) && not defined(BUGS_HUB_TELEMETRY) && not defined(NCC1701_HUB_TELEMETRY) && not defined(BAYANG_HUB_TELEMETRY) && not defined(CABELL_HUB_TELEMETRY) && not defined(AFHDS2A_HUB_TELEMETRY) && not defined(AFHDS2A_FW_TELEMETRY) && not defined(MULTI_TELEMETRY) && not defined(MULTI_STATUS) && not defined(HITEC_HUB_TELEMETRY) && not defined(HITEC_FW_TELEMETRY) && not defined(SCANNER_TELEMETRY) && not defined(FRSKY_RX_TELEMETRY) && not defined(AFHDS2A_RX_TELEMETRY)
#if not defined(HOTT_FW_TELEMETRY) && not defined(DSM_TELEMETRY) && not defined(SPORT_TELEMETRY) && not defined(HUB_TELEMETRY) && not defined(HUBSAN_HUB_TELEMETRY) && not defined(BUGS_HUB_TELEMETRY) && not defined(NCC1701_HUB_TELEMETRY) && not defined(BAYANG_HUB_TELEMETRY) && not defined(CABELL_HUB_TELEMETRY) && not defined(AFHDS2A_HUB_TELEMETRY) && not defined(AFHDS2A_FW_TELEMETRY) && not defined(MULTI_TELEMETRY) && not defined(MULTI_STATUS) && not defined(HITEC_HUB_TELEMETRY) && not defined(HITEC_FW_TELEMETRY) && not defined(SCANNER_TELEMETRY) && not defined(FRSKY_RX_TELEMETRY) && not defined(AFHDS2A_RX_TELEMETRY) && not defined(BAYANG_RX_TELEMETRY)
#undef TELEMETRY
#undef INVERT_TELEMETRY
#undef MULTI_TELEMETRY
@@ -341,6 +349,10 @@
#undef MULTI_NAMES
#endif
#if defined(MULTI_TELEMETRY)
#define MULTI_NAMES
#endif
//Make sure TX is defined correctly
#ifndef AILERON
#error You must select a correct channel order.

View File

@@ -187,6 +187,7 @@
//The protocols below need a NRF24L01 to be installed
#define ASSAN_NRF24L01_INO
#define BAYANG_NRF24L01_INO
#define BAYANG_RX_NRF24L01_INO
#define BUGSMINI_NRF24L01_INO
#define CABELL_NRF24L01_INO
#define CFLIE_NRF24L01_INO
@@ -197,6 +198,7 @@
#define ESKY_NRF24L01_INO
#define ESKY150_NRF24L01_INO
#define FQ777_NRF24L01_INO
#define FX816_NRF24L01_INO
#define FY326_NRF24L01_INO
#define GD00X_NRF24L01_INO
#define GW008_NRF24L01_INO
@@ -270,7 +272,6 @@
//A 9XR_PRO running erskyTX will work with both commented and uncommented depending on the radio setting Invert COM1 under the Telemetry menu.
//On other addon/replacement boards like the 9xtreme board or the Ar9x board running erskyTX, you need to uncomment the line below.
//For er9x it depends if you have an inveter mod or not on the telemetry pin. If you don't have an inverter comment this line.
//=>OpenTX 2.3.2 with a STM32 or OrangeRX module this setting can be ignored.
#define INVERT_TELEMETRY
//For STM32 and OrangeRX modules, comment to prevent the TX from forcing the serial telemetry polarity normal/invert.
#define INVERT_TELEMETRY_TX
@@ -282,8 +283,6 @@
//Sends Multi status and allow OpenTX to autodetect the telemetry format. Comment to disable.
//Supported by OpenTX version 2.2 RC9 and newer. NOT supported by er9x/erskyTX use MULTI_STATUS instead.
#define MULTI_TELEMETRY
//Send to OpenTX the current protocol and subprotocol names. Comment to disable.
#define MULTI_NAMES
//Work in progress: Sync OpenTX frames with the current protocol timing. This feature is only available on the STM32 module. Uncomment to enable.
//#define MULTI_SYNC
@@ -304,6 +303,7 @@
#define FRSKY_RX_TELEMETRY // Forward channels data to TX
#define AFHDS2A_RX_TELEMETRY // Forward channels data to TX
#define HOTT_FW_TELEMETRY // Forward received telemetry packets to be decoded by erskyTX and OpenTX
#define BAYANG_RX_TELEMETRY // Forward channels data to TX
/****************************/
/*** SERIAL MODE SETTINGS ***/
@@ -501,6 +501,8 @@ const PPM_Parameters PPM_prot[14*NBR_BANKS]= {
X16_AH
IRDRONE
DHD_D4
PROTO_BAYANG_RX
NONE
PROTO_BUGS
NONE
PROTO_BUGSMINI
@@ -543,7 +545,8 @@ const PPM_Parameters PPM_prot[14*NBR_BANKS]= {
PROTO_ESKY
NONE
PROTO_ESKY150
NONE
ESKY150_4CH
ESKY150_7CH
PROTO_FLYSKY
Flysky
V9X9
@@ -565,6 +568,8 @@ const PPM_Parameters PPM_prot[14*NBR_BANKS]= {
EU_8
PROTO_FRSKY_RX
NONE
PROTO_FX816
NONE
PROTO_FY326
FY326
FY319

View File

@@ -22,8 +22,7 @@ Here are detailed descriptions of every supported protocols (sorted by RF module
- Bind channel is going from -100% to +100%
* Additional notes:
- It's recommended to combine Throttle cut with another button to drive the bind channel. This will prevent to launch a bind while flying...
- Bind channel does not have to be assigned to a free channel. Since it only acts when Throttle is Low (and throttle cut active), it could be used on the same channel as Flip for example since you are not going to flip your model when Throttle is low... Same goes for RTH and such other features.
- **It's recommended to combine the bind switch with Throttle cut or throttle at -100% to drive the bind channel. This will prevent to launch a bind while flying** and enable you to use the bind switch for something else.
- Using channel 16 for the bind channel seems the most relevant as only one protocol so far is using 16 channels which is FrSkyX. But even on FrSkyX this feature won't have any impact since there is NO valid reason to have Autobind set to Y for such a protocol.
## Protocol selection in PPM mode
@@ -69,6 +68,7 @@ Protocol Name|Protocol Number|Sub_Proto 0|Sub_Proto 1|Sub_Proto 2|Sub_Proto 3|Su
---|---|---|---|---|---|---|---|---|---|---|---
[Assan](Protocols_Details.md#ASSAN---24)|24|ASSAN||||||||NRF24L01|
[Bayang](Protocols_Details.md#BAYANG---14)|14|Bayang|H8S3D|X16_AH|IRDRONE|DHD_D4||||NRF24L01|XN297
[Bayang RX](Protocols_Details.md#BAYANG-RX---59)|59|||||||||NRF24L01|XN297
[Bugs](Protocols_Details.md#BUGS---41)|41|BUGS||||||||A7105|
[BugsMini](Protocols_Details.md#BUGSMINI---42)|42|BUGSMINI|BUGS3H|||||||NRF24L01|XN297
[Cabell](Protocols_Details.md#Cabell---34)|34|Cabell_V3|C_TELEM|-|-|-|-|F_SAFE|UNBIND|NRF24L01|
@@ -91,6 +91,7 @@ CFlie|38|CFlie||||||||NRF24L01|
[FrskyV](Protocols_Details.md#FRSKYV---25)|25|FrskyV||||||||CC2500|
[FrskyX](Protocols_Details.md#FRSKYX---15)|15|CH_16|CH_8|EU_16|EU_8|||||CC2500|
[FrskyX_RX](Protocols_Details.md#FRSKYX_RX---55)|55|FCC|EU_LBT|||||CC2500|
[FX816](Protocols_Details.md#FX816---58)|28|FX816|P38|||||||NRF24L01|
[FY326](Protocols_Details.md#FY326---20)|20|FY326|FY319|||||||NRF24L01|
[GD00X](Protocols_Details.md#GD00X---47)|47|GD_V1*|GD_V2*|||||||NRF24L01|
[GW008](Protocols_Details.md#GW008---32)|32|GW008||||||||NRF24L01|XN297
@@ -193,7 +194,7 @@ Note that the RX ouput will be AETR whatever the input channel order is.
## FLYSKY AFHDS2A RX - *56*
The Flysky AFHDS2A receiver protocol enables master/slave trainning, separate access from 2 different radios to the same model,...
Available in OpenTX 2.3.2, Trainer Mode Master/Multi
Available in OpenTX 2.3.3, Trainer Mode Master/Multi
Extended limits supported
@@ -356,7 +357,7 @@ CH1|CH2|CH3|CH4|CH5|CH6|CH7|CH8
## FRSKYX_RX - *55*
The FrSkyX receiver protocol enables master/slave trainning, separate access from 2 different radios to the same model,...
Available in OpenTX 2.3.2, Trainer Mode Master/Multi
Available in OpenTX 2.3.3, Trainer Mode Master/Multi
Extended limits supported
@@ -396,7 +397,7 @@ CH1|CH2|CH3|CH4|CH5|CH6|CH7|CH8|CH9
### Sub_protocol OPT_FW - *0*
OPTIMA RXs
Full telemetry available on OpenTX 2.3.2+, still in progress for erskyTx.
Full telemetry available on OpenTX 2.3.3+, still in progress for erskyTx.
**The TX must be close to the RX for the bind negotiation to complete successfully**
@@ -428,7 +429,7 @@ CH1|CH2|CH3|CH4|CH5|CH6|CH7|CH8|CH9|CH10|CH11|CH12
---|---|---|---|---|---|---|---|---|----|----|----
CH1|CH2|CH3|CH4|CH5|CH6|CH7|CH8|CH9|CH10|CH11|CH12
Basic telemetry is available on OpenTX 2.3.2+ with RX voltage, Rx temperature, RX RSSI, RX LQI, TX RSSI and TX LQI.
Basic telemetry is available on OpenTX 2.3.3+ with RX voltage, Rx temperature, RX RSSI, RX LQI, TX RSSI and TX LQI.
## SFHSS - *21*
Models: Futaba RXs and XK models.
@@ -673,6 +674,17 @@ CH12|CH13
----|----
TAKE_OFF|EMG_STOP
## BAYANG RX - *59*
The Bayang receiver protocol enables master/slave trainning, separate access from 2 different radios to the same model,...
See the [BAYANG protocol](Protocols_Details.md#BAYANG---14) on how to activate ANAUX1 and ANAUX2 (Option/Telemetry=2).
CH1|CH2|CH3|CH4|CH5|CH6|CH7|CH8|CH9|CH10
---|---|---|---|---|---|---|---|---|---
A|E|T|R|ANAUX1|ANAUX2|FLIP|RTH|PICTURE|VIDEO
Available in OpenTX 2.3.3, Trainer Mode Master/Multi
## BUGSMINI - *42*
Models: MJX Bugs 3 Mini and 3H
@@ -826,7 +838,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
---|---|---|---|---|---|---
@@ -834,6 +852,15 @@ A|E|T|R|FMODE|AUX6|AUX7
FMODE and AUX7 have 4 positions: -100%..-50%=>0, -50%..5%=>1, 5%..50%=>2, 50%..100%=>3
## FX816 - *58*
Model: FEI XIONG FX816 P38
Only 8 TX IDs available
CH1|CH2|CH3|CH4
---|---|---|---
A|-|T|-
## FY326 - *20*
### Sub_protocol FY326 - *0*