mirror of
https://github.com/pascallanger/DIY-Multiprotocol-TX-Module.git
synced 2025-11-26 05:59:41 +00:00
Compare commits
39 Commits
pascallang
...
v1.3.4.0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c7513abad8 | ||
|
|
e6e13c0fdd | ||
|
|
9579a667fc | ||
|
|
cbedda2471 | ||
|
|
f8695befe2 | ||
|
|
e951e3146b | ||
|
|
4c0b46549f | ||
|
|
188f8ff9ce | ||
|
|
bee6e59582 | ||
|
|
af47462ba7 | ||
|
|
d6ccd4af54 | ||
|
|
0feedc6fa9 | ||
|
|
b5bc7c04fb | ||
|
|
a15371d989 | ||
|
|
3c82f37e2b | ||
|
|
4f914a18ae | ||
|
|
1cbce29970 | ||
|
|
e0c44ed5a8 | ||
|
|
390e5dd654 | ||
|
|
968293e599 | ||
|
|
09ee173e3b | ||
|
|
babfee0f9e | ||
|
|
72da3c5bc5 | ||
|
|
4df1e65a7f | ||
|
|
1459d690d8 | ||
|
|
8d96066215 | ||
|
|
93a5834dd0 | ||
|
|
5f9ac82ed1 | ||
|
|
2108912263 | ||
|
|
72f87cade9 | ||
|
|
50bd4850fa | ||
|
|
dc1490b9b0 | ||
|
|
b18adb0efe | ||
|
|
53d5684dfd | ||
|
|
724abbc935 | ||
|
|
de610b53fc | ||
|
|
dd7ee7bdce | ||
|
|
31a9f6860d | ||
|
|
4a66ae64c6 |
216
.github/workflows/main.yml
vendored
216
.github/workflows/main.yml
vendored
@@ -1,6 +1,6 @@
|
||||
# Workflow for testing MULTI-Module firmware builds
|
||||
|
||||
name: CI
|
||||
name: MULTI Test, Build, Deploy, Release
|
||||
|
||||
on:
|
||||
# Trigger the workflow on pushes, except those that are tagged (avoids double-testing releases)
|
||||
@@ -32,7 +32,7 @@ on:
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
build:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
# Configure the board matrix
|
||||
@@ -51,21 +51,21 @@ jobs:
|
||||
- board: "multi4in1:STM32F1:multistm32f103cb:debug_option=none"
|
||||
name: "STM32F103 (128KB)"
|
||||
- board: "multi4in1:STM32F1:multistm32f103cb:debug_option=native"
|
||||
name: "STM32F103 (128KB, USB Debugging)"
|
||||
name: "STM32F103 (128KB, USB Debug)"
|
||||
- board: "multi4in1:STM32F1:multistm32f103cb:debug_option=ftdi"
|
||||
name: "STM32F103 (128KB, Serial Debugging)"
|
||||
name: "STM32F103 (128KB, Serial Debug)"
|
||||
- board: "multi4in1:STM32F1:multi5in1t18int"
|
||||
name: "T18 5-in-1 (128KB)"
|
||||
|
||||
# Set the build name using the friendly board name
|
||||
name: ${{ matrix.name }}
|
||||
name: "[Test] ${{ matrix.name }}"
|
||||
|
||||
# Set the environment variables
|
||||
env:
|
||||
BOARD: ${{ matrix.board }}
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Install Arduino CLI
|
||||
uses: arduino/setup-arduino-cli@v1.1.2
|
||||
@@ -161,23 +161,38 @@ jobs:
|
||||
|
||||
- name: Build serial only
|
||||
run: |
|
||||
source ./buildroot/bin/buildFunctions;
|
||||
cp ./_Config.h.bak Multiprotocol/_Config.h
|
||||
opt_disable ENABLE_PPM;
|
||||
buildMulti;
|
||||
# Skip the serial-only build for boards where it's too large now
|
||||
if [[ "$BOARD" =~ ":STM32F1:multistm32f103cb:debug_option=none" ]] || [[ "$BOARD" =~ ":STM32F1:multi5in1t18int" ]]; then
|
||||
printf "Not testing serial-only build for $BOARD.";
|
||||
else
|
||||
source ./buildroot/bin/buildFunctions;
|
||||
cp ./_Config.h.bak Multiprotocol/_Config.h
|
||||
opt_disable ENABLE_PPM;
|
||||
buildMulti;
|
||||
fi
|
||||
|
||||
- name: Build PPM only
|
||||
run: |
|
||||
source ./buildroot/bin/buildFunctions;
|
||||
cp ./_Config.h.bak Multiprotocol/_Config.h
|
||||
opt_disable ENABLE_SERIAL;
|
||||
buildMulti;
|
||||
# Skip the PPM-only build for boards where it's too large now
|
||||
if [[ "$BOARD" =~ ":STM32F1:multistm32f103cb:debug_option=none" ]] || [[ "$BOARD" =~ ":STM32F1:multi5in1t18int" ]]; then
|
||||
printf "Not testing PPM-only build for $BOARD.";
|
||||
else
|
||||
source ./buildroot/bin/buildFunctions;
|
||||
cp ./_Config.h.bak Multiprotocol/_Config.h
|
||||
opt_disable ENABLE_SERIAL;
|
||||
buildMulti;
|
||||
fi
|
||||
|
||||
- name: Build each RF module individually
|
||||
run: |
|
||||
source ./buildroot/bin/buildFunctions;
|
||||
cp ./_Config.h.bak Multiprotocol/_Config.h;
|
||||
buildEachRFModule;
|
||||
# Skip the per-RF module builds for boards which have fixed modules
|
||||
if [[ "$BOARD" =~ ":STM32F1:multi5in1t18int" ]]; then
|
||||
printf "Not testing individual RF module builds for $BOARD.";
|
||||
else
|
||||
source ./buildroot/bin/buildFunctions;
|
||||
cp ./_Config.h.bak Multiprotocol/_Config.h;
|
||||
buildEachRFModule;
|
||||
fi
|
||||
|
||||
- name: Build each protocol individually
|
||||
run: |
|
||||
@@ -185,6 +200,128 @@ jobs:
|
||||
cp ./_Config.h.bak Multiprotocol/_Config.h;
|
||||
buildEachProtocol;
|
||||
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
# Configure the board matrix
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- board: "multi4in1:avr:multiatmega328p:bootloader=none"
|
||||
name: "ATmega328p"
|
||||
release: "atmega328p"
|
||||
- board: "multi4in1:avr:multiatmega328p:bootloader=optiboot"
|
||||
name: "ATmega328p (Optiboot)"
|
||||
release: "atmega328p-optiboot"
|
||||
- board: "multi4in1:avr:multixmega32d4"
|
||||
name: "OrangeRX"
|
||||
release: "orangerx"
|
||||
- board: "multi4in1:STM32F1:multistm32f103c8:debug_option=none"
|
||||
name: "STM32F103 CC2500 (64KB)"
|
||||
release: "stm32f103-cc2500-64k"
|
||||
- board: "multi4in1:STM32F1:multistm32f103cb:debug_option=none"
|
||||
name: "STM32F103 CC2500 (128KB)"
|
||||
release: "stm32f103-cc2500-128k"
|
||||
- board: "multi4in1:STM32F1:multistm32f103cb:debug_option=none"
|
||||
name: "STM32F103 (128KB)"
|
||||
release: "stm32f103-128k-4in1"
|
||||
- board: "multi4in1:STM32F1:multistm32f103cb:debug_option=native"
|
||||
name: "STM32F103 (128KB, USB Debug)"
|
||||
release: "stm32f103-128k-usb-debug"
|
||||
- board: "multi4in1:STM32F1:multistm32f103cb:debug_option=ftdi"
|
||||
name: "STM32F103 (128KB, Serial Debug)"
|
||||
release: "stm32f103-128k-serial-debug"
|
||||
- board: "multi4in1:STM32F1:multistm32f103cb:debug_option=none"
|
||||
name: "STM32F103 5-in-1 (128KB)"
|
||||
release: "stm32f103-128k-5in1"
|
||||
- board: "multi4in1:STM32F1:multistm32f103cb:debug_option=none"
|
||||
name: "T-Lite 5-in-1 (128KB)"
|
||||
release: "tlite-5in1"
|
||||
- board: "multi4in1:STM32F1:multi5in1t18int"
|
||||
name: "T18 5-in-1 (128KB)"
|
||||
release: "t18-5in1"
|
||||
- board: "none"
|
||||
name: "Scripts"
|
||||
release: "scripts"
|
||||
|
||||
# Set the build name using the friendly board name
|
||||
name: "[Build] ${{ matrix.name }}"
|
||||
|
||||
# Set the environment variables
|
||||
env:
|
||||
BOARD: ${{ matrix.board }}
|
||||
RELEASE: ${{ matrix.release }}
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Install Arduino CLI
|
||||
uses: arduino/setup-arduino-cli@v1.1.2
|
||||
with:
|
||||
version: "0.32.2"
|
||||
|
||||
- name: Prepare build environment
|
||||
run: |
|
||||
echo "Github Ref: $GITHUB_REF"
|
||||
echo "Event name: ${{ github.event_name }}"
|
||||
echo "Event action: ${{ github.event.action }}"
|
||||
echo "Tag name: ${{ github.event.release.tag_name }}"
|
||||
|
||||
arduino-cli config init --additional-urls https://raw.githubusercontent.com/pascallanger/DIY-Multiprotocol-TX-Module-Boards/master/package_multi_4in1_board_index.json,https://raw.githubusercontent.com/pascallanger/DIY-Multiprotocol-TX-Module-Boards/devel/source/package_multi_4in1_board_devel_index.json
|
||||
arduino-cli core update-index
|
||||
|
||||
if [[ "$BOARD" =~ ":avr:" ]]; then
|
||||
arduino-cli core install arduino:avr;
|
||||
fi
|
||||
|
||||
if [[ "$BOARD" =~ "multi4in1-devel:avr" ]]; then
|
||||
arduino-cli core install multi4in1-devel:avr
|
||||
elif [[ "$BOARD" =~ "multi4in1:avr" ]]; then
|
||||
arduino-cli core install multi4in1:avr
|
||||
fi
|
||||
|
||||
if [[ "$BOARD" =~ "multi4in1-devel:STM32F1:" ]]; then
|
||||
arduino-cli core install multi4in1-devel:STM32F1
|
||||
elif [[ "$BOARD" =~ "multi4in1:STM32F1:" ]]; then
|
||||
arduino-cli core install multi4in1:STM32F1
|
||||
fi
|
||||
|
||||
chmod +x ${GITHUB_WORKSPACE}/buildroot/bin/*
|
||||
echo "${GITHUB_WORKSPACE}/buildroot/bin" >> $GITHUB_PATH
|
||||
|
||||
mkdir ./build
|
||||
mkdir ./binaries
|
||||
|
||||
- name: Configure MULTI-Module firmware options
|
||||
run: |
|
||||
# Load the build functions
|
||||
source ./buildroot/bin/buildFunctions;
|
||||
|
||||
# Get the version
|
||||
getMultiVersion
|
||||
echo "MULTI_VERSION=$(echo $MULTI_VERSION)" >> $GITHUB_ENV
|
||||
|
||||
# Get all the protocols for this board
|
||||
getAllProtocols
|
||||
echo "A7105_PROTOCOLS=$(echo $A7105_PROTOCOLS)" >> $GITHUB_ENV
|
||||
echo "CC2500_PROTOCOLS=$(echo $CC2500_PROTOCOLS)" >> $GITHUB_ENV
|
||||
echo "CYRF6936_PROTOCOLS=$(echo $CYRF6936_PROTOCOLS)" >> $GITHUB_ENV
|
||||
echo "NRF24L01_PROTOCOLS=$(echo $NRF24L01_PROTOCOLS)" >> $GITHUB_ENV
|
||||
echo "SX1276_PROTOCOLS=$(echo $SX1276_PROTOCOLS)" >> $GITHUB_ENV
|
||||
echo "CCNRF_INO_PROTOCOLS=$(echo $CCNRF_INO_PROTOCOLS)" >> $GITHUB_ENV
|
||||
echo "ALL_PROTOCOLS=$(echo $ALL_PROTOCOLS)" >> $GITHUB_ENV
|
||||
|
||||
# Disable CHECK_FOR_BOOTLOADER when not needed
|
||||
if [[ "$BOARD" =~ ":avr:multiatmega328p:bootloader=none" ]]; then
|
||||
opt_disable CHECK_FOR_BOOTLOADER;
|
||||
fi
|
||||
|
||||
- name: Save default firmware configuration
|
||||
run: |
|
||||
cat Multiprotocol/_Config.h
|
||||
cp Multiprotocol/_Config.h ./_Config.h.bak
|
||||
|
||||
- name: Build release files
|
||||
run: |
|
||||
source ./buildroot/bin/buildFunctions;
|
||||
@@ -199,16 +336,43 @@ jobs:
|
||||
echo "HAVE_FILES=false" >> $GITHUB_ENV
|
||||
fi
|
||||
|
||||
- name: Deploy files to release
|
||||
if: github.event_name == 'release' && github.event.action == 'created' && env.HAVE_FILES == 'true'
|
||||
uses: AButler/upload-release-assets@v2.0
|
||||
with:
|
||||
files: './binaries/*'
|
||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: 'Upload Artifacts'
|
||||
if: env.HAVE_FILES == 'true'
|
||||
uses: actions/upload-artifact@v3
|
||||
uses: actions/upload-artifact/@v4
|
||||
with:
|
||||
name: multi-${{ matrix.release }}
|
||||
path: ./binaries/
|
||||
|
||||
deploy:
|
||||
name: "[Deploy] Attach Build Artifacts"
|
||||
runs-on: ubuntu-latest
|
||||
needs: [test, build]
|
||||
steps:
|
||||
- name: Combine and upload build artifacts
|
||||
uses: actions/upload-artifact/merge@v4
|
||||
with:
|
||||
name: multi-test-build
|
||||
path: ./binaries/
|
||||
pattern: multi-*
|
||||
delete-merged: true
|
||||
retention-days: 90
|
||||
|
||||
release:
|
||||
name: "[Release] Publish Files to Release"
|
||||
if: github.event_name == 'release' && github.event.action == 'created'
|
||||
runs-on: ubuntu-latest
|
||||
needs: deploy
|
||||
steps:
|
||||
- name: Download artifacts
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: multi-test-build
|
||||
path: ./artifacts/
|
||||
|
||||
- name: Display downloaded artifacts
|
||||
run: ls -R ./artifacts/
|
||||
|
||||
- name: Deploy artifacts to release
|
||||
uses: AButler/upload-release-assets@v3.0
|
||||
with:
|
||||
files: './artifacts/*'
|
||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
@@ -119,8 +119,8 @@
|
||||
49,0,KF606,KF606,1,Trim
|
||||
49,1,KF606,MIG320,1,Trim,LED
|
||||
49,2,KF606,ZCZ50,1,Trim,UNK
|
||||
9,0,KN,WLToys,0,DRate,THold,IdleUp,Gyro,Ttrim,Atrim,Etrim
|
||||
9,1,KN,Feilun,0,DRate,THold,IdleUp,Gyro,Ttrim,Atrim,Etrim
|
||||
9,0,KN,WLToys,0,DRate,THold,IdleUp,Gyro,Ttrim,Atrim,Etrim,Rtrim,Hover
|
||||
9,1,KN,Feilun,0,DRate,THold,IdleUp,Gyro,Ttrim,Atrim,Etrim,Rtrim,Hover
|
||||
73,0,Kyosho,FHSS,0,CH5,CH6,CH7,CH8,CH9,CH10,CH11,CH12,CH13,CH14
|
||||
73,1,Kyosho,Hype,0,CH5,CH6
|
||||
18,0,MJXQ,WHL08,1,Flip,LED,Pict,Video,HLess,RTH,AuFlip,Pan,Tilt,Rate
|
||||
@@ -156,7 +156,8 @@
|
||||
74,0,RadioLink,Surface,0,CH5,CH6,CH7,CH8,FS_CH1,FS_CH2,FS_CH3,FS_CH4,FS_CH5,FS_CH6,FS_CH7,FS_CH8
|
||||
74,1,RadioLink,Air,0,CH5,CH6,CH7,CH8,FS_CH1,FS_CH2,FS_CH3,FS_CH4,FS_CH5,FS_CH6,FS_CH7,FS_CH8
|
||||
74,2,RadioLink,DumboRC,0,CH5,CH6,CH7,CH8,FS_CH1,FS_CH2,FS_CH3,FS_CH4,FS_CH5,FS_CH6,FS_CH7,FS_CH8
|
||||
76,0,Realacc,R11,1,Flip,Light,Calib,HLess,RTH,UNK
|
||||
74,3,RadioLink,RC4G,0,CH5,FS_CH1,FS_CH2,FS_CH3,FS_CH4
|
||||
76,0,Realacc,Std,1,Flip,Light,Calib,HLess,RTH,UNK
|
||||
50,0,Redpine,Fast,0,sCH5,sCH6,sCH7,sCH8,sCH9,sCH10,sCH11,sCH12,sCH13,sCH14,sCH15,sCH16
|
||||
50,1,Redpine,Slow,0,sCH5,sCH6,sCH7,sCH8,sCH9,sCH10,sCH11,sCH12,sCH13,sCH14,sCH15,sCH16
|
||||
21,0,Futaba,SFHSS,0,CH5,CH6,CH7,CH8
|
||||
@@ -169,8 +170,7 @@
|
||||
11,4,SLT,MR100,0,Rates,n-a,CH7,CH8,Mode,Flip,Video,Pict
|
||||
10,0,Symax,Std,1,Flip,Rates,Pict,Video,HLess
|
||||
10,1,Symax,X5C,1,Flip,Rates,Pict,Video,HLess
|
||||
61,0,Tiger,Std,1,Flip,Light
|
||||
43,0,Traxxas,6519,0
|
||||
43,0,Traxxas,TQ,0
|
||||
5,0,V2x2,Std,1,Flip,Light,Pict,Video,HLess,CalX,CalY
|
||||
5,1,V2x2,JXD506,1,Flip,Light,Pict,Video,HLess,StaSto,Emerg,Cam_UD
|
||||
48,0,V761,3CH,0,Gyro,Calib,Flip,RtnAct,Rtn
|
||||
@@ -186,7 +186,8 @@
|
||||
30,4,WK2x01,W6HEL,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,1,XK,X420,1,FMode,TakeOf,Emerg,3D_6G,Pict,Video
|
||||
62,1,XK,X420,1,FMode,TakeOf,Emerg,3D_6G,Pict,Video,Flip,Light
|
||||
62,2,XK,Cars,0,FMode,TakeOf,Emerg,3D_6G,Pict,Video,Flip,Light
|
||||
8,0,YD717,Std,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
|
||||
@@ -212,3 +213,5 @@
|
||||
94,0,Scorpio
|
||||
95,0,Bluefly,HP100,0,CH5,CH6,CH7,CH8
|
||||
96,0,BumbleB
|
||||
97,0,SGF22,Std,1,Mode,Flip,LED,Pict,Video
|
||||
61,1,EazyRC
|
||||
|
||||
@@ -174,19 +174,21 @@ static void __attribute__((unused)) DSM_build_data_packet(uint8_t upper)
|
||||
bits=10; // Only DSM2_1F is using a resolution of 1024
|
||||
}
|
||||
|
||||
if(sub_protocol == DSMR)
|
||||
{
|
||||
for (uint8_t i = 0; i < 7; i++)
|
||||
#ifndef MULTI_AIR
|
||||
if(sub_protocol == DSMR)
|
||||
{
|
||||
uint16_t value = 0x0000;
|
||||
if(i < num_ch)
|
||||
value=Channel_data[i]<<1;
|
||||
packet[i*2+2] = (value >> 8) & 0xff;
|
||||
packet[i*2+3] = (value >> 0) & 0xff;
|
||||
for (uint8_t i = 0; i < 7; i++)
|
||||
{
|
||||
uint16_t value = 0x0000;
|
||||
if(i < num_ch)
|
||||
value=Channel_data[i]<<1;
|
||||
packet[i*2+2] = (value >> 8) & 0xff;
|
||||
packet[i*2+3] = (value >> 0) & 0xff;
|
||||
}
|
||||
return;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef DSM_THROTTLE_KILL_CH
|
||||
uint16_t kill_ch=Channel_data[DSM_THROTTLE_KILL_CH-1];
|
||||
#endif
|
||||
@@ -267,6 +269,10 @@ uint16_t DSM_callback()
|
||||
if(sub_protocol == DSM2_1F || sub_protocol == DSM2_2F)
|
||||
return 11000;
|
||||
#endif
|
||||
#if defined MULTI_AIR
|
||||
if(sub_protocol == DSMR)
|
||||
return 11000;
|
||||
#endif
|
||||
#define DSM_CH1_CH2_DELAY 4010 // Time between write of channel 1 and channel 2
|
||||
#ifdef STM32_BOARD
|
||||
#define DSM_WRITE_DELAY 1600 // Time after write to verify write complete
|
||||
@@ -506,6 +512,7 @@ uint16_t DSM_callback()
|
||||
}
|
||||
|
||||
|
||||
#ifndef MULTI_AIR
|
||||
const uint8_t PROGMEM DSMR_ID_FREQ[][4 + 23] = {
|
||||
{ 0x71, 0x74, 0x1c, 0xe4, 0x11, 0x2f, 0x17, 0x3d, 0x23, 0x3b, 0x0f, 0x21, 0x25, 0x49, 0x1d, 0x13, 0x4d, 0x1f, 0x41, 0x4b, 0x47, 0x05, 0x27, 0x15, 0x19, 0x3f, 0x07 },
|
||||
{ 0xfe, 0xfe, 0xfe, 0xfe, 0x45, 0x31, 0x33, 0x4b, 0x11, 0x29, 0x49, 0x3f, 0x09, 0x13, 0x47, 0x21, 0x1d, 0x43, 0x1f, 0x05, 0x41, 0x19, 0x1b, 0x2d, 0x15, 0x4d, 0x0f },
|
||||
@@ -529,22 +536,27 @@ const uint8_t PROGMEM DSMR_ID_FREQ[][4 + 23] = {
|
||||
{ 0xff, 0xff, 0x00, 0x00, 0x2b, 0x35, 0x1b, 0x1d, 0x0f, 0x47, 0x09, 0x0d, 0x45, 0x41, 0x21, 0x11, 0x2f, 0x43, 0x27, 0x33, 0x4b, 0x37, 0x13, 0x19, 0x4d, 0x23, 0x17 },
|
||||
{ 0x00, 0xff, 0x00, 0x00, 0x1b, 0x1d, 0x33, 0x13, 0x2b, 0x27, 0x09, 0x41, 0x25, 0x17, 0x19, 0x2d, 0x4b, 0x37, 0x45, 0x11, 0x21, 0x0d, 0x3d, 0x4d, 0x07, 0x39, 0x43 },
|
||||
{ 0xff, 0x00, 0x00, 0x00, 0x37, 0x27, 0x43, 0x4b, 0x39, 0x13, 0x07, 0x0d, 0x25, 0x17, 0x29, 0x1b, 0x1d, 0x45, 0x19, 0x2d, 0x0b, 0x3d, 0x15, 0x47, 0x1f, 0x21, 0x4d } };
|
||||
#endif
|
||||
|
||||
void DSM_init()
|
||||
{
|
||||
if(sub_protocol == DSMR)
|
||||
{
|
||||
if(option&CLONE_BIT_MASK)
|
||||
#ifndef MULTI_AIR
|
||||
if(option&CLONE_BIT_MASK)
|
||||
SUB_PROTO_INVALID;
|
||||
else
|
||||
{
|
||||
SUB_PROTO_VALID;
|
||||
uint8_t row = rx_tx_addr[3]%22;
|
||||
for(uint8_t i=0; i< 4; i++)
|
||||
cyrfmfg_id[i] = pgm_read_byte_near(&DSMR_ID_FREQ[row][i]);
|
||||
for(uint8_t i=0; i< 23; i++)
|
||||
hopping_frequency[i] = pgm_read_byte_near(&DSMR_ID_FREQ[row][i+4]);
|
||||
}
|
||||
#else
|
||||
SUB_PROTO_INVALID;
|
||||
else
|
||||
{
|
||||
SUB_PROTO_VALID;
|
||||
uint8_t row = rx_tx_addr[3]%22;
|
||||
for(uint8_t i=0; i< 4; i++)
|
||||
cyrfmfg_id[i] = pgm_read_byte_near(&DSMR_ID_FREQ[row][i]);
|
||||
for(uint8_t i=0; i< 23; i++)
|
||||
hopping_frequency[i] = pgm_read_byte_near(&DSMR_ID_FREQ[row][i+4]);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
166
Multiprotocol/EazyRC_nrf24l01.ino
Normal file
166
Multiprotocol/EazyRC_nrf24l01.ino
Normal file
@@ -0,0 +1,166 @@
|
||||
/*
|
||||
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(EAZYRC_NRF24L01_INO)
|
||||
|
||||
#include "iface_xn297.h"
|
||||
|
||||
//#define FORCE_EAZYRC_ORIGINAL_ID
|
||||
|
||||
#define EAZYRC_PAYLOAD_SIZE 10
|
||||
#define EAZYRC_RF_NUM_CHANNELS 4
|
||||
#define EAZYRC_BIND_CHANNEL 18
|
||||
#define EAZYRC_PACKET_PERIOD 5000
|
||||
|
||||
enum {
|
||||
EAZYRC_BINDTX=0,
|
||||
EAZYRC_BINDRX,
|
||||
EAZYRC_DATA,
|
||||
};
|
||||
|
||||
static void __attribute__((unused)) EAZYRC_send_packet()
|
||||
{
|
||||
//Bind:
|
||||
// TX: C=18 S=Y A= AA BB CC DD EE P(10)= 1A A0 01 00 00 00 1E 00 78 51
|
||||
// packet[0..2]=tx_addr, packet[6]=first rf channel, packet[8]=unk, packet[9]=sum(packet[0..8])
|
||||
// RX: C=18 S=Y A= AA BB CC DD EE P(10)= 41 AD 01 1A A0 01 1E 00 87 4F
|
||||
// packet[0..2]=rx_addr, packet[3..5]=tx_addr, packet[6]=first rf channel, packet[8]=unk but swapped, packet[9]=sum(packet[0..8])
|
||||
//Normal: C=30 S=Y A= 1A A0 41 AD 02 P(10)= 7F 7F 1F 19 00 00 1E 00 AB FF
|
||||
// packet[0]=THR, packet[1]=ST, packet[2]=unk, packet[3]=unk, packet[6]=first rf channel, packet[8]=unk, packet[9]=sum(packet[0..8])
|
||||
//Bound : C=18 S=Y A= AA BB CC DD EE P(10)= 1A A0 01 41 AD 01 1E 00 79 41
|
||||
// packet[0..2]=tx_addr, packet[3..5]=rx_addr, packet[6]=first rf channel, packet[8]=unk, packet[9]=sum(packet[0..8])
|
||||
// sent every 12 packets in normal mode, but is it really needed if the car loose power then you need to rebind...
|
||||
//Packet period around 5ms with a large jitter
|
||||
|
||||
memset(&packet[3], 0x00, 7);
|
||||
if(IS_BIND_IN_PROGRESS)
|
||||
{
|
||||
memcpy(&packet,rx_tx_addr,3);
|
||||
packet[6] = hopping_frequency[0];
|
||||
packet[8] = 0x78; //??? packet type?
|
||||
}
|
||||
else
|
||||
{
|
||||
XN297_Hopping(hopping_frequency_no);
|
||||
hopping_frequency_no++;
|
||||
hopping_frequency_no &= 3;
|
||||
|
||||
packet[0] = convert_channel_8b(THROTTLE);
|
||||
packet[1] = convert_channel_8b(AILERON);
|
||||
packet[2] = 0x1F; //??? additional channel?
|
||||
packet[3] = 0x19; //??? additional channel?
|
||||
packet[6] = hopping_frequency[0];
|
||||
packet[8] = 0xAB; //??? packet type?
|
||||
}
|
||||
for(uint8_t i=0;i<EAZYRC_PAYLOAD_SIZE-1;i++)
|
||||
packet[9] += packet[i];
|
||||
// Send
|
||||
XN297_SetPower();
|
||||
XN297_SetTxRxMode(TX_EN);
|
||||
XN297_WritePayload(packet, EAZYRC_PAYLOAD_SIZE);
|
||||
#ifdef DEBUG_SERIAL
|
||||
for(uint8_t i=0; i < len; i++)
|
||||
debug("%02X ", packet[i]);
|
||||
debugln();
|
||||
#endif
|
||||
}
|
||||
|
||||
static void __attribute__((unused)) EAZYRC_initialize_txid()
|
||||
{
|
||||
rx_tx_addr[1] = rx_tx_addr[3];
|
||||
hopping_frequency[0] = (rx_tx_addr[3]%20) + 0x1E; // Wild guess... First channel between 30 and 49so a full range of 30 to 79
|
||||
#ifdef FORCE_EAZYRC_ORIGINAL_ID
|
||||
rx_tx_addr[0] = 0x1A;
|
||||
rx_tx_addr[1] = 0xA0;
|
||||
rx_tx_addr[2] = 0x01;
|
||||
hopping_frequency[0] = 0x1E;
|
||||
#endif
|
||||
rx_tx_addr[2] = 0x01; // Not sure if this is needed...
|
||||
for(uint8_t i=1; i<EAZYRC_RF_NUM_CHANNELS; i++)
|
||||
hopping_frequency[i] = hopping_frequency[0] + 10*i;
|
||||
}
|
||||
|
||||
static void __attribute__((unused)) EAZYRC_RF_init()
|
||||
{
|
||||
XN297_Configure(XN297_CRCEN, XN297_SCRAMBLED, XN297_1M);
|
||||
XN297_SetTXAddr((uint8_t*)"\xAA\xBB\xCC\xDD\xEE", 5);
|
||||
XN297_SetRXAddr((uint8_t*)"\xAA\xBB\xCC\xDD\xEE", EAZYRC_PAYLOAD_SIZE);
|
||||
XN297_RFChannel(EAZYRC_BIND_CHANNEL);
|
||||
}
|
||||
|
||||
uint16_t EAZYRC_callback()
|
||||
{
|
||||
uint8_t rf,n;
|
||||
uint16_t addr;
|
||||
switch(phase)
|
||||
{
|
||||
case EAZYRC_BINDTX:
|
||||
if(XN297_IsRX())
|
||||
{
|
||||
//Example: TX: C=18 S=Y A= AA BB CC DD EE P(10)= 1A A0 01 00 00 00 1E 00 78 51
|
||||
// packet[0..2]=tx_addr, packet[6]=first rf channel, packet[8]=unk, packet[9]=sum(packet[0..8])
|
||||
// RX: C=18 S=Y A= AA BB CC DD EE P(10)= 41 AD 01 1A A0 01 1E 00 87 4F
|
||||
// packet[0..2]=rx_addr, packet[3..5]=tx_addr, packet[6]=first rf channel, packet[8]=unk but swapped, packet[9]=sum(packet[0..8])
|
||||
XN297_ReadPayload(packet_in, EAZYRC_PAYLOAD_SIZE);
|
||||
#ifdef DEBUG_SERIAL
|
||||
for(uint8_t i=0; i < EAZYRC_PAYLOAD_SIZE; i++)
|
||||
debug("%02X ", packet_in[i]);
|
||||
debugln();
|
||||
#endif
|
||||
//could check the validity of the packet by looking at the sum...
|
||||
if(memcmp(&packet_in[3],&rx_tx_addr,3)==0)
|
||||
{//TX ID match, TX addr to use: 1A A0 41 AD 02
|
||||
rx_tx_addr[4] = rx_tx_addr[2] + packet_in[2]; //wild guess
|
||||
rx_tx_addr[2] = packet_in[0];
|
||||
rx_tx_addr[3] = packet_in[1];
|
||||
BIND_DONE;
|
||||
XN297_SetTxRxMode(TXRX_OFF);
|
||||
XN297_SetTXAddr(rx_tx_addr, 5);
|
||||
phase = EAZYRC_DATA;
|
||||
return 5000;
|
||||
}
|
||||
}
|
||||
XN297_SetTxRxMode(TXRX_OFF);
|
||||
EAZYRC_send_packet();
|
||||
phase++;
|
||||
return 1000;
|
||||
case EAZYRC_BINDRX:
|
||||
//Wait for the packet transmission to finish
|
||||
while(XN297_IsPacketSent()==false);
|
||||
//Switch to RX
|
||||
XN297_SetTxRxMode(TXRX_OFF);
|
||||
XN297_SetTxRxMode(RX_EN);
|
||||
phase = EAZYRC_BINDTX;
|
||||
return 10000;
|
||||
case EAZYRC_DATA:
|
||||
#ifdef MULTI_SYNC
|
||||
telemetry_set_input_sync(EAZYRC_PACKET_PERIOD);
|
||||
#endif
|
||||
EAZYRC_send_packet();
|
||||
break;
|
||||
}
|
||||
return EAZYRC_PACKET_PERIOD;
|
||||
}
|
||||
|
||||
void EAZYRC_init()
|
||||
{
|
||||
BIND_IN_PROGRESS;
|
||||
EAZYRC_initialize_txid();
|
||||
EAZYRC_RF_init();
|
||||
phase = EAZYRC_BINDTX;
|
||||
packet_count = 0;
|
||||
hopping_frequency_no = 0;
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -66,8 +66,10 @@ static void __attribute__((unused)) HISKY_RF_init()
|
||||
NRF24L01_WriteRegisterMulti(NRF24L01_0A_RX_ADDR_P0, rx_tx_addr, 5);
|
||||
NRF24L01_WriteRegisterMulti(NRF24L01_10_TX_ADDR, rx_tx_addr, 5);
|
||||
NRF24L01_WriteReg(NRF24L01_11_RX_PW_P0, 10); // payload size = 10
|
||||
#ifndef MULTI_AIR
|
||||
if(sub_protocol==HK310)
|
||||
NRF24L01_SetBitrate(NRF24L01_BR_250K); // 250Kbps
|
||||
#endif
|
||||
}
|
||||
|
||||
// HiSky channel sequence: AILE ELEV THRO RUDD GEAR PITCH, channel data value is from 0 to 1000
|
||||
@@ -92,6 +94,13 @@ static void __attribute__((unused)) HISKY_build_ch_data()
|
||||
uint16_t HISKY_callback()
|
||||
{
|
||||
phase++;
|
||||
#ifdef MULTI_AIR
|
||||
if(sub_protocol==HK310)
|
||||
{
|
||||
SUB_PROTO_INVALID;
|
||||
return 10000;
|
||||
}
|
||||
#else
|
||||
if(sub_protocol==HK310)
|
||||
switch(phase)
|
||||
{
|
||||
@@ -132,6 +141,7 @@ uint16_t HISKY_callback()
|
||||
phase=8;
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
switch(phase)
|
||||
{
|
||||
case 1:
|
||||
@@ -195,6 +205,7 @@ uint16_t HISKY_callback()
|
||||
static void __attribute__((unused)) HISKY_initialize_tx_id()
|
||||
{
|
||||
//Generate frequency hopping table
|
||||
#ifndef MULTI_AIR
|
||||
if(sub_protocol==HK310)
|
||||
{
|
||||
// for HiSky surface protocol, the transmitter always generates hop channels in sequential order.
|
||||
@@ -204,10 +215,11 @@ static void __attribute__((unused)) HISKY_initialize_tx_id()
|
||||
hopping_frequency[i]=hopping_frequency_no++; // Sequential order hop channels...
|
||||
}
|
||||
else
|
||||
calc_fh_channels(HISKY_FREQUENCE_NUM);
|
||||
#endif
|
||||
// HiSky air protocol uses TX id as an address for nRF24L01, and uses frequency hopping sequence
|
||||
// which does not depend on this id and is passed explicitly in binding sequence. So we are free
|
||||
// to generate this sequence as we wish. It should be in the range [02..77]
|
||||
calc_fh_channels(HISKY_FREQUENCE_NUM);
|
||||
}
|
||||
|
||||
void HISKY_init()
|
||||
|
||||
@@ -63,7 +63,7 @@ enum {
|
||||
KN_FLAG_DR = 0x01, // Dual Rate: 1 - full range
|
||||
KN_FLAG_TH = 0x02, // Throttle Hold: 1 - hold
|
||||
KN_FLAG_IDLEUP = 0x04, // Idle up: 1 - 3D
|
||||
KN_FLAG_RES1 = 0x08,
|
||||
KN_FLAG_RES1 = 0x08, // HoverDebugging
|
||||
KN_FLAG_RES2 = 0x10,
|
||||
KN_FLAG_RES3 = 0x20,
|
||||
KN_FLAG_GYRO3 = 0x40, // 0 - 6G mode, 1 - 3G mode
|
||||
@@ -141,19 +141,13 @@ static void __attribute__((unused)) kn_update_packet_control_data()
|
||||
packet[8] = convert_channel_16b_limit(CH9,0,200); // 0x64; // T
|
||||
packet[9] = convert_channel_16b_limit(CH10,0,200); // 0x64; // A
|
||||
packet[10] = convert_channel_16b_limit(CH11,0,200); // 0x64; // E
|
||||
packet[11] = 0x64; // R
|
||||
packet[11] = convert_channel_16b_limit(CH12,0,200); // 0x64; // R
|
||||
|
||||
flags=0;
|
||||
if (CH5_SW)
|
||||
flags = KN_FLAG_DR;
|
||||
if (CH6_SW)
|
||||
flags |= KN_FLAG_TH;
|
||||
if (CH7_SW)
|
||||
flags |= KN_FLAG_IDLEUP;
|
||||
if (CH8_SW)
|
||||
flags |= KN_FLAG_GYRO3;
|
||||
|
||||
packet[12] = flags;
|
||||
packet[12] = GET_FLAG(CH5_SW, KN_FLAG_DR)
|
||||
|GET_FLAG(CH6_SW, KN_FLAG_TH)
|
||||
|GET_FLAG(CH7_SW, KN_FLAG_IDLEUP)
|
||||
|GET_FLAG(CH8_SW, KN_FLAG_GYRO3)
|
||||
|GET_FLAG(CH13_SW, KN_FLAG_RES1); //Hover debugging
|
||||
|
||||
packet[13] = 0x00;
|
||||
if(sub_protocol==WLTOYS)
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
//Kyosho constants & variables
|
||||
#define KYOSHO_BIND_COUNT 2500
|
||||
|
||||
#ifndef MULTI_AIR
|
||||
static void __attribute__((unused)) KYOSHO_send_packet()
|
||||
{
|
||||
//ID
|
||||
@@ -88,6 +89,7 @@ static void __attribute__((unused)) KYOSHO_send_packet()
|
||||
#endif
|
||||
A7105_WriteData(37, rf_ch_num);
|
||||
}
|
||||
#endif //MULTI_AIR
|
||||
|
||||
static void __attribute__((unused)) KYOSHO_hype_send_packet()
|
||||
{
|
||||
@@ -165,7 +167,11 @@ uint16_t KYOSHO_callback()
|
||||
if(sub_protocol==KYOSHO_HYPE)
|
||||
KYOSHO_hype_send_packet();
|
||||
else //FHSS && SYNCRO
|
||||
#ifndef MULTI_AIR
|
||||
KYOSHO_send_packet();
|
||||
#else
|
||||
SUB_PROTO_INVALID;
|
||||
#endif
|
||||
return packet_period;
|
||||
}
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
40,WFLY,WFR0x
|
||||
41,BUGS
|
||||
42,BUGSMINI,BUGSMINI,BUGS3H
|
||||
43,Traxxas,RX6519
|
||||
43,Traxxas,TQ
|
||||
44,NCC1701
|
||||
45,E01X,E012,E015
|
||||
46,V911S,V911S,E119
|
||||
@@ -58,8 +58,8 @@
|
||||
58,FX,816,620,9630
|
||||
59,Bayang_RX,Multi,CPPM
|
||||
60,Pelikan,Pro,Lite,SCX24
|
||||
61,Tiger
|
||||
62,XK,X450,X420
|
||||
61,EazyRC
|
||||
62,XK,X450,X420,Cars
|
||||
63,XN_DUMP,250K,1M,2M,AUTO
|
||||
64,FrskyX2,CH_16,CH_8,EU_16,EU_8,Cloned
|
||||
65,FrSkyR9,915MHz,868MHz,915_8ch,868_8ch,FCC,--,FCC_8ch,--_8ch
|
||||
@@ -71,9 +71,9 @@
|
||||
71,JJRC345,JJRC345,SkyTmblr
|
||||
72,Q90C
|
||||
73,Kyosho,FHSS,Hype
|
||||
74,RadioLink,Surface,Air,DumboRC
|
||||
74,RadioLink,Surface,Air,DumboRC,RC4G
|
||||
75,---
|
||||
76,Realacc,R11
|
||||
76,Realacc
|
||||
77,OMP
|
||||
78,M-Link
|
||||
79,WFLY,RF20x
|
||||
@@ -93,3 +93,4 @@
|
||||
94,Scorpio
|
||||
95,BlueFly
|
||||
96,BumbleB
|
||||
97,SGF22
|
||||
|
||||
@@ -78,10 +78,9 @@ 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_FX[] ="FX";
|
||||
const char STR_FX[] ="FX";
|
||||
const char STR_BAYANG_RX[] ="BayanRX";
|
||||
const char STR_PELIKAN[] ="Pelikan";
|
||||
const char STR_TIGER[] ="Tiger";
|
||||
const char STR_XK[] ="XK";
|
||||
const char STR_XN297DUMP[] ="XN297DP";
|
||||
const char STR_FRSKYR9[] ="FrSkyR9";
|
||||
@@ -108,6 +107,8 @@ const char STR_XERALL[] ="Xerall";
|
||||
const char STR_SCORPIO[] ="Scorpio";
|
||||
const char STR_BLUEFLY[] ="BlueFly";
|
||||
const char STR_BUMBLEB[] ="BumbleB";
|
||||
const char STR_SGF22[] ="SGF22";
|
||||
const char STR_EAZYRC[] ="EazyRC";
|
||||
|
||||
const char STR_SUBTYPE_FLYSKY[] = "\x04""Std\0""V9x9""V6x6""V912""CX20";
|
||||
const char STR_SUBTYPE_HUBSAN[] = "\x04""H107""H301""H501";
|
||||
@@ -146,7 +147,7 @@ const char STR_SUBTYPE_H83D[] = "\x07""Std\0 ""H20H\0 ""H20Mini""H30Min
|
||||
const char STR_SUBTYPE_CORONA[] = "\x05""V1\0 ""V2\0 ""FD V3";
|
||||
const char STR_SUBTYPE_HITEC[] = "\x07""Optima\0""Opt Hub""Minima\0";
|
||||
const char STR_SUBTYPE_BUGS_MINI[] = "\x06""Std\0 ""Bugs3H";
|
||||
const char STR_SUBTYPE_TRAXXAS[] = "\x04""6519";
|
||||
const char STR_SUBTYPE_TRAXXAS[] = "\x02""TQ";
|
||||
const char STR_SUBTYPE_E01X[] = "\x05""E012\0""E015\0";
|
||||
const char STR_SUBTYPE_GD00X[] = "\x05""GD_V1""GD_V2";
|
||||
const char STR_SUBTYPE_REDPINE[] = "\x04""Fast""Slow";
|
||||
@@ -157,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_ESKY150V2[] = "\x05""150V2";
|
||||
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_ESKY[] = "\x03""Std""ET4";
|
||||
const char STR_SUBTYPE_PROPEL[] = "\x04""74-Z";
|
||||
@@ -167,13 +168,12 @@ const char STR_SUBTYPE_WFLY2[] = "\x05""RF20x";
|
||||
const char STR_SUBTYPE_HOTT[] = "\x07""Sync\0 ""No_Sync";
|
||||
const char STR_SUBTYPE_PELIKAN[] = "\x05""Pro\0 ""Lite\0""SCX24";
|
||||
const char STR_SUBTYPE_V761[] = "\x05""3ch\0 ""4ch\0 ""TOPRC";
|
||||
const char STR_SUBTYPE_RLINK[] = "\x07""Surface""Air\0 ""DumboRC";
|
||||
const char STR_SUBTYPE_REALACC[] = "\x03""R11";
|
||||
const char STR_SUBTYPE_RLINK[] = "\x07""Surface""Air\0 ""DumboRC""RC4G\0 ";
|
||||
const char STR_SUBTYPE_KYOSHO[] = "\x04""FHSS""Hype";
|
||||
const char STR_SUBTYPE_KYOSHO2[] = "\x05""KT-17";
|
||||
const char STR_SUBTYPE_FUTABA[] = "\x05""SFHSS";
|
||||
const char STR_SUBTYPE_JJRC345[] = "\x08""JJRC345\0""SkyTmblr";
|
||||
const char STR_SUBTYPE_MOULKG[] = "\x06""Analog""Digit\0";
|
||||
const char STR_SUBTYPE_MOULDKG[] = "\x06""Analog""Digit\0";
|
||||
const char STR_SUBTYPE_KF606[] = "\x06""KF606\0""MIG320""ZCZ50\0";
|
||||
const char STR_SUBTYPE_E129[] = "\x04""E129""C186";
|
||||
const char STR_SUBTYPE_FX[] = "\x04""816\0""620\0""9630";
|
||||
@@ -278,6 +278,9 @@ const mm_protocol_definition multi_protocols[] = {
|
||||
#if defined(E129_CYRF6936_INO)
|
||||
{PROTO_E129, STR_E129, STR_SUBTYPE_E129, 2, OPTION_NONE, 0, 0, SW_CYRF, E129_init, E129_callback },
|
||||
#endif
|
||||
#if defined(EAZYRC_NRF24L01_INO)
|
||||
{PROTO_EAZYRC, STR_EAZYRC, NO_SUBTYPE, 0, OPTION_NONE, 0, 0, SW_NRF, EAZYRC_init, EAZYRC_callback },
|
||||
#endif
|
||||
#if defined(ESKY_NRF24L01_INO)
|
||||
{PROTO_ESKY, STR_ESKY, STR_SUBTYPE_ESKY, 2, OPTION_NONE, 0, 1, SW_NRF, ESKY_init, ESKY_callback },
|
||||
#endif
|
||||
@@ -397,7 +400,7 @@ const mm_protocol_definition multi_protocols[] = {
|
||||
{PROTO_MLINK, STR_MLINK, NO_SUBTYPE, 0, OPTION_NONE, 1, 0, SW_CYRF, MLINK_init, MLINK_callback },
|
||||
#endif
|
||||
#if defined(MOULDKG_NRF24L01_INO)
|
||||
{PROTO_MOULDKG, STR_MOULDKG, STR_SUBTYPE_MOULKG, 2, OPTION_OPTION, 0, 0, SW_NRF, MOULDKG_init, MOULDKG_callback },
|
||||
{PROTO_MOULDKG, STR_MOULDKG, STR_SUBTYPE_MOULDKG, 2, OPTION_OPTION, 0, 0, SW_NRF, MOULDKG_init, MOULDKG_callback },
|
||||
#endif
|
||||
#if defined(MT99XX_CCNRF_INO)
|
||||
{PROTO_MT99XX, STR_MT99XX, STR_SUBTYPE_MT99, 8, OPTION_NONE, 0, 0, SW_NRF, MT99XX_init, MT99XX_callback },
|
||||
@@ -430,10 +433,10 @@ const mm_protocol_definition multi_protocols[] = {
|
||||
{PROTO_Q90C, STR_Q90C, NO_SUBTYPE, 0, OPTION_RFTUNE, 0, 0, SW_NRF, Q90C_init, Q90C_callback },
|
||||
#endif
|
||||
#if defined(RLINK_CC2500_INO)
|
||||
{PROTO_RLINK, STR_RLINK, STR_SUBTYPE_RLINK, 3, OPTION_RFTUNE, 0, 0, SW_CC2500, RLINK_init, RLINK_callback },
|
||||
{PROTO_RLINK, STR_RLINK, STR_SUBTYPE_RLINK, 4, OPTION_RFTUNE, 0, 0, SW_CC2500, RLINK_init, RLINK_callback },
|
||||
#endif
|
||||
#if defined(REALACC_NRF24L01_INO)
|
||||
{PROTO_REALACC, STR_REALACC, STR_SUBTYPE_REALACC, 1, OPTION_NONE, 0, 0, SW_NRF, REALACC_init, REALACC_callback },
|
||||
{PROTO_REALACC, STR_REALACC, NO_SUBTYPE, 0, OPTION_NONE, 0, 0, SW_NRF, REALACC_init, REALACC_callback },
|
||||
#endif
|
||||
#if defined(REDPINE_CC2500_INO)
|
||||
{PROTO_REDPINE, STR_REDPINE, STR_SUBTYPE_REDPINE, 2, OPTION_RFTUNE, 0, 0, SW_CC2500, REDPINE_init, REDPINE_callback },
|
||||
@@ -444,6 +447,9 @@ const mm_protocol_definition multi_protocols[] = {
|
||||
#if defined(SCORPIO_CYRF6936_INO)
|
||||
{PROTO_SCORPIO, STR_SCORPIO, NO_SUBTYPE, 0, OPTION_NONE, 0, 0, SW_CYRF, SCORPIO_init, SCORPIO_callback },
|
||||
#endif
|
||||
#if defined(SGF22_NRF24L01_INO)
|
||||
{PROTO_SGF22, STR_SGF22, NO_SUBTYPE, 0, OPTION_NONE, 0, 0, SW_NRF, SGF22_init, SGF22_callback },
|
||||
#endif
|
||||
#if defined(SHENQI_NRF24L01_INO)
|
||||
{PROTO_SHENQI, STR_SHENQI, NO_SUBTYPE, 0, OPTION_NONE, 0, 0, SW_NRF, SHENQI_init, SHENQI_callback },
|
||||
#endif
|
||||
@@ -456,9 +462,6 @@ const mm_protocol_definition multi_protocols[] = {
|
||||
#if defined(SYMAX_NRF24L01_INO)
|
||||
{PROTO_SYMAX, STR_SYMAX, STR_SUBTYPE_SYMAX, 2, OPTION_NONE, 0, 0, SW_NRF, SYMAX_init, SYMAX_callback },
|
||||
#endif
|
||||
#if defined(TIGER_NRF24L01_INO)
|
||||
{PROTO_TIGER, STR_TIGER, NO_SUBTYPE, 0, OPTION_NONE, 0, 0, SW_NRF, TIGER_init, TIGER_callback },
|
||||
#endif
|
||||
#if defined(TRAXXAS_CYRF6936_INO)
|
||||
{PROTO_TRAXXAS, STR_TRAXXAS, STR_SUBTYPE_TRAXXAS, 1, OPTION_NONE, 0, 0, SW_CYRF, TRAXXAS_init, TRAXXAS_callback },
|
||||
#endif
|
||||
@@ -485,7 +488,7 @@ const mm_protocol_definition multi_protocols[] = {
|
||||
{PROTO_XERALL, STR_XERALL, NO_SUBTYPE, 0, OPTION_NONE, 0, 0, SW_NRF, XERALL_init, XERALL_callback },
|
||||
#endif
|
||||
#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
|
||||
#if defined(XN297DUMP_NRF24L01_INO)
|
||||
{PROTO_XN297DUMP, STR_XN297DUMP, STR_SUBTYPE_XN297DUMP, 6, OPTION_RFCHAN, 0, 0, SW_NRF, XN297Dump_init, XN297Dump_callback },
|
||||
|
||||
@@ -18,8 +18,8 @@
|
||||
//******************
|
||||
#define VERSION_MAJOR 1
|
||||
#define VERSION_MINOR 3
|
||||
#define VERSION_REVISION 3
|
||||
#define VERSION_PATCH_LEVEL 47
|
||||
#define VERSION_REVISION 4
|
||||
#define VERSION_PATCH_LEVEL 0
|
||||
|
||||
#define MODE_SERIAL 0
|
||||
|
||||
@@ -89,7 +89,7 @@ enum PROTOCOLS
|
||||
PROTO_FX = 58, // =>NRF24L01
|
||||
PROTO_BAYANG_RX = 59, // =>NRF24L01
|
||||
PROTO_PELIKAN = 60, // =>A7105
|
||||
PROTO_TIGER = 61, // =>NRF24L01
|
||||
PROTO_EAZYRC = 61, // =>NRF24L01
|
||||
PROTO_XK = 62, // =>NRF24L01
|
||||
PROTO_XN297DUMP = 63, // =>NRF24L01
|
||||
PROTO_FRSKYX2 = 64, // =>CC2500
|
||||
@@ -124,6 +124,7 @@ enum PROTOCOLS
|
||||
PROTO_SCORPIO = 94, // =>CYRF6936
|
||||
PROTO_BLUEFLY = 95, // =>CC2500 & NRF24L01
|
||||
PROTO_BUMBLEB = 96, // =>CC2500 & NRF24L01
|
||||
PROTO_SGF22 = 97, // =>NRF24L01
|
||||
|
||||
|
||||
PROTO_NANORF = 126, // =>NRF24L01
|
||||
@@ -359,7 +360,7 @@ enum REDPINE
|
||||
};
|
||||
enum TRAXXAS
|
||||
{
|
||||
RX6519 = 0,
|
||||
TRAXXAS_TQ = 0,
|
||||
};
|
||||
enum ESKY150
|
||||
{
|
||||
@@ -375,6 +376,7 @@ enum XK
|
||||
{
|
||||
X450 = 0,
|
||||
X420 = 1,
|
||||
XK_CARS = 2,
|
||||
};
|
||||
enum XN297DUMP
|
||||
{
|
||||
@@ -450,6 +452,7 @@ enum RLINK
|
||||
RLINK_SURFACE = 0,
|
||||
RLINK_AIR = 1,
|
||||
RLINK_DUMBORC = 2,
|
||||
RLINK_RC4G = 3,
|
||||
};
|
||||
enum MOULDKG
|
||||
{
|
||||
@@ -923,7 +926,6 @@ Serial: 100000 Baud 8e2 _ xxxx xxxx p --
|
||||
FX 58
|
||||
BAYANG_RX 59
|
||||
PELIKAN 60
|
||||
TIGER 61
|
||||
XK 62
|
||||
XN297DUMP 63
|
||||
FRSKYX2 64
|
||||
@@ -1104,7 +1106,7 @@ Serial: 100000 Baud 8e2 _ xxxx xxxx p --
|
||||
RED_FAST 0
|
||||
RED_SLOW 1
|
||||
sub_protocol==TRAXXAS
|
||||
RX6519 0
|
||||
TQ 0
|
||||
sub_protocol==ESKY150
|
||||
ESKY150_4CH 0
|
||||
ESKY150_7CH 1
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//#define PELIKAN_LITE_FORCE_ID
|
||||
#define PELIKAN_LITE_FORCE_HOP // hop sequence creation is unknown
|
||||
//#define PELIKAN_SCX24_FORCE_ID
|
||||
#define PELIKAN_SCX24_FORCE_HOP // hop sequence creation is unknown
|
||||
//#define PELIKAN_SCX24_FORCE_HOP // hop sequence creation is unknown
|
||||
|
||||
#define PELIKAN_BIND_COUNT 400 // 3sec
|
||||
#define PELIKAN_BIND_RF 0x3C
|
||||
@@ -30,6 +30,7 @@
|
||||
#define PELIKAN_PACKET_PERIOD 7980
|
||||
#define PELIKAN_LITE_PACKET_PERIOD 18000
|
||||
#define PELIKAN_SCX24_PACKET_PERIOD 15069
|
||||
#define PELIKAN_SCX_HOP_LIMIT 90
|
||||
|
||||
static void __attribute__((unused)) pelikan_build_packet()
|
||||
{
|
||||
@@ -37,9 +38,11 @@ static void __attribute__((unused)) pelikan_build_packet()
|
||||
uint8_t sum;
|
||||
uint16_t channel;
|
||||
|
||||
#ifndef MULTI_AIR
|
||||
if(sub_protocol == PELIKAN_SCX24)
|
||||
packet[0] = 0x11;
|
||||
else //PELIKAN_PRO & PELIKAN_LITE
|
||||
#endif
|
||||
packet[0] = 0x15;
|
||||
if(IS_BIND_IN_PROGRESS)
|
||||
{
|
||||
@@ -48,6 +51,7 @@ static void __attribute__((unused)) pelikan_build_packet()
|
||||
packet[4] = rx_tx_addr[2];
|
||||
packet[5] = rx_tx_addr[3];
|
||||
|
||||
#ifndef MULTI_AIR
|
||||
if(sub_protocol == PELIKAN_SCX24)
|
||||
{
|
||||
packet[1] = 0x65; //??
|
||||
@@ -55,6 +59,7 @@ static void __attribute__((unused)) pelikan_build_packet()
|
||||
packet[7] = 0xAA; //??
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{//PELIKAN_PRO & PELIKAN_LITE
|
||||
packet[1] = 0x04; //version??
|
||||
if(sub_protocol==PELIKAN_PRO)
|
||||
@@ -70,6 +75,7 @@ static void __attribute__((unused)) pelikan_build_packet()
|
||||
{
|
||||
//ID
|
||||
packet[1] = rx_tx_addr[0];
|
||||
#ifndef MULTI_AIR
|
||||
if(sub_protocol == PELIKAN_SCX24)
|
||||
{
|
||||
//ID
|
||||
@@ -95,6 +101,7 @@ static void __attribute__((unused)) pelikan_build_packet()
|
||||
packet_length = 14;
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{//PELIKAN_PRO & PELIKAN_LITE
|
||||
//ID
|
||||
packet[7] = rx_tx_addr[1];
|
||||
@@ -158,6 +165,13 @@ static void __attribute__((unused)) pelikan_build_packet()
|
||||
|
||||
uint16_t PELIKAN_callback()
|
||||
{
|
||||
#ifdef MULTI_AIR
|
||||
if(sub_protocol == PELIKAN_SCX24)
|
||||
{
|
||||
SUB_PROTO_INVALID;
|
||||
return 10000;
|
||||
}
|
||||
#endif
|
||||
if(phase==0)
|
||||
{
|
||||
#ifndef FORCE_PELIKAN_TUNING
|
||||
@@ -172,10 +186,12 @@ uint16_t PELIKAN_callback()
|
||||
A7105_Strobe(A7105_STANDBY);
|
||||
if(sub_protocol==PELIKAN_PRO)
|
||||
A7105_WriteReg(A7105_03_FIFOI,0x28); //????
|
||||
else if(sub_protocol==PELIKAN_SCX24)
|
||||
A7105_WriteReg(A7105_03_FIFOI,0x0D);
|
||||
else//PELIKAN_LITE
|
||||
else if(sub_protocol==PELIKAN_LITE)
|
||||
A7105_WriteID(MProtocol_id);
|
||||
#ifndef MULTI_AIR
|
||||
else // PELIKAN_SCX24
|
||||
A7105_WriteReg(A7105_03_FIFOI,0x0D);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
#ifdef MULTI_SYNC
|
||||
@@ -216,6 +232,82 @@ static uint8_t pelikan_firstCh(uint8_t u, uint8_t l)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static uint8_t pelikan_firstCh_scx(uint8_t i, uint8_t j)
|
||||
{
|
||||
uint8_t ch;
|
||||
switch (j) {
|
||||
case 0:
|
||||
ch = 30;
|
||||
break;
|
||||
case 1:
|
||||
case 2:
|
||||
ch = (i * 4) + 42;
|
||||
break;
|
||||
case 3:
|
||||
ch = (i * 2) + 36;
|
||||
break;
|
||||
case 4:
|
||||
ch = (i * 8) + 54;
|
||||
break;
|
||||
case 5:
|
||||
ch = 30;
|
||||
break;
|
||||
}
|
||||
|
||||
if (ch > PELIKAN_SCX_HOP_LIMIT)
|
||||
{
|
||||
do
|
||||
{
|
||||
ch -= 62;
|
||||
} while (ch > PELIKAN_SCX_HOP_LIMIT);
|
||||
}
|
||||
|
||||
switch (ch) {
|
||||
case 48:
|
||||
if (j == 3)
|
||||
ch += 18;
|
||||
else if (j == 4)
|
||||
ch += 20;
|
||||
else
|
||||
ch += 40;
|
||||
break;
|
||||
case 40:
|
||||
if (j == 4)
|
||||
ch += 18;
|
||||
break;
|
||||
case 52:
|
||||
if (j < 3)
|
||||
ch -= 20;
|
||||
else if (j == 4)
|
||||
ch -= 10;
|
||||
break;
|
||||
case 66:
|
||||
if (j < 3)
|
||||
ch += 18;
|
||||
else if (j == 4)
|
||||
ch -= 22;
|
||||
break;
|
||||
case 72:
|
||||
if (j < 3)
|
||||
ch -= 10;
|
||||
else if (j ==3)
|
||||
ch -= 20;
|
||||
else if (j == 4)
|
||||
ch -= 36;
|
||||
break;
|
||||
case 74:
|
||||
if (j == 4)
|
||||
ch -= 20;
|
||||
break;
|
||||
case 86:
|
||||
if (j == 4)
|
||||
ch -= 48;
|
||||
break;
|
||||
}
|
||||
|
||||
return ch;
|
||||
}
|
||||
|
||||
static uint8_t pelikan_adjust_value(uint8_t value, uint8_t addition, uint8_t limit)
|
||||
{
|
||||
uint8_t i;
|
||||
@@ -234,6 +326,10 @@ static uint8_t pelikan_adjust_value(uint8_t value, uint8_t addition, uint8_t lim
|
||||
value += addition;
|
||||
i++;
|
||||
}
|
||||
if (value == 72) {
|
||||
value += addition;
|
||||
i++;
|
||||
}
|
||||
}
|
||||
while (i > 0);
|
||||
|
||||
@@ -278,6 +374,121 @@ static void __attribute__((unused)) pelikan_init_hop()
|
||||
debugln("");
|
||||
}
|
||||
|
||||
#ifndef MULTI_AIR
|
||||
|
||||
const uint8_t PROGMEM scx_ch_map[4][PELIKAN_NUM_RF_CHAN] =
|
||||
{
|
||||
{0,1,2,26,27,28,23,24,25,20,21,22,17,18,19,14,15,16,11,12,13,8,9,10,5,6,7,4,3},
|
||||
{0,1,2,28,25,26,27,24,21,22,23,20,17,18,19,16,13,14,15,12,9,10,11,8,5,6,7,3,4},
|
||||
{0,1,27,28,25,26,23,24,21,22,19,20,17,18,15,16,13,14,11,12,9,10,7,8,5,6,3,4,2},
|
||||
{0,1,28,1,4,2,23,26,22,24,27,25,17,20,16,18,21,19,11,14,10,12,15,13,27,8,6,7,9}
|
||||
};
|
||||
|
||||
static void pelikan_shuffle(uint8_t j)
|
||||
{
|
||||
uint8_t temp[PELIKAN_NUM_RF_CHAN];
|
||||
for (uint8_t i = 0; i < PELIKAN_NUM_RF_CHAN; i++)
|
||||
temp[i] = hopping_frequency[pgm_read_byte_near(&scx_ch_map[j-1][i])];
|
||||
|
||||
for (uint8_t i = 0; i < PELIKAN_NUM_RF_CHAN; i++)
|
||||
hopping_frequency[i] = temp[i];
|
||||
}
|
||||
|
||||
static void __attribute__((unused)) pelikan_init_hop_scx()
|
||||
{
|
||||
rx_tx_addr[0] = 0x10;
|
||||
rx_tx_addr[1] = (rx_tx_addr[1] + RX_num) % 192;
|
||||
debugln("TX[0]: %02X TX[1]: %02X", rx_tx_addr[0], rx_tx_addr[1]);
|
||||
|
||||
uint8_t high = (rx_tx_addr[1]>>4);
|
||||
uint8_t low = rx_tx_addr[1] & 0x0F;
|
||||
int16_t i = (high * 10) + low - 23;
|
||||
uint8_t j = 0;
|
||||
|
||||
if (i > 0)
|
||||
j = 1;
|
||||
|
||||
if (i > 24)
|
||||
{
|
||||
do
|
||||
{
|
||||
i -= 24;
|
||||
j++;
|
||||
} while (i > 24);
|
||||
}
|
||||
|
||||
debugln("H: %02X L: %02X I: %02X J: %02X", high, low, i, j);
|
||||
|
||||
uint8_t first_channel;
|
||||
uint8_t last_channel;
|
||||
uint8_t addition;
|
||||
|
||||
first_channel = pelikan_firstCh_scx(i, j);
|
||||
|
||||
if (j == 0)
|
||||
last_channel = 42 - (high * 10) - low;
|
||||
else
|
||||
last_channel = 42 - i + 1;
|
||||
|
||||
if (last_channel == 24)
|
||||
last_channel += 9;
|
||||
|
||||
if (last_channel == 36)
|
||||
last_channel -= 10;
|
||||
|
||||
if (j == 0)
|
||||
addition = (2 * i) + 54;
|
||||
else if (j == 5)
|
||||
addition = (2 * i) + 6;
|
||||
else
|
||||
addition = 56 - (2 * i);
|
||||
|
||||
hopping_frequency[0] = first_channel;
|
||||
for (uint8_t i = 1; i < PELIKAN_NUM_RF_CHAN; i++)
|
||||
{
|
||||
hopping_frequency[i] = pelikan_add(hopping_frequency[i-1], addition, PELIKAN_SCX_HOP_LIMIT);
|
||||
}
|
||||
|
||||
if (j > 0 && j < 5)
|
||||
pelikan_shuffle(j);
|
||||
|
||||
if (j == 2)
|
||||
{
|
||||
hopping_frequency[PELIKAN_NUM_RF_CHAN - 2] = last_channel;
|
||||
} else if (j == 4)
|
||||
{
|
||||
uint8_t t = (2 * i) + 36;
|
||||
if (t == 48)
|
||||
t += 18;
|
||||
if (t == 72)
|
||||
t -= 20;
|
||||
|
||||
hopping_frequency[1] = t;
|
||||
hopping_frequency[PELIKAN_NUM_RF_CHAN - 5] = last_channel;
|
||||
}
|
||||
else
|
||||
{
|
||||
hopping_frequency[PELIKAN_NUM_RF_CHAN - 1] = last_channel;
|
||||
}
|
||||
|
||||
#ifdef DEBUG_SERIAL
|
||||
for (uint8_t i = 0; i < PELIKAN_NUM_RF_CHAN; i++)
|
||||
debug("%02X ", hopping_frequency[i]);
|
||||
debugln("");
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef PELIKAN_SCX24_FORCE_HOP
|
||||
const uint8_t PROGMEM pelikan_scx24_hopp[][PELIKAN_NUM_RF_CHAN] = {
|
||||
/*TX1*/ { 0x1E,0x32,0x46,0x5A,0x44,0x58,0x2E,0x42,0x56,0x2C,0x40,0x54,0x2A,0x3E,0x52,0x28,0x3C,0x50,0x26,0x3A,0x4E,0x24,0x38,0x4C,0x22,0x36,0x4A,0x20,0x1A },
|
||||
/*TX2*/ { 0x2C,0x44,0x1E,0x52,0x56,0x22,0x3A,0x3E,0x34,0x4C,0x26,0x5A,0x50,0x2A,0x42,0x38,0x2E,0x46,0x20,0x54,0x4A,0x24,0x3C,0x32,0x28,0x40,0x58,0x1B,0x4E },
|
||||
/*TX3*/ { 0x3C,0x4C,0x1E,0x4A,0x5A,0x2C,0x58,0x2A,0x3A,0x56,0x28,0x38,0x26,0x36,0x46,0x34,0x44,0x54,0x42,0x52,0x24,0x50,0x22,0x32,0x4E,0x20,0x40,0x3E,0x17 },
|
||||
/*TX4*/ { 0x46,0x32,0x1E,0x58,0x44,0x5A,0x56,0x42,0x2E,0x54,0x40,0x2C,0x52,0x3E,0x2A,0x50,0x3C,0x28,0x4E,0x3A,0x26,0x4C,0x38,0x24,0x4A,0x36,0x22,0x20,0x1A }
|
||||
};
|
||||
#endif //PELIKAN_SCX24_FORCE_HOP
|
||||
|
||||
#endif //MULTI_AIR
|
||||
|
||||
#ifdef PELIKAN_FORCE_ID
|
||||
const uint8_t PROGMEM pelikan_hopp[][PELIKAN_NUM_RF_CHAN] = {
|
||||
{ 0x5A,0x46,0x32,0x6E,0x6C,0x58,0x44,0x42,0x40,0x6A,0x56,0x54,0x52,0x3E,0x68,0x66,0x64,0x50,0x3C,0x3A,0x38,0x62,0x4E,0x4C,0x5E,0x4A,0x36,0x5C,0x34 }
|
||||
@@ -289,14 +500,6 @@ const uint8_t PROGMEM pelikan_lite_hopp[][PELIKAN_NUM_RF_CHAN] = {
|
||||
{ 0x46,0x2A,0x3E,0x5A,0x5C,0x24,0x4E,0x32,0x54,0x26,0x2C,0x34,0x56,0x1E,0x3A,0x3C,0x50,0x4A,0x2E,0x42,0x20,0x52,0x28,0x22,0x44,0x58,0x36,0x38,0x4C }
|
||||
};
|
||||
#endif
|
||||
#ifdef PELIKAN_SCX24_FORCE_HOP
|
||||
const uint8_t PROGMEM pelikan_scx24_hopp[][PELIKAN_NUM_RF_CHAN] = {
|
||||
/*TX1*/ { 0x1E,0x32,0x46,0x5A,0x44,0x58,0x2E,0x42,0x56,0x2C,0x40,0x54,0x2A,0x3E,0x52,0x28,0x3C,0x50,0x26,0x3A,0x4E,0x24,0x38,0x4C,0x22,0x36,0x4A,0x20,0x1A },
|
||||
/*TX2*/ { 0x2C,0x44,0x1E,0x52,0x56,0x22,0x3A,0x3E,0x34,0x4C,0x26,0x5A,0x50,0x2A,0x42,0x38,0x2E,0x46,0x20,0x54,0x4A,0x24,0x3C,0x32,0x28,0x40,0x58,0x1B,0x4E },
|
||||
/*TX3*/ { 0x3C,0x4C,0x1E,0x4A,0x5A,0x2C,0x58,0x2A,0x3A,0x56,0x28,0x38,0x26,0x36,0x46,0x34,0x44,0x54,0x42,0x52,0x24,0x50,0x22,0x32,0x4E,0x20,0x40,0x3E,0x17 },
|
||||
/*TX4*/ { 0x46,0x32,0x1E,0x58,0x44,0x5A,0x56,0x42,0x2E,0x54,0x40,0x2C,0x52,0x3E,0x2A,0x50,0x3C,0x28,0x4E,0x3A,0x26,0x4C,0x38,0x24,0x4A,0x36,0x22,0x20,0x1A }
|
||||
};
|
||||
#endif
|
||||
|
||||
void PELIKAN_init()
|
||||
{
|
||||
@@ -343,8 +546,10 @@ void PELIKAN_init()
|
||||
A7105_WriteID(MProtocol_id);
|
||||
packet_period = PELIKAN_LITE_PACKET_PERIOD;
|
||||
}
|
||||
#ifndef MULTI_AIR
|
||||
else// if(sub_protocol==PELIKAN_SCX24)
|
||||
{
|
||||
pelikan_init_hop_scx();
|
||||
#if defined(PELIKAN_SCX24_FORCE_HOP)
|
||||
// Hop frequency table
|
||||
uint8_t num=rx_tx_addr[3] & 0x03;
|
||||
@@ -386,6 +591,7 @@ void PELIKAN_init()
|
||||
A7105_WriteReg(A7105_03_FIFOI,0x0D);
|
||||
packet_period = PELIKAN_SCX24_PACKET_PERIOD;
|
||||
}
|
||||
#endif //MULTI_AIR
|
||||
}
|
||||
|
||||
hopping_frequency_no = PELIKAN_NUM_RF_CHAN;
|
||||
|
||||
@@ -18,7 +18,11 @@
|
||||
|
||||
#include "iface_cc2500.h"
|
||||
|
||||
//#define RLINK_DEBUG
|
||||
//#define RLINK_DEBUG_TELEM
|
||||
|
||||
//#define RLINK_FORCE_ID
|
||||
//#define RLINK_RC4G_FORCE_ID
|
||||
|
||||
#define RLINK_TX_PACKET_LEN 33
|
||||
#define RLINK_RX_PACKET_LEN 15
|
||||
@@ -97,16 +101,70 @@ static void __attribute__((unused)) RLINK_hop()
|
||||
|
||||
static void __attribute__((unused)) RLINK_TXID_init()
|
||||
{
|
||||
#ifdef RLINK_RC4G_FORCE_ID
|
||||
//TODO: test any ID
|
||||
if(sub_protocol==RLINK_RC4G)
|
||||
{
|
||||
rx_tx_addr[1]=0x77;
|
||||
rx_tx_addr[2]=0x00;
|
||||
rx_tx_addr[3]=0x00;
|
||||
}
|
||||
#endif
|
||||
#ifdef RLINK_FORCE_ID
|
||||
//surface RC6GS
|
||||
memcpy(rx_tx_addr,"\x3A\x99\x22\x3A",RLINK_TX_ID_LEN);
|
||||
//air T8FB
|
||||
//memcpy(rx_tx_addr,"\xFC\x11\x0D\x20",RLINK_TX_ID_LEN);
|
||||
if(sub_protocol==RLINK_SURFACE)
|
||||
memcpy(rx_tx_addr,"\x3A\x99\x22\x3A",RLINK_TX_ID_LEN); //surface RC6GS
|
||||
else
|
||||
memcpy(rx_tx_addr,"\xFC\x11\x0D\x20",RLINK_TX_ID_LEN); //air T8FB
|
||||
#endif
|
||||
// channels order depend on ID
|
||||
RLINK_hop();
|
||||
if(sub_protocol!=RLINK_RC4G)
|
||||
RLINK_hop();
|
||||
else
|
||||
{//RLINK_RC4G
|
||||
// Find 2 unused channels
|
||||
// first channel is a multiple of 3 between 00 and 5D
|
||||
// second channel is a multiple of 3 between 63 and BD
|
||||
CC2500_Strobe(CC2500_SIDLE);
|
||||
CC2500_WriteReg(CC2500_17_MCSM1,0x3C);
|
||||
CC2500_Strobe(CC2500_SFRX);
|
||||
CC2500_SetTxRxMode(RX_EN);
|
||||
CC2500_Strobe(CC2500_SRX);
|
||||
delayMilliseconds(1); //wait for RX mode
|
||||
uint16_t val;
|
||||
uint8_t val_low = 0xFF;
|
||||
hopping_frequency[0] = 0x00;
|
||||
hopping_frequency[1] = 0x63;
|
||||
for(uint8_t ch=0; ch<=0xBD; ch+=3)
|
||||
{
|
||||
if(ch==0x63)
|
||||
val_low = 0xFF; //init for second block
|
||||
if(ch==0x60)
|
||||
continue; //skip channel
|
||||
CC2500_WriteReg(CC2500_0A_CHANNR, ch); //switch channel
|
||||
delayMicroseconds(370); //wait to read
|
||||
val = 0;
|
||||
for(uint8_t i=0;i<16;i++)
|
||||
val += CC2500_ReadReg(CC2500_34_RSSI | CC2500_READ_BURST);
|
||||
val >>= 4;
|
||||
debug("C:%02X RSSI:%02X",ch,val);
|
||||
if(val_low > val)
|
||||
{
|
||||
debug(" OK");
|
||||
val_low = val;
|
||||
hopping_frequency[ch<0x63?0:1]=ch; //save best channel
|
||||
}
|
||||
debugln("");
|
||||
}
|
||||
CC2500_WriteReg(CC2500_17_MCSM1,0x30);
|
||||
CC2500_Strobe(CC2500_SIDLE);
|
||||
CC2500_SetTxRxMode(TX_EN);
|
||||
#ifdef RLINK_RC4G_FORCE_ID
|
||||
hopping_frequency[0] = 0x03;
|
||||
hopping_frequency[1] = 0x6F;
|
||||
#endif
|
||||
}
|
||||
|
||||
#if 0
|
||||
#ifdef RLINK_DEBUG
|
||||
debug("ID:");
|
||||
for(uint8_t i=0;i<RLINK_TX_ID_LEN;i++)
|
||||
debug(" 0x%02X",rx_tx_addr[i]);
|
||||
@@ -138,7 +196,9 @@ static void __attribute__((unused)) RLINK_rf_init()
|
||||
CC2500_WriteReg(4, 0xBA);
|
||||
CC2500_WriteReg(5, 0xDC);
|
||||
}
|
||||
|
||||
else if(sub_protocol==RLINK_RC4G)
|
||||
CC2500_WriteReg(5, 0xA5);
|
||||
|
||||
CC2500_WriteReg(CC2500_0C_FSCTRL0, option);
|
||||
|
||||
CC2500_SetTxRxMode(TX_EN);
|
||||
@@ -219,18 +279,79 @@ static void __attribute__((unused)) RLINK_send_packet()
|
||||
packet_count++;
|
||||
if(packet_count>5) packet_count=0;
|
||||
|
||||
//debugln("C= 0x%02X",hopping_frequency[pseudo & 0x0F]);
|
||||
//debug("P=");
|
||||
//for(uint8_t i=1;i<RLINK_TX_PACKET_LEN+1;i++)
|
||||
// debug(" 0x%02X",packet[i]);
|
||||
//debugln("");
|
||||
#ifdef RLINK_DEBUG
|
||||
debugln("C= 0x%02X",hopping_frequency[pseudo & 0x0F]);
|
||||
debug("P=");
|
||||
for(uint8_t i=1;i<RLINK_TX_PACKET_LEN+1;i++)
|
||||
debug(" 0x%02X",packet[i]);
|
||||
debugln("");
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifndef MULTI_AIR
|
||||
static void __attribute__((unused)) RLINK_RC4G_send_packet()
|
||||
{
|
||||
uint32_t val;
|
||||
//hop
|
||||
CC2500_WriteReg(CC2500_0A_CHANNR, hopping_frequency[packet_count>>1]);
|
||||
#ifdef RLINK_DEBUG
|
||||
debug("C= 0x%02X ",hopping_frequency[packet_count>>1]);
|
||||
#endif
|
||||
// packet length
|
||||
packet[0] = 0x0F;
|
||||
//address
|
||||
memcpy(&packet[1], &rx_tx_addr[1], 3);
|
||||
//channels
|
||||
for(uint8_t i=0;i<2;i++)
|
||||
{
|
||||
val = Channel_data[2*i ] +400 -24;
|
||||
packet[4+i*2] = val;
|
||||
packet[8+i ] = val>>8;
|
||||
val = Channel_data[2*i+1] +400 -24;
|
||||
packet[5+i*2] = val;
|
||||
packet[8+i ] |= (val>>4) & 0xF0;
|
||||
}
|
||||
//special channel which is linked to gyro on the orginal TX but allocating it on CH5 here
|
||||
packet[10] = convert_channel_16b_limit(CH5,0,100);
|
||||
//failsafe
|
||||
for(uint8_t i=0;i<4;i++)
|
||||
packet[11+i] = convert_channel_16b_limit(CH6+i,0,200);
|
||||
//next hop
|
||||
packet_count++;
|
||||
packet_count &= 0x03;
|
||||
packet[15] = hopping_frequency[packet_count>>1];
|
||||
// send packet
|
||||
CC2500_WriteData(packet, 16);
|
||||
|
||||
#ifdef RLINK_DEBUG
|
||||
debug("P=");
|
||||
for(uint8_t i=1;i<16;i++)
|
||||
debug(" 0x%02X",packet[i]);
|
||||
debugln("");
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#define RLINK_TIMING_PROTO 20000-100 // -100 for compatibility with R8EF
|
||||
#define RLINK_TIMING_RFSEND 10500
|
||||
#define RLINK_TIMING_CHECK 2000
|
||||
#define RLINK_RC4G_TIMING_PROTO 14460
|
||||
uint16_t RLINK_callback()
|
||||
{
|
||||
if(sub_protocol == RLINK_RC4G)
|
||||
{
|
||||
#ifndef MULTI_AIR
|
||||
#ifdef MULTI_SYNC
|
||||
telemetry_set_input_sync(RLINK_RC4G_TIMING_PROTO);
|
||||
#endif
|
||||
CC2500_SetPower();
|
||||
CC2500_SetFreqOffset();
|
||||
RLINK_RC4G_send_packet();
|
||||
#else
|
||||
SUB_PROTO_INVALID;
|
||||
#endif
|
||||
return RLINK_RC4G_TIMING_PROTO;
|
||||
}
|
||||
switch(phase)
|
||||
{
|
||||
case RLINK_DATA:
|
||||
@@ -259,13 +380,16 @@ uint16_t RLINK_callback()
|
||||
len = CC2500_ReadReg(CC2500_3B_RXBYTES | CC2500_READ_BURST) & 0x7F;
|
||||
if (len == RLINK_RX_PACKET_LEN + 1 + 2) //Telemetry frame is 15 bytes + 1 byte for length + 2 bytes for RSSI&LQI&CRC
|
||||
{
|
||||
//debug("Telem:");
|
||||
#ifdef RLINK_DEBUG_TELEM
|
||||
debug("Telem:");
|
||||
#endif
|
||||
CC2500_ReadData(packet_in, len);
|
||||
if(packet_in[0]==RLINK_RX_PACKET_LEN && (packet_in[len-1] & 0x80) && memcmp(&packet[2],rx_tx_addr,RLINK_TX_ID_LEN)==0 && packet_in[6]==packet[1])
|
||||
{//Correct telemetry received: length, CRC, ID and type
|
||||
//Debug
|
||||
//for(uint8_t i=0;i<len;i++)
|
||||
// debug(" %02X",packet_in[i]);
|
||||
#ifdef RLINK_DEBUG_TELEM
|
||||
for(uint8_t i=0;i<len;i++)
|
||||
debug(" %02X",packet_in[i]);
|
||||
#endif
|
||||
TX_RSSI = packet_in[len-2];
|
||||
if(TX_RSSI >=128)
|
||||
TX_RSSI -= 128;
|
||||
@@ -278,7 +402,9 @@ uint16_t RLINK_callback()
|
||||
pps_counter++;
|
||||
packet_count=0;
|
||||
}
|
||||
//debugln("");
|
||||
#ifdef RLINK_DEBUG_TELEM
|
||||
debugln("");
|
||||
#endif
|
||||
}
|
||||
if (millis() - pps_timer >= 2000)
|
||||
{//1 telemetry packet every 100ms
|
||||
|
||||
170
Multiprotocol/SGF22_nrf24l01.ino
Normal file
170
Multiprotocol/SGF22_nrf24l01.ino
Normal 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 SGF22 R11
|
||||
|
||||
#if defined(SGF22_NRF24L01_INO)
|
||||
|
||||
#include "iface_xn297.h"
|
||||
|
||||
//#define FORCE_SGF22_ORIGINAL_ID
|
||||
|
||||
#define SGF22_PACKET_PERIOD 11950 //10240
|
||||
#define SGF22_BIND_RF_CHANNEL 78
|
||||
#define SGF22_PAYLOAD_SIZE 12
|
||||
#define SGF22_BIND_COUNT 50
|
||||
#define SGF22_RF_NUM_CHANNELS 4
|
||||
|
||||
//packet[8]
|
||||
#define SGF22_FLAG_3D 0x00
|
||||
#define SGF22_FLAG_ROLL 0x08
|
||||
#define SGF22_FLAG_LIGHT 0x04
|
||||
#define SGF22_FLAG_VIDEO 0x10
|
||||
#define SGF22_FLAG_6G 0x40
|
||||
#define SGF22_FLAG_VERTICAL 0xC0
|
||||
//packet[9]
|
||||
#define SGF22_FLAG_PHOTO 0x40
|
||||
|
||||
static void __attribute__((unused)) SGF22_send_packet()
|
||||
{
|
||||
if(IS_BIND_IN_PROGRESS)
|
||||
{
|
||||
packet[ 0] = 0x5B;
|
||||
packet[ 8] = 0x00; // ??? do they have to be 0 for bind to succeed ?
|
||||
packet[ 9] = 0x00; // ??? do they have to be 0 for bind to succeed ?
|
||||
packet[10] = 0xAA;
|
||||
packet[11] = 0x55;
|
||||
}
|
||||
else
|
||||
{
|
||||
//hop
|
||||
XN297_Hopping(packet_sent & 0x03); // ??? from the dumps I can't really say how hop and seq are sync, there could be an offset (0,1,2,3)...
|
||||
//sequence from 02 to 7A by increments of 4, sometimes with a flag 0x80 from 82 to FA, I can't tell from the dumps when the switch happens
|
||||
if( (packet_sent & 0x03) == 0x02)
|
||||
packet_count = packet_sent;
|
||||
packet_sent++;
|
||||
if(packet_sent > 0x7B)
|
||||
packet_sent = 0;
|
||||
//packet
|
||||
packet[0] = 0x1B;
|
||||
packet[8] = SGF22_FLAG_3D // default
|
||||
| GET_FLAG(CH6_SW, SGF22_FLAG_ROLL) // roll
|
||||
| GET_FLAG(CH7_SW, SGF22_FLAG_LIGHT) // push up throttle trim for light
|
||||
| GET_FLAG(CH9_SW, SGF22_FLAG_VIDEO); // push down throttle trim for video
|
||||
if(Channel_data[CH5] > CHANNEL_MIN_COMMAND)
|
||||
packet[8] |= SGF22_FLAG_6G; // mode 1 - 6g
|
||||
if(Channel_data[CH5] > CHANNEL_MAX_COMMAND)
|
||||
packet[8] |= SGF22_FLAG_VERTICAL; // mode 0 - vertical
|
||||
packet[9] = GET_FLAG(CH8_SW, SGF22_FLAG_PHOTO); // press in throttle trim for photo
|
||||
packet[10] = 0x42; // no fine tune
|
||||
packet[11] = 0x10; // no fine tune
|
||||
}
|
||||
packet[1] = packet_count; // sequence
|
||||
packet[2] = rx_tx_addr[2];
|
||||
packet[3] = rx_tx_addr[3];
|
||||
packet[4] = convert_channel_8b(THROTTLE);
|
||||
packet[5] = convert_channel_8b(RUDDER);
|
||||
packet[6] = convert_channel_8b(ELEVATOR);
|
||||
packet[7] = convert_channel_8b(AILERON);
|
||||
|
||||
XN297_SetPower();
|
||||
XN297_SetTxRxMode(TX_EN);
|
||||
XN297_WriteEnhancedPayload(packet, SGF22_PAYLOAD_SIZE,0);
|
||||
#if 0
|
||||
debug_time("");
|
||||
for(uint8_t i=0; i<SGF22_PAYLOAD_SIZE; i++)
|
||||
debug(" %02X",packet[i]);
|
||||
debugln("");
|
||||
#endif
|
||||
}
|
||||
|
||||
static void __attribute__((unused)) SGF22_initialize_txid()
|
||||
{
|
||||
uint8_t val = (( (uint16_t) rx_tx_addr[2] << 8 ) | rx_tx_addr[3])%5;
|
||||
|
||||
const uint8_t hop[5][4] =
|
||||
{ { 0x0C, 0x2A, 0x1B, 0x39 },
|
||||
{ 0x0F, 0x2D, 0x1E, 0x3D },
|
||||
{ 0x12, 0x31, 0x21, 0x41 },
|
||||
{ 0x15, 0x34, 0x24, 0x44 },
|
||||
{ 0x18, 0x37, 0x27, 0x47 } };
|
||||
memcpy(hopping_frequency, &hop[val], SGF22_RF_NUM_CHANNELS);
|
||||
|
||||
/*//Same code sze...
|
||||
hopping_frequency[0] = 0x0C + 3 * val;
|
||||
hopping_frequency[1] = hopping_frequency[0] + 0x1E;
|
||||
if(val > 1) hopping_frequency[1]++;
|
||||
hopping_frequency[2] = hopping_frequency[0] + 0x0F;
|
||||
hopping_frequency[3] = hopping_frequency[1] + 0x0F;
|
||||
if(val ) hopping_frequency[3]++;*/
|
||||
|
||||
#ifdef FORCE_SGF22_ORIGINAL_ID
|
||||
rx_tx_addr[2] = 0x1F;
|
||||
rx_tx_addr[3] = 0x61;
|
||||
memcpy(hopping_frequency,"\x15\x34\x24\x44", SGF22_RF_NUM_CHANNELS); //Original dump=>21=0x15,52=0x34,36=0x24,68=0x44
|
||||
#endif
|
||||
#if 0
|
||||
debug("ID: %02X %02X, C: ",rx_tx_addr[2],rx_tx_addr[3]);
|
||||
for(uint8_t i=0; i<SGF22_RF_NUM_CHANNELS; i++)
|
||||
debug(" %02X",hopping_frequency[i]);
|
||||
debugln("");
|
||||
#endif
|
||||
}
|
||||
|
||||
static void __attribute__((unused)) SGF22_RF_init()
|
||||
{
|
||||
XN297_Configure(XN297_CRCEN, XN297_SCRAMBLED, XN297_1M);
|
||||
XN297_SetTXAddr((uint8_t*)"\xC7\x95\x3C\xBB\xA5", 5);
|
||||
XN297_RFChannel(SGF22_BIND_RF_CHANNEL); // Set bind channel
|
||||
}
|
||||
|
||||
uint16_t SGF22_callback()
|
||||
{
|
||||
if(phase == 0)
|
||||
{
|
||||
phase++;
|
||||
#ifdef MULTI_SYNC
|
||||
telemetry_set_input_sync(SGF22_PACKET_PERIOD);
|
||||
#endif
|
||||
SGF22_send_packet();
|
||||
if(IS_BIND_IN_PROGRESS)
|
||||
{
|
||||
if(--bind_counter==0)
|
||||
BIND_DONE;
|
||||
}
|
||||
}
|
||||
else
|
||||
{//send 3 times in total the same packet
|
||||
NRF24L01_Strobe(REUSE_TX_PL);
|
||||
phase++;
|
||||
if(phase > 2)
|
||||
{
|
||||
phase = 0;
|
||||
return SGF22_PACKET_PERIOD - 2*1550;
|
||||
}
|
||||
}
|
||||
return 1550;
|
||||
}
|
||||
|
||||
void SGF22_init()
|
||||
{
|
||||
BIND_IN_PROGRESS; // autobind protocol
|
||||
SGF22_initialize_txid();
|
||||
SGF22_RF_init();
|
||||
bind_counter=SGF22_BIND_COUNT;
|
||||
packet_sent = packet_count = 0x26;
|
||||
phase = 0;
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -20,17 +20,18 @@
|
||||
#include "iface_cyrf6936.h"
|
||||
|
||||
//#define TRAXXAS_FORCE_ID
|
||||
#define TRAXXAS_DEBUG
|
||||
//#define TRAXXAS_DEBUG
|
||||
|
||||
#define TRAXXAS_CHANNEL 0x0F
|
||||
#define TRAXXAS_BIND_CHANNEL 0x2B
|
||||
#define TRAXXAS_BIND_CHECK 0x22
|
||||
#define TRAXXAS_CHECK_CHANNEL 0x22
|
||||
#define TRAXXAS_PACKET_SIZE 16
|
||||
|
||||
enum {
|
||||
TRAXXAS_BIND_PREP_RX=0,
|
||||
TRAXXAS_BIND_RX,
|
||||
TRAXXAS_BIND_TX1,
|
||||
TRAXXAS_PREP_RX,
|
||||
TRAXXAS_RX,
|
||||
TRAXXAS_PREP_DATA,
|
||||
TRAXXAS_DATA,
|
||||
};
|
||||
@@ -56,8 +57,17 @@ static void __attribute__((unused)) TRAXXAS_cyrf_bind_config()
|
||||
CYRF_ConfigRFChannel(TRAXXAS_BIND_CHANNEL);
|
||||
}
|
||||
|
||||
static void __attribute__((unused)) TRAXXAS_cyrf_check_config()
|
||||
{
|
||||
CYRF_ConfigRFChannel(TRAXXAS_CHECK_CHANNEL);
|
||||
CYRF_PROGMEM_ConfigSOPCode(DEVO_j6pro_sopcodes[9]);
|
||||
CYRF_WriteRegister(CYRF_15_CRC_SEED_LSB, 0xA5);
|
||||
CYRF_WriteRegister(CYRF_16_CRC_SEED_MSB, 0xA5);
|
||||
}
|
||||
|
||||
static void __attribute__((unused)) TRAXXAS_cyrf_data_config()
|
||||
{
|
||||
CYRF_ConfigRFChannel(hopping_frequency[0]);
|
||||
#ifdef TRAXXAS_FORCE_ID // data taken from TX dump
|
||||
CYRF_WriteRegister(CYRF_15_CRC_SEED_LSB, 0x1B);
|
||||
CYRF_WriteRegister(CYRF_16_CRC_SEED_MSB, 0x3F);
|
||||
@@ -68,7 +78,6 @@ static void __attribute__((unused)) TRAXXAS_cyrf_data_config()
|
||||
CYRF_WriteRegister(CYRF_16_CRC_SEED_MSB, cyrfmfg_id[1] - eeprom_read_byte((EE_ADDR)(addr + 1)));
|
||||
CYRF_PROGMEM_ConfigSOPCode(DEVO_j6pro_sopcodes[eeprom_read_byte((EE_ADDR)(addr + 2)) % 20]);
|
||||
#endif
|
||||
CYRF_ConfigRFChannel(TRAXXAS_CHANNEL);
|
||||
CYRF_SetTxRxMode(TX_EN);
|
||||
}
|
||||
|
||||
@@ -77,7 +86,7 @@ static void __attribute__((unused)) TRAXXAS_send_data_packet()
|
||||
packet[0] = 0x01;
|
||||
memset(&packet[1],0x00,TRAXXAS_PACKET_SIZE-1);
|
||||
//Next RF channel ? 0x00 -> keep current, 0x0E change to F=15
|
||||
//packet[1]
|
||||
//packet[1] = hopping_frequency[0] - 1;
|
||||
//Steering
|
||||
uint16_t ch = convert_channel_16b_nolimit(RUDDER,500,1000,false);
|
||||
packet[2]=ch>>8;
|
||||
@@ -106,21 +115,26 @@ uint16_t TRAXXAS_callback()
|
||||
switch(phase)
|
||||
{
|
||||
case TRAXXAS_BIND_PREP_RX:
|
||||
//debugln("BIND_PREP_RX");
|
||||
TRAXXAS_cyrf_bind_config();
|
||||
case TRAXXAS_PREP_RX:
|
||||
//debugln("PREP_RX");
|
||||
if(phase == TRAXXAS_BIND_PREP_RX)
|
||||
TRAXXAS_cyrf_bind_config();
|
||||
else
|
||||
TRAXXAS_cyrf_check_config();
|
||||
CYRF_SetTxRxMode(RX_EN); //Receive mode
|
||||
CYRF_WriteRegister(CYRF_05_RX_CTRL, 0x83); //Prepare to receive
|
||||
packet_count=100; //Timeout for RX
|
||||
phase=TRAXXAS_BIND_RX;
|
||||
return 700;
|
||||
phase++; // TRAXXAS_BIND_RX or TRAXXAS_RX
|
||||
return 7000;
|
||||
case TRAXXAS_BIND_RX:
|
||||
//debugln("BIND_RX");
|
||||
case TRAXXAS_RX:
|
||||
//debugln("RX");
|
||||
//Read data from RX
|
||||
status = CYRF_ReadRegister(CYRF_07_RX_IRQ_STATUS);
|
||||
if((status & 0x03) == 0x02) // RXC=1, RXE=0 then 2nd check is required (debouncing)
|
||||
status |= CYRF_ReadRegister(CYRF_07_RX_IRQ_STATUS);
|
||||
#ifdef TRAXXAS_DEBUG
|
||||
debugln("s=%02X",status);
|
||||
//debugln("s=%02X",status);
|
||||
#endif
|
||||
CYRF_WriteRegister(CYRF_07_RX_IRQ_STATUS, 0x80); // need to set RXOW before data read
|
||||
if((status & 0x07) == 0x02)
|
||||
@@ -138,36 +152,56 @@ uint16_t TRAXXAS_callback()
|
||||
debug(" %02X",packet[i]);
|
||||
debugln("");
|
||||
#endif
|
||||
// Store RX ID
|
||||
uint16_t addr=TRAXXAS_EEPROM_OFFSET+RX_num*3;
|
||||
for(uint8_t i=0;i<2;i++)
|
||||
eeprom_write_byte((EE_ADDR)(addr+i),packet[i+1]);
|
||||
//Store SOP index
|
||||
eeprom_write_byte((EE_ADDR)(addr+2),packet[7]);
|
||||
if(phase == TRAXXAS_BIND_RX)
|
||||
{
|
||||
// Store RX ID
|
||||
for(uint8_t i=0;i<2;i++)
|
||||
eeprom_write_byte((EE_ADDR)(addr+i),packet[i+1]);
|
||||
//Store SOP index
|
||||
eeprom_write_byte((EE_ADDR)(addr+2),packet[7]);
|
||||
}
|
||||
else
|
||||
{
|
||||
//check RX ID and SOP
|
||||
if(eeprom_read_byte((EE_ADDR)(addr + 0)) != packet[1] || eeprom_read_byte((EE_ADDR)(addr + 1)) != packet[2] || eeprom_read_byte((EE_ADDR)(addr + 2)) != packet[7])
|
||||
{ // Not our RX
|
||||
phase++; // TRAXXAS_PREP_DATA
|
||||
return 10000-7000-500;
|
||||
}
|
||||
}
|
||||
// Replace RX ID by TX ID
|
||||
for(uint8_t i=0;i<6;i++)
|
||||
packet[i+1]=cyrfmfg_id[i];
|
||||
//packet[7 ] = 0xEE; // Not needed ??
|
||||
packet[8] = TRAXXAS_CHANNEL - 1;
|
||||
packet[8 ] = hopping_frequency[0] - 1;
|
||||
packet[10] = 0x01; // Must change otherwise bind doesn't complete
|
||||
//packet[13] = 0x05; // Not needed ??
|
||||
packet_count=12;
|
||||
CYRF_SetTxRxMode(TX_EN);
|
||||
phase=TRAXXAS_BIND_TX1;
|
||||
return 200;
|
||||
return 10000;
|
||||
}
|
||||
}
|
||||
if( --packet_count == 0 )
|
||||
{ // Retry RX
|
||||
CYRF_WriteRegister(CYRF_29_RX_ABORT, 0x20); // Enable RX abort
|
||||
CYRF_WriteRegister(CYRF_0F_XACT_CFG, 0x24); // Force end state
|
||||
CYRF_WriteRegister(CYRF_29_RX_ABORT, 0x00); // Disable RX abort
|
||||
if(--bind_counter != 0)
|
||||
phase=TRAXXAS_BIND_PREP_RX; // Retry receiving bind packet
|
||||
else
|
||||
phase=TRAXXAS_PREP_DATA; // Abort binding
|
||||
if(phase == TRAXXAS_BIND_RX)
|
||||
{
|
||||
if( --packet_count == 0 )
|
||||
{ // Retry RX
|
||||
CYRF_WriteRegister(CYRF_29_RX_ABORT, 0x20); // Enable RX abort
|
||||
CYRF_WriteRegister(CYRF_0F_XACT_CFG, 0x24); // Force end state
|
||||
CYRF_WriteRegister(CYRF_29_RX_ABORT, 0x00); // Disable RX abort
|
||||
if(--bind_counter != 0)
|
||||
phase=TRAXXAS_BIND_PREP_RX; // Retry receiving bind packet
|
||||
else
|
||||
phase=TRAXXAS_PREP_DATA; // Abort binding
|
||||
}
|
||||
return 700;
|
||||
}
|
||||
return 700;
|
||||
CYRF_WriteRegister(CYRF_29_RX_ABORT, 0x20); // Enable RX abort
|
||||
CYRF_WriteRegister(CYRF_0F_XACT_CFG, 0x24); // Force end state
|
||||
CYRF_WriteRegister(CYRF_29_RX_ABORT, 0x00); // Disable RX abort
|
||||
phase++; // TRAXXAS_PREP_DATA
|
||||
return 10000-7000-500;
|
||||
case TRAXXAS_BIND_TX1:
|
||||
//debugln("BIND_TX1");
|
||||
CYRF_WriteDataPacketLen(packet, TRAXXAS_PACKET_SIZE);
|
||||
@@ -185,15 +219,17 @@ uint16_t TRAXXAS_callback()
|
||||
BIND_DONE;
|
||||
TRAXXAS_cyrf_data_config();
|
||||
phase++;
|
||||
return 500;
|
||||
case TRAXXAS_DATA:
|
||||
//debugln("DATA");
|
||||
//debugln_time("DATA");
|
||||
#ifdef MULTI_SYNC
|
||||
telemetry_set_input_sync(13940);
|
||||
telemetry_set_input_sync(10000);
|
||||
#endif
|
||||
TRAXXAS_send_data_packet();
|
||||
break;
|
||||
phase = TRAXXAS_PREP_RX;
|
||||
return 1000;
|
||||
}
|
||||
return 13940;
|
||||
return 10000;
|
||||
}
|
||||
|
||||
void TRAXXAS_init()
|
||||
@@ -205,7 +241,7 @@ void TRAXXAS_init()
|
||||
//Read CYRF ID
|
||||
CYRF_GetMfgData(cyrfmfg_id);
|
||||
//cyrfmfg_id[0]+=RX_num; // Not needed since the TX and RX have to match
|
||||
|
||||
CYRF_FindBestChannels(hopping_frequency,1,1,0x02,0x21);
|
||||
#ifdef TRAXXAS_FORCE_ID // data taken from TX dump
|
||||
cyrfmfg_id[0]=0x65; // CYRF MFG ID
|
||||
cyrfmfg_id[1]=0xE2;
|
||||
@@ -213,8 +249,13 @@ void TRAXXAS_init()
|
||||
cyrfmfg_id[3]=0x55;
|
||||
cyrfmfg_id[4]=0x4D;
|
||||
cyrfmfg_id[5]=0xFE;
|
||||
hopping_frequency[0] = 0x05; // seen 05 and 0F
|
||||
#endif
|
||||
|
||||
#ifdef TRAXXAS_DEBUG
|
||||
debugln("ID: %02X %02X %02X %02X %02X %02X",cyrfmfg_id[0],cyrfmfg_id[1],cyrfmfg_id[2],cyrfmfg_id[3],cyrfmfg_id[4],cyrfmfg_id[5]);
|
||||
debugln("RF CH: %02X",hopping_frequency[0]);
|
||||
#endif
|
||||
|
||||
if(IS_BIND_IN_PROGRESS)
|
||||
{
|
||||
bind_counter=100;
|
||||
@@ -232,40 +273,37 @@ void TRAXXAS_init()
|
||||
}
|
||||
|
||||
/*
|
||||
Bind phase 1
|
||||
Packets 0x02: Bind learn TX/RX addresses
|
||||
CHANNEL: 0x2B
|
||||
SOP_CODE: 0x3C 0x37 0xCC 0x91 0xE2 0xF8 0xCC 0x91
|
||||
CRC_SEED_LSB: 0x5A
|
||||
CRC_SEED_MSB: 0x5A
|
||||
RX1: 0x02 0x4A 0xA3 0x2D 0x1A 0x49 0xFE 0x06 0x00 0x00 0x02 0x01 0x06 0x06 0x00 0x00
|
||||
TX1: 0x02 0x65 0xE2 0x5E 0x55 0x4D 0xFE 0xEE 0x00 0x00 0x01 0x01 0x06 0x05 0x00 0x00
|
||||
RX: 0x02 0x4A 0xA3 0x2D 0x1A 0x49 0xFE 0x06 0x00 0x00 0x02 0x01 0x06 0x06 0x00 0x00
|
||||
TX: 0x02 0x65 0xE2 0x5E 0x55 0x4D 0xFE 0xEE 0x00 0x00 0x01 0x01 0x06 0x05 0x00 0x00
|
||||
Notes:
|
||||
- RX cyrfmfg_id is 0x4A,0xA3,0x2D,0x1A,0x49,0xFE and TX cyrfmfg_id is 0x65,0xE2,0x5E,0x55,0x4D,0xFE
|
||||
- P[7] changes from 0x06 to 0xEE but not needed to complete the bind -> doesn't care??
|
||||
- P[8..9]=0x00 unchanged??
|
||||
- P[8] RF channel - 1 (on packets type 0x03)
|
||||
- P[9] 0x00 unchanged??
|
||||
- P[10] needs to be set to 0x01 to complete the bind -> normal packet P[0]??
|
||||
- P[11] unchanged ?? -> no bind if set to 0x00 or 0x81
|
||||
- P[12] unchanged ?? -> no bind if set to 0x05 or 0x86
|
||||
- P[13] changes from 0x06 to 0x05 but not needed to complete the bind -> doesn't care??
|
||||
- P[14..15]=0x00 unchanged??
|
||||
|
||||
Bind phase 2 (looks like normal mode?)
|
||||
CHANNEL: 0x05
|
||||
SOP_CODE: 0xA1 0x78 0xDC 0x3C 0x9E 0x82 0xDC 0x3C
|
||||
CRC_SEED_LSB: 0x1B
|
||||
CRC_SEED_MSB: 0x3F
|
||||
RX2: 0x03 0x4A 0xA3 0x2D 0x1A 0x49 0xFE 0x06 0x00 0x00 0x02 0x01 0x06 0x06 0x00 0x00
|
||||
TX2: 0x01 0x65 0x01 0xF4 0x03 0xE7 0x02 0x08 0x00 0x00 0x01 0x01 0x02 0xEE 0x00 0x00
|
||||
Note: TX2 is nearly a normal packet at the exception of the 2nd byte equal to cyrfmfg_id[0]
|
||||
|
||||
Bind phase 3 (check?)
|
||||
Packets 0x03: Which RF channel
|
||||
CHANNEL: 0x22
|
||||
SOP_CODE: 0x97 0xE5 0x14 0x72 0x7F 0x1A 0x14 0x72
|
||||
CRC_SEED_LSB: 0xA5
|
||||
CRC_SEED_MSB: 0xA5
|
||||
RX3: 0x04 0x4A 0xA3 0x2D 0x1A 0x49 0xFE 0x06 0x00 0x00 0x02 0x01 0x06 0x06 0x00 0x00
|
||||
RX: 0x03 0x4A 0xA3 0x2D 0x1A 0x49 0xFE 0x06 0x00 0x00 0x02 0x01 0x06 0x06 0x00 0x00
|
||||
TX: 0x03 0x65 0xE2 0x5E 0x55 0x4D 0xFE 0xEE 0x0E 0x00 0x01 0x01 0x06 0x05 0x00 0x00
|
||||
- P[8] RF channel - 1
|
||||
|
||||
Switch to normal mode
|
||||
Packets 0x04: unknown
|
||||
RX: 0x04 0x4A 0xA3 0x2D 0x1A 0x49 0xFE 0x06 0x00 0x00 0x02 0x01 0x06 0x06 0x00 0x00
|
||||
|
||||
Packets 0x01: Normal mode
|
||||
CHANNEL: 0x05
|
||||
SOP_CODE: 0xA1 0x78 0xDC 0x3C 0x9E 0x82 0xDC 0x3C
|
||||
CRC_SEED_LSB: 0x1B
|
||||
|
||||
@@ -1,163 +0,0 @@
|
||||
/*
|
||||
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 Tiger Drone 1400782.
|
||||
|
||||
#if defined(TIGER_NRF24L01_INO)
|
||||
|
||||
#include "iface_xn297.h"
|
||||
|
||||
#define TIGER_FORCE_ID
|
||||
|
||||
#define TIGER_INITIAL_WAIT 500
|
||||
#define TIGER_PACKET_PERIOD 3940
|
||||
#define TIGER_RF_NUM_CHANNELS 4
|
||||
#define TIGER_BIND_RF_NUM_CHANNELS 8
|
||||
#define TIGER_PAYLOAD_SIZE 16
|
||||
#define TIGER_BIND_COUNT 761 //3sec
|
||||
|
||||
|
||||
static uint8_t __attribute__((unused)) TIGER_convert_channel(uint8_t num)
|
||||
{
|
||||
uint8_t val=convert_channel_8b(num);
|
||||
// 7F..01=left, 00=center, 80..FF=right
|
||||
if(val==0x80)
|
||||
val=0; // 0
|
||||
else
|
||||
if(val>0x80)
|
||||
val--; // 80..FE
|
||||
else
|
||||
{
|
||||
val=0x80-val; // 80..01
|
||||
if(val==0x80)
|
||||
val--; // 7F..01
|
||||
}
|
||||
return val;
|
||||
}
|
||||
|
||||
static void __attribute__((unused)) TIGER_send_packet()
|
||||
{
|
||||
if(IS_BIND_DONE)
|
||||
{
|
||||
//Channels
|
||||
packet[0]=convert_channel_8b(THROTTLE); // 00..FF
|
||||
packet[1]=TIGER_convert_channel(RUDDER); // 7F..01=left, 00=center, 80..FF=right
|
||||
packet[2]=TIGER_convert_channel(ELEVATOR); // 7F..01=down, 00=center, 80..FF=up
|
||||
packet[3]=TIGER_convert_channel(AILERON); // 7F..01=left, 00=center, 80..FF=right
|
||||
//Flags
|
||||
packet[14]= GET_FLAG(CH5_SW, 0x04) //FLIP
|
||||
| GET_FLAG(CH6_SW, 0x10); //LIGHT
|
||||
}
|
||||
//Check
|
||||
crc8=0;
|
||||
for(uint8_t i=0;i<TIGER_PAYLOAD_SIZE-1;i++)
|
||||
crc8+=packet[i];
|
||||
packet[TIGER_PAYLOAD_SIZE-1]=crc8;
|
||||
|
||||
//Hopping frequency
|
||||
XN297_Hopping(hopping_frequency_no>>1);
|
||||
hopping_frequency_no++;
|
||||
if(IS_BIND_IN_PROGRESS)
|
||||
{
|
||||
if(hopping_frequency_no>=2*TIGER_BIND_RF_NUM_CHANNELS)
|
||||
hopping_frequency_no=0;
|
||||
}
|
||||
else
|
||||
{
|
||||
if(hopping_frequency_no>=2*(TIGER_BIND_RF_NUM_CHANNELS+TIGER_RF_NUM_CHANNELS))
|
||||
hopping_frequency_no=2*TIGER_BIND_RF_NUM_CHANNELS;
|
||||
}
|
||||
|
||||
//Send
|
||||
XN297_SetPower();
|
||||
XN297_SetTxRxMode(TX_EN);
|
||||
XN297_WritePayload(packet, TIGER_PAYLOAD_SIZE);
|
||||
}
|
||||
|
||||
static void __attribute__((unused)) TIGER_RF_init()
|
||||
{
|
||||
XN297_Configure(XN297_CRCEN, XN297_SCRAMBLED, XN297_1M);
|
||||
XN297_SetTXAddr((uint8_t *)"\x68\x94\xA6\xD5\xC3", 5);
|
||||
}
|
||||
|
||||
static void __attribute__((unused)) TIGER_initialize_txid()
|
||||
{
|
||||
#ifdef TIGER_FORCE_ID
|
||||
rx_tx_addr[0]=0x64;
|
||||
rx_tx_addr[1]=0x39;
|
||||
rx_tx_addr[2]=0x12;
|
||||
rx_tx_addr[3]=0x00;
|
||||
rx_tx_addr[4]=0x00;
|
||||
memcpy(hopping_frequency,"\x0E\x39\x1C\x07\x24\x3E\x2B\x47",TIGER_BIND_RF_NUM_CHANNELS);
|
||||
memcpy(&hopping_frequency[TIGER_BIND_RF_NUM_CHANNELS],"\x36\x41\x37\x4E",TIGER_RF_NUM_CHANNELS);
|
||||
#endif
|
||||
//prepare bind packet
|
||||
memset(&packet[0], 0x00, 4);
|
||||
memset(&packet[4], 0x40, 10);
|
||||
memcpy(&packet[7], rx_tx_addr, 5);
|
||||
packet[14]=0xC0;
|
||||
}
|
||||
|
||||
uint16_t TIGER_callback()
|
||||
{
|
||||
#ifdef MULTI_SYNC
|
||||
telemetry_set_input_sync(TIGER_PACKET_PERIOD);
|
||||
#endif
|
||||
if(bind_counter)
|
||||
if(--bind_counter==0)
|
||||
{
|
||||
BIND_DONE;
|
||||
XN297_SetTXAddr((uint8_t *)"\x49\xA6\x83\xEB\x4B", 5);
|
||||
}
|
||||
TIGER_send_packet();
|
||||
return TIGER_PACKET_PERIOD;
|
||||
}
|
||||
|
||||
void TIGER_init()
|
||||
{
|
||||
BIND_IN_PROGRESS; // autobind protocol
|
||||
TIGER_initialize_txid();
|
||||
TIGER_RF_init();
|
||||
hopping_frequency_no = 0;
|
||||
bind_counter=TIGER_BIND_COUNT;
|
||||
}
|
||||
|
||||
#endif
|
||||
/*Bind
|
||||
- RF setup: 1Mbps, scrambled, CRC
|
||||
- TX addr: 0x68 0x94 0xA6 0xD5 0xC3
|
||||
- 8 RF channels: 0x0E 0x39 0x1C 0x07 0x24 0x3E 0x2B 0x47
|
||||
- 2 packets per RF channel, 3940µs between packets
|
||||
- payload 16 bytes: 0x00 0x00 0x00 0x00 0x40 0x40 0x40 0x64 0x39 0x12 0x00 0x00 0x40 0x40 0xC0 0xAF
|
||||
- payload[15]=sum of payload[0..14]
|
||||
- the only difference with normal packets is the payload[14]=0xC0
|
||||
- ??? payload[7..11] TX ID ???
|
||||
|
||||
Normal
|
||||
- RF setup: 1Mbps
|
||||
- TX addr: 0x49 0xA6 0x83 0xEB 0x4B
|
||||
- 4 RF channels: 0x36 0x41 0x37 0x4E
|
||||
- 2 packets per RF channel, 3940µs between packets
|
||||
- payload 16 bytes: 0x00 0x00 0x00 0x00 0x40 0x40 0x40 0x64 0x39 0x12 0x00 0x00 0x40 0x40 0x00 0xEF
|
||||
- payload[15]=sum of payload[0..14]
|
||||
- throttle is on payload[0] 00..FF
|
||||
- rudder is on payload[1] 00=center, 80..FF=right, 01..7F=left
|
||||
- elevator is on payload[2] 00=center, 80..FF=up, 01..7F=down
|
||||
- aileron is on payload[3] 00=center, 80..FF=right, 01..7F=left
|
||||
- trims payload[4..6]
|
||||
- ??? payload[7..11] TX ID ???
|
||||
- ??? payload[12..13] ???
|
||||
- flip is on payload[14] and flag 0x04
|
||||
- light is on payload[14] and flag 0x10
|
||||
*/
|
||||
@@ -312,6 +312,7 @@
|
||||
#undef CX10_NRF24L01_INO
|
||||
#undef DM002_NRF24L01_INO
|
||||
#undef E016H_NRF24L01_INO
|
||||
#undef EAZYRC_NRF24L01_INO
|
||||
#undef ESKY_NRF24L01_INO
|
||||
#undef ESKY150_NRF24L01_INO
|
||||
#undef FQ777_NRF24L01_INO
|
||||
@@ -330,9 +331,9 @@
|
||||
#undef POTENSIC_NRF24L01_INO
|
||||
#undef PROPEL_NRF24L01_INO
|
||||
#undef REALACC_NRF24L01_INO
|
||||
#undef SGF22_NRF24L01_INO
|
||||
#undef SHENQI_NRF24L01_INO
|
||||
#undef SYMAX_NRF24L01_INO
|
||||
#undef TIGER_NRF24L01_INO
|
||||
#undef V2X2_NRF24L01_INO
|
||||
#undef V761_NRF24L01_INO
|
||||
#undef XERALL_NRF24L01_INO
|
||||
@@ -368,6 +369,73 @@
|
||||
#undef FRSKYR9_SX1276_INO
|
||||
#endif
|
||||
|
||||
#ifdef MULTI_AIR
|
||||
#undef JOYSWAY_A7105_INO
|
||||
//#undef KYOSHO_A7105_INO
|
||||
//#undef PELIKAN_A7105_INO
|
||||
#undef LOSI_CYRF6936_INO //Need DSM to be enabled
|
||||
#undef TRAXXAS_CYRF6936_INO
|
||||
#undef EAZYRC_NRF24L01_INO
|
||||
#undef KYOSHO2_NRF24L01_INO
|
||||
#undef MOULDKG_NRF24L01_INO
|
||||
#undef SHENQI_NRF24L01_INO
|
||||
#endif
|
||||
|
||||
#ifdef MULTI_SURFACE
|
||||
#undef BUGS_A7105_INO
|
||||
#undef HEIGHT_A7105_INO
|
||||
#undef HUBSAN_A7105_INO
|
||||
#undef E010R5_CYRF6936_INO
|
||||
#undef E01X_CYRF6936_INO
|
||||
#undef E129_CYRF6936_INO
|
||||
#undef J6PRO_CYRF6936_INO
|
||||
#undef SCORPIO_CYRF6936_INO
|
||||
#undef E016HV2_CC2500_INO
|
||||
#undef ESKY150V2_CC2500_INO
|
||||
#undef IKEAANSLUTA_CC2500_INO // This is mostly a "for-fun" kind of a thing, not needed for most users
|
||||
#undef SKYARTEC_CC2500_INO
|
||||
#undef REDPINE_CC2500_INO
|
||||
#undef BAYANG_NRF24L01_INO
|
||||
#undef BAYANG_RX_NRF24L01_INO
|
||||
#undef BUGSMINI_NRF24L01_INO
|
||||
#undef CABELL_NRF24L01_INO
|
||||
#undef CFLIE_NRF24L01_INO
|
||||
#undef CG023_NRF24L01_INO
|
||||
#undef CX10_NRF24L01_INO
|
||||
#undef DM002_NRF24L01_INO
|
||||
#undef E016H_NRF24L01_INO
|
||||
#undef ESKY_NRF24L01_INO
|
||||
#undef ESKY150_NRF24L01_INO
|
||||
#undef FQ777_NRF24L01_INO
|
||||
#undef FX_NRF24L01_INO
|
||||
#undef FY326_NRF24L01_INO
|
||||
#undef GW008_NRF24L01_INO
|
||||
#undef HONTAI_NRF24L01_INO
|
||||
#undef H8_3D_NRF24L01_INO
|
||||
#undef JJRC345_NRF24L01_INO
|
||||
#undef KN_NRF24L01_INO
|
||||
#undef LOLI_NRF24L01_INO
|
||||
#undef NCC1701_NRF24L01_INO
|
||||
#undef POTENSIC_NRF24L01_INO
|
||||
#undef PROPEL_NRF24L01_INO
|
||||
#undef REALACC_NRF24L01_INO
|
||||
#undef SGF22_NRF24L01_INO
|
||||
#undef SYMAX_NRF24L01_INO
|
||||
#undef V761_NRF24L01_INO
|
||||
#undef XERALL_NRF24L01_INO
|
||||
#undef YD717_NRF24L01_INO
|
||||
#undef ZSX_NRF24L01_INO
|
||||
#undef GD00X_CCNRF_INO
|
||||
#undef KF606_CCNRF_INO
|
||||
#undef MJXQ_CCNRF_INO
|
||||
#undef MT99XX_CCNRF_INO
|
||||
#undef OMP_CCNRF_INO
|
||||
#undef Q303_CCNRF_INO
|
||||
#undef Q90C_CCNRF_INO
|
||||
#undef SLT_CCNRF_INO
|
||||
#undef V911S_CCNRF_INO
|
||||
#endif
|
||||
|
||||
//OpenTX 2.3.x issue
|
||||
#if defined (FRSKYD_CC2500_INO) || defined(FRSKYV_CC2500_INO) || defined(FRSKYX_CC2500_INO)
|
||||
#define FRSKYX_CC2500_INO
|
||||
|
||||
@@ -29,11 +29,18 @@ Multiprotocol is distributed in the hope that it will be useful,
|
||||
|
||||
static uint16_t __attribute__((unused)) XK_convert_channel(uint8_t num)
|
||||
{
|
||||
// Introduce deadband on all channels to prevent twitching
|
||||
//debug("val:%d",val);
|
||||
uint16_t val=convert_channel_8b_limit_deadband(num,0x00,0x80, 0xFF, 40)<<2;
|
||||
//debugln(",%d",val);
|
||||
|
||||
uint16_t val;
|
||||
|
||||
if(sub_protocol != XK_CARS)
|
||||
{
|
||||
// Introduce deadband on all channels to prevent twitching
|
||||
//debug("val:%d",val);
|
||||
val=convert_channel_8b_limit_deadband(num,0x00,0x80, 0xFF, 40)<<2;
|
||||
//debugln(",%d",val);
|
||||
}
|
||||
else
|
||||
val=convert_channel_16b_limit(num,0x00,0x3FF);
|
||||
|
||||
// 1FF..01=left, 00=center, 200..3FF=right
|
||||
if(val==0x200)
|
||||
val=0; // 0
|
||||
@@ -89,12 +96,14 @@ static void __attribute__((unused)) XK_send_packet()
|
||||
packet[10] = 0x04; // 6G-Mode
|
||||
//0x00 default M-Mode
|
||||
|
||||
packet[10] |= GET_FLAG(CH7_SW,0x80); // Emergency stop momentary switch
|
||||
packet[10] |= GET_FLAG(CH7_SW ,0x80); // Emergency stop momentary switch
|
||||
|
||||
packet[11] = GET_FLAG(CH8_SW,0x03) // 3D/6G momentary switch
|
||||
|GET_FLAG(CH6_SW,0x40); // Take off momentary switch
|
||||
packet[14] = GET_FLAG(CH9_SW,0x01) // Photo momentary switch
|
||||
|GET_FLAG(CH10_SW,0x2); // Video momentary switch
|
||||
packet[11] = GET_FLAG(CH8_SW ,0x03) // 3D/6G momentary switch
|
||||
|GET_FLAG(CH6_SW ,0x40); // Take off momentary switch
|
||||
packet[14] = GET_FLAG(CH9_SW ,0x01) // Photo momentary switch
|
||||
|GET_FLAG(CH10_SW,0x02) // Video momentary switch
|
||||
|GET_FLAG(CH11_SW,0x04) // Flip
|
||||
|GET_FLAG(CH12_SW,0x10); // Light
|
||||
//debugln("P1:%02X,P12:%02X",packet[1],packet[12]);
|
||||
}
|
||||
|
||||
@@ -187,7 +196,7 @@ static void __attribute__((unused)) XK_initialize_txid()
|
||||
|
||||
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_HoppingCalib(XK_RF_BIND_NUM_CHANNELS+XK_RF_NUM_CHANNELS); // Calibrate all channels
|
||||
}
|
||||
@@ -209,7 +218,8 @@ uint16_t XK_callback()
|
||||
|
||||
void XK_init()
|
||||
{
|
||||
BIND_IN_PROGRESS; // Autobind protocol
|
||||
if(sub_protocol != XK_CARS)
|
||||
BIND_IN_PROGRESS; // Autobind protocol
|
||||
XK_initialize_txid();
|
||||
XK_RF_init();
|
||||
hopping_frequency_no = 0;
|
||||
|
||||
@@ -188,7 +188,7 @@
|
||||
#define DSM_CYRF6936_INO
|
||||
#define DSM_RX_CYRF6936_INO
|
||||
#define E010R5_CYRF6936_INO
|
||||
//#define E01X_CYRF6936_INO
|
||||
#define E01X_CYRF6936_INO
|
||||
#define E129_CYRF6936_INO
|
||||
#define J6PRO_CYRF6936_INO
|
||||
#define LOSI_CYRF6936_INO //Need DSM to be enabled
|
||||
@@ -222,11 +222,12 @@
|
||||
#define BAYANG_RX_NRF24L01_INO
|
||||
#define BUGSMINI_NRF24L01_INO
|
||||
#define CABELL_NRF24L01_INO
|
||||
//#define CFLIE_NRF24L01_INO
|
||||
#define CFLIE_NRF24L01_INO
|
||||
#define CG023_NRF24L01_INO
|
||||
#define CX10_NRF24L01_INO //Include Q2X2 protocol
|
||||
#define DM002_NRF24L01_INO
|
||||
#define E016H_NRF24L01_INO
|
||||
#define EAZYRC_NRF24L01_INO
|
||||
#define ESKY_NRF24L01_INO
|
||||
#define ESKY150_NRF24L01_INO
|
||||
#define FQ777_NRF24L01_INO
|
||||
@@ -240,14 +241,14 @@
|
||||
#define KN_NRF24L01_INO
|
||||
#define KYOSHO2_NRF24L01_INO
|
||||
#define LOLI_NRF24L01_INO
|
||||
//#define MOULDKG_NRF24L01_INO
|
||||
#define MOULDKG_NRF24L01_INO
|
||||
#define NCC1701_NRF24L01_INO
|
||||
#define POTENSIC_NRF24L01_INO
|
||||
#define PROPEL_NRF24L01_INO
|
||||
#define REALACC_NRF24L01_INO
|
||||
#define SGF22_NRF24L01_INO
|
||||
#define SHENQI_NRF24L01_INO
|
||||
#define SYMAX_NRF24L01_INO
|
||||
#define TIGER_NRF24L01_INO
|
||||
#define V2X2_NRF24L01_INO
|
||||
#define V761_NRF24L01_INO
|
||||
#define XERALL_NRF24L01_INO
|
||||
@@ -621,6 +622,8 @@ const PPM_Parameters PPM_prot[14*NBR_BANKS]= {
|
||||
PROTO_E129
|
||||
E129_E129
|
||||
E129_C186
|
||||
PROTO_EAZYRC
|
||||
NONE
|
||||
PROTO_ESKY
|
||||
ESKY_STD
|
||||
ESKY_ET4
|
||||
@@ -795,10 +798,13 @@ const PPM_Parameters PPM_prot[14*NBR_BANKS]= {
|
||||
RLINK_SURFACE
|
||||
RLINK_AIR
|
||||
RLINK_DUMBORC
|
||||
RLINK_RC4G
|
||||
PROTO_SCANNER
|
||||
NONE
|
||||
PROTO_SCORPIO
|
||||
NONE
|
||||
PROTO_SGF22
|
||||
NONE
|
||||
PROTO_SHENQI
|
||||
NONE
|
||||
PROTO_SKYARTEC
|
||||
@@ -812,10 +818,8 @@ const PPM_Parameters PPM_prot[14*NBR_BANKS]= {
|
||||
PROTO_SYMAX
|
||||
SYMAX
|
||||
SYMAX5C
|
||||
PROTO_TIGER
|
||||
NONE
|
||||
PROTO_TRAXXAS
|
||||
RX6519
|
||||
NONE
|
||||
PROTO_V2X2
|
||||
V2X2
|
||||
JXD506
|
||||
@@ -842,6 +846,7 @@ const PPM_Parameters PPM_prot[14*NBR_BANKS]= {
|
||||
PROTO_XK
|
||||
X450
|
||||
X420
|
||||
XK_CARS
|
||||
PROTO_YD717
|
||||
YD717
|
||||
SKYWLKR
|
||||
|
||||
@@ -82,6 +82,7 @@ CFlie|38|CFlie||||||||NRF24L01|
|
||||
[E016HV2](Protocols_Details.md#E016HV2---80)|80|||||||||CC2500/NRF24L01|unknown
|
||||
[E01X](Protocols_Details.md#E01X---45)|45|E012|E015|||||||CYRF6936|HS6200
|
||||
[E129](Protocols_Details.md#E129---83)|83|E129|C186|||||||CYRF6936|RF2500
|
||||
[EazyRC](Protocols_Details.md#EazyRC---61)|61|||||||||NRF24L01|XN297L
|
||||
[ESky](Protocols_Details.md#ESKY---16)|16|ESky|ET4|||||||NRF24L01|
|
||||
[ESky150](Protocols_Details.md#ESKY150---35)|35|||||||||NRF24L01|
|
||||
[ESky150V2](Protocols_Details.md#ESKY150V2---69)|69|||||||||CC2500|NRF51822
|
||||
@@ -131,17 +132,17 @@ CFlie|38|CFlie||||||||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
|
||||
[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|
|
||||
[Redpine](Protocols_Details.md#Redpine---50)|50|FAST|SLOW|||||||NRF24L01|XN297
|
||||
[Scanner](Protocols_Details.md#Scanner---54)|54|||||||||CC2500|
|
||||
[Scorpio](Protocols_Details.md#Scorpio---94)|94|||||||||CYRF6936|
|
||||
[SGF22](Protocols_Details.md#SGF22---97)|97|SGF22||||||||NRF24L01|XN297
|
||||
[Shenqi](Protocols_Details.md#Shenqi---19)|19|Shenqi||||||||NRF24L01|LT8900
|
||||
[Skyartec](Protocols_Details.md#Skyartec---68)|68|||||||||CC2500|CC2500
|
||||
[SLT](Protocols_Details.md#SLT---11)|11|SLT_V1|SLT_V2|Q100|Q200|MR100||||NRF24L01|CC2500
|
||||
[SymaX](Protocols_Details.md#Symax---10)|10|SYMAX|SYMAX5C|||||||NRF24L01|
|
||||
[Tiger](Protocols_Details.md#Tiger---61)|61|||||||||NRF24L01|XN297
|
||||
[Traxxas](Protocols_Details.md#Traxxas---43)|43|6519 RX||||||||CYRF6936|
|
||||
[Traxxas](Protocols_Details.md#Traxxas---43)|43|TQ||||||||CYRF6936|
|
||||
[V2x2](Protocols_Details.md#V2X2---5)|5|V2x2|JXD506|MR101||||||NRF24L01|
|
||||
[V761](Protocols_Details.md#V761---48)|48|3CH|4CH|TOPRC||||||NRF24L01|XN297
|
||||
[V911S](Protocols_Details.md#V911S---46)|46|V911S*|E119*|||||||NRF24L01|XN297
|
||||
@@ -149,7 +150,7 @@ CFlie|38|CFlie||||||||NRF24L01|
|
||||
[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|
|
||||
[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|
|
||||
[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.
|
||||
@@ -367,8 +368,6 @@ TX: Axial AX-4 2.4GHz transmitter, HPI TF-41 and Panda Hobby 3CH Smart Radio 2.4
|
||||
|
||||
Models: Axial SCX24: Deadbolt, Jeep Wranger Rubicon, Chevrolet 1967 C10, B-17 Betty, HPI RF-50 and Panda Hobby: Tetra K1, X1, X2
|
||||
|
||||
**Only 4 frequency hopping tables**
|
||||
|
||||
Extended limits supported
|
||||
|
||||
CH1|CH2|CH3
|
||||
@@ -621,7 +620,7 @@ Calib is the same as the original radio with both sticks down and to the left in
|
||||
Models: Eachine E129/E130 and Twister Ninja 250
|
||||
|
||||
### Sub_protocol C186 - *1*
|
||||
Models: C186/E120, C127/E110, K127, C159, C189, C129v2
|
||||
Models: RC ERA C186/E120, C127/E110, K127, C159, C189, C129v2
|
||||
|
||||
The FC of the heli seems to store the trims Trim A/E/R=CH7..9. If you use these trims, make sure to center them after powering off the heli or they will be added to the previous trims and over correct.
|
||||
|
||||
@@ -671,7 +670,7 @@ CH1|CH2|CH3|CH4
|
||||
A|E|T|R
|
||||
|
||||
## Traxxas - *43*
|
||||
Receiver 6519
|
||||
Transmitter TQ, Receivers: 6519, ECM-2.5
|
||||
|
||||
Extended limits supported
|
||||
|
||||
@@ -1000,6 +999,17 @@ Telemetry: RX_RSSI (for the original value add -256), TX_RSSI, TX_QLY (0..100%)
|
||||
### Sub_protocol DumboRC - *2*
|
||||
Compatible RXs: X6/X6F/X6FG
|
||||
|
||||
### Sub_protocol RC4G - *3*
|
||||
Compatible RXs: R4EH-G(/R4EH-H)
|
||||
|
||||
CH1|CH2|CH3|CH4|CH5|CH6|CH7|CH8|CH9
|
||||
---|---|---|---|---|---|---|---|---
|
||||
CH1|CH2|CH3|CH4|CH5|FS_CH1|FS_CH2|FS_CH3|FS_CH4
|
||||
|
||||
FS=FailSafe
|
||||
|
||||
CH5 is driven by CH3 on the original TX, gyro sensitivity?
|
||||
|
||||
## Futaba - *21*
|
||||
Also called SFHSS depending on radio version.
|
||||
|
||||
@@ -1400,12 +1410,6 @@ A280 -> 6GSENIOR: -100% - 6G, +100% - Senior mode (turn off gyro), LIGHT: cycle
|
||||
|
||||
## XK - *62*
|
||||
|
||||
CH1|CH2|CH3|CH4|CH5|CH6|CH7|CH8|CH9|CH10
|
||||
---|---|---|---|---|---|---|---|---|----
|
||||
A|E|T|R|Flight_modes|Take_off|Emerg stop|3D/6G|Picture|Video
|
||||
|
||||
Flight_modes: -100%=M-Mode, 0%=6G-Mode, +100%=V-Mode. CH6-CH10 are mementary switches.
|
||||
|
||||
CC2500: only X450 is supported.
|
||||
|
||||
### Sub_protocol X450 - *0*
|
||||
@@ -1415,8 +1419,30 @@ If a CC2500 is installed it will be used for this sub protocol. Option in this c
|
||||
|
||||
If only a NRF24L01 is installed then this sub protocol might be problematic because it is using the xn297L emulation with a transmission speed of 250kbps which doesn't work very well with every NRF24L01, this is an hardware issue with the authenticity and accuracy of the components.
|
||||
|
||||
CH1|CH2|CH3|CH4|CH5|CH6|CH7|CH8|CH9|CH10
|
||||
---|---|---|---|---|---|---|---|---|----
|
||||
A|E|T|R|Flight_modes|Take_off|Emerg stop|3D/6G|Picture|Video
|
||||
|
||||
Flight_modes: -100%=M-Mode, 0%=6G-Mode, +100%=V-Mode. CH6-CH10 are mementary switches.
|
||||
|
||||
### Sub_protocol X420 - *1*
|
||||
Models: XK X420/X520 (TX=X4), WLtoys 284131/284161/284010
|
||||
Models: XK X420/X520 (TX=X4)
|
||||
|
||||
CH1|CH2|CH3|CH4|CH5|CH6|CH7|CH8|CH9|CH10
|
||||
---|---|---|---|---|---|---|---|---|----
|
||||
A|E|T|R|Flight_modes|Take_off|Emerg stop|3D/6G|Picture|Video
|
||||
|
||||
Flight_modes: -100%=M-Mode, 0%=6G-Mode, +100%=V-Mode. CH6-CH10 are mementary switches.
|
||||
|
||||
Model: Tiger Drone 1400782
|
||||
|
||||
CH1|CH2|CH3|CH4|CH11|CH12
|
||||
---|---|---|---|---|---
|
||||
A|E|T|R|FLIP|LIGHT
|
||||
|
||||
### Sub_protocol Cars - *2*
|
||||
Models: WLtoys cars 284131/284161/284010/124016/124017/144010 and Eachine EAT14
|
||||
|
||||
|
||||
***
|
||||
# NRF24L01 RF Module
|
||||
@@ -1444,13 +1470,13 @@ Channels 14 and 15 (ANAAUX1 and ANAAUX2) only available with analog aux channel
|
||||
### Sub_protocol BAYANG - *0*
|
||||
Models: Eachine H8(C) mini, BayangToys X6/X7/X9, JJRC JJ850, Floureon H101 ...
|
||||
|
||||
Option=0 -> normal Bayang protocol
|
||||
Option=0 or Telemetry = Off -> normal Bayang protocol
|
||||
|
||||
Option=1 -> enable telemetry with [Silverxxx firmware](https://github.com/silver13/H101-acro/tree/master). Value returned to the TX using FrSkyD Hub are RX RSSI, TX RSSI, A1=uncompensated battery voltage (set the ratio to 5.0 and adjust with offset), A2=compensated battery voltage (set the ratio to 5.0 and adjust with offset) and if supported AccX=P, AccY=I, ACCZ=D (which you can rename after the sensors discovery)
|
||||
Option=1 or Telemetry = On -> enable telemetry with [Silverxxx firmware](https://github.com/silver13/H101-acro/tree/master). Value returned to the TX using FrSkyD Hub are RX RSSI, TX RSSI, A1=uncompensated battery voltage (set the ratio to 5.0 and adjust with offset), A2=compensated battery voltage (set the ratio to 5.0 and adjust with offset) and if supported AccX=P, AccY=I, ACCZ=D (which you can rename after the sensors discovery)
|
||||
|
||||
Option=2 -> enable analog aux channels with [NFE Silverware firmware](https://github.com/NotFastEnuf/NFE_Silverware). Two otherwise static bytes in the protocol overridden to add two 'analog' (non-binary) auxiliary channels.
|
||||
Option=2 or Telemetry = Off+AUX -> enable analog aux channels with [NFE Silverware firmware](https://github.com/NotFastEnuf/NFE_Silverware). Two otherwise static bytes in the protocol overridden to add two 'analog' (non-binary) auxiliary channels.
|
||||
|
||||
Option=3 -> both Silverware telemetry and analog aux channels enabled.
|
||||
Option=3 or Telemetry = On+AUX-> both Silverware telemetry and analog aux channels enabled.
|
||||
|
||||
### Sub_protocol H8S3D - *1*
|
||||
Model: H8S 3D
|
||||
@@ -1626,6 +1652,13 @@ CH1|CH2|CH3|CH4|CH5|CH6|CH7|CH8|CH9
|
||||
---|---|---|---|---|---|---|---|---
|
||||
A|E|T|R|STOP|FLIP|-|HEADLESS|RTH
|
||||
|
||||
## EazyRC - *61*
|
||||
Autobind protocol
|
||||
|
||||
CH1|CH2|CH3|CH4
|
||||
---|---|---|---
|
||||
STEERING||THROTTLE|
|
||||
|
||||
## ESKY - *16*
|
||||
|
||||
CH1|CH2|CH3|CH4|CH5|CH6
|
||||
@@ -1755,9 +1788,9 @@ CH1|CH2|CH3|CH4|CH5
|
||||
| | |T|R|AUX
|
||||
|
||||
## KN - *9*
|
||||
CH1|CH2|CH3|CH4|CH5|CH6|CH7|CH8|CH9|CH10|CH11
|
||||
---|---|---|---|---|---|---|---|---|----|----
|
||||
A|E|T|R|DR|THOLD|IDLEUP|GYRO|Ttrim|Atrim|Etrim
|
||||
CH1|CH2|CH3|CH4|CH5|CH6|CH7|CH8|CH9|CH10|CH11|CH12|CH13
|
||||
---|---|---|---|---|---|---|---|---|----|----|----|----
|
||||
A|E|T|R|DR|THOLD|IDLEUP|GYRO|Ttrim|Atrim|Etrim|Rtrim|HoverDebugging
|
||||
|
||||
Dual Rate: +100%=full range, Throttle Hold: +100%=hold, Idle Up: +100%=3D, GYRO: -100%=6G, +100%=3G
|
||||
|
||||
@@ -1916,14 +1949,10 @@ A|E|T|R|FLIP|LED|PICTURE|VIDEO|HEADLESS|RTH|XCAL|YCAL
|
||||
Model: JXD 509 is using Q282 with CH12=Start/Stop motors
|
||||
|
||||
## Realacc - *76*
|
||||
Model: Realacc R11
|
||||
|
||||
Untested protocol, let me know if it works.
|
||||
Model: Realacc R11, Eachine E017
|
||||
|
||||
Autobind protocol
|
||||
|
||||
### Sub_protocol R11 - *0*
|
||||
|
||||
CH1|CH2|CH3|CH4|CH5|CH6|CH7|CH8|CH9|CH10
|
||||
---|---|---|---|---|---|---|---|---|----
|
||||
A|E|T|R|FLIP|LIGHT|CALIB|HLESS|RTH|UNK
|
||||
@@ -1934,6 +1963,15 @@ A|E|T|R|FLIP|LIGHT|CALIB|HLESS|RTH|UNK
|
||||
### Sub_protocol FAST - *0*
|
||||
### Sub_protocol SLOW - *1*
|
||||
|
||||
## SGF22 - *97*
|
||||
Autobind protocol
|
||||
|
||||
Model: SGF22
|
||||
|
||||
CH1|CH2|CH3|CH4|CH5|CH6|CH7|CH8|CH9
|
||||
---|---|---|---|---|---|---|---|---
|
||||
A|E|T|R|MODE|FLIP|LIGHT|PHOTO|VIDEO
|
||||
|
||||
## Shenqi - *19*
|
||||
Autobind protocol
|
||||
|
||||
@@ -1996,17 +2034,6 @@ AUTO: Land=-100% Takeoff=+100%
|
||||
|
||||
The model can work with a none centered throttle.
|
||||
|
||||
## Tiger - *61*
|
||||
Models: Tiger Drone 1400782, WLToys 124016 / 124017 / 144010 and Eachine EAT14
|
||||
|
||||
Autobind protocol
|
||||
|
||||
**Only 1 ID**
|
||||
|
||||
CH1|CH2|CH3|CH4|CH5|CH6
|
||||
---|---|---|---|---|---
|
||||
A|E|T|R|FLIP|LIGHT
|
||||
|
||||
## V761 - *48*
|
||||
|
||||
Gyro: -100%=Beginner mode (Gyro on, yaw and pitch rate limited), 0%=Mid Mode ( Gyro on no rate limits), +100%=Mode Expert Gyro off
|
||||
|
||||
@@ -84,23 +84,30 @@ buildEachRFModule() {
|
||||
}
|
||||
|
||||
buildReleaseFiles(){
|
||||
if [[ "$BOARD" =~ ":avr:multixmega32d4" ]]; then
|
||||
if [[ "$RELEASE" == "scripts" ]]; then
|
||||
build_release_scripts;
|
||||
elif [[ "$RELEASE" == "orangerx" ]]; then
|
||||
build_release_orx;
|
||||
build_release_extras;
|
||||
elif [[ "$BOARD" =~ ":avr:multiatmega328p:bootloader=none" ]]; then
|
||||
elif [[ "$RELEASE" == "atmega328p" ]]; then
|
||||
build_release_avr_noboot;
|
||||
elif [[ "$BOARD" =~ ":avr:multiatmega328p:bootloader=optiboot" ]]; then
|
||||
elif [[ "$RELEASE" == "atmega328p-optiboot" ]]; then
|
||||
build_release_avr_optiboot;
|
||||
elif [[ "$BOARD" =~ ":STM32F1:multistm32f103cb:debug_option=none" ]]; then
|
||||
build_release_stm32f1_no_debug;
|
||||
elif [[ "$BOARD" =~ ":STM32F1:multistm32f103cb:debug_option=native" ]]; then
|
||||
build_release_stm32f1_native_debug;
|
||||
elif [[ "$BOARD" =~ ":STM32F1:multistm32f103cb:debug_option=ftdi" ]]; then
|
||||
build_release_stm32f1_serial_debug;
|
||||
elif [[ "$BOARD" =~ ":STM32F1:multi5in1t18int" ]]; then
|
||||
elif [[ "$RELEASE" == "stm32f103-128k-4in1" ]]; then
|
||||
build_release_stm32f1_4in1_no_debug;
|
||||
elif [[ "$RELEASE" == "stm32f103-128k-usb-debug" ]]; then
|
||||
build_release_stm32f1_4in1_native_debug;
|
||||
elif [[ "$RELEASE" == "stm32f103-128k-serial-debug" ]]; then
|
||||
build_release_stm32f1_4in1_serial_debug;
|
||||
elif [[ "$RELEASE" == "stm32f103-cc2500-64k" ]]; then
|
||||
build_release_stm32f1_cc2500_64k;
|
||||
elif [[ "$RELEASE" == "stm32f103-cc2500-128k" ]]; then
|
||||
build_release_stm32f1_cc2500_128k;
|
||||
elif [[ "$RELEASE" == "stm32f103-128k-5in1" ]]; then
|
||||
build_release_stm32f1_5in1;
|
||||
elif [[ "$RELEASE" == "tlite-5in1" ]]; then
|
||||
build_release_stm32f1_tlite;
|
||||
elif [[ "$RELEASE" == "t18-5in1" ]]; then
|
||||
build_release_stm32f1_t18int;
|
||||
elif [[ "$BOARD" =~ ":STM32F1:multistm32f103c8:debug_option=none" ]]; then
|
||||
build_release_stm32f1_64k;
|
||||
else
|
||||
printf "No release files for this board.";
|
||||
fi
|
||||
|
||||
97
buildroot/bin/build_release_stm32f1_4in1_no_debug
Normal file
97
buildroot/bin/build_release_stm32f1_4in1_no_debug
Normal file
@@ -0,0 +1,97 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
source ./buildroot/bin/buildFunctions;
|
||||
exitcode=0;
|
||||
|
||||
# Generic 4-in-1 AIR builds
|
||||
printf "\e[33;1mBuilding mm-stm-serial-aetr-air-v$MULTI_VERSION.bin\e[0m\n";
|
||||
opt_add MULTI_AIR
|
||||
opt_disable ENABLE_PPM;
|
||||
buildMulti;
|
||||
exitcode=$((exitcode+$?));
|
||||
mv build/Multiprotocol.ino.bin ./binaries/mm-stm-serial-aetr-air-v$MULTI_VERSION.bin;
|
||||
|
||||
printf "\e[33;1mBuilding mm-stm-serial-taer-air-v$MULTI_VERSION.bin\e[0m\n";
|
||||
opt_replace AETR TAER;
|
||||
buildMulti;
|
||||
exitcode=$((exitcode+$?));
|
||||
mv build/Multiprotocol.ino.bin ./binaries/mm-stm-serial-taer-air-v$MULTI_VERSION.bin;
|
||||
|
||||
printf "\e[33;1mBuilding mm-stm-serial-reta-air-v$MULTI_VERSION.bin\e[0m\n";
|
||||
opt_replace TAER RETA;
|
||||
buildMulti;
|
||||
exitcode=$((exitcode+$?));
|
||||
mv build/Multiprotocol.ino.bin ./binaries/mm-stm-serial-reta-air-v$MULTI_VERSION.bin;
|
||||
|
||||
# Generic 4-in-1 SURFACE builds
|
||||
printf "\e[33;1mBuilding mm-stm-serial-aetr-sfc-v$MULTI_VERSION.bin\e[0m\n";
|
||||
opt_replace RETA AETR;
|
||||
opt_remove MULTI_AIR;
|
||||
opt_add MULTI_SURFACE;
|
||||
buildMulti;
|
||||
exitcode=$((exitcode+$?));
|
||||
mv build/Multiprotocol.ino.bin ./binaries/mm-stm-serial-aetr-sfc-v$MULTI_VERSION.bin;
|
||||
|
||||
printf "\e[33;1mBuilding mm-stm-serial-taer-sfc-v$MULTI_VERSION.bin\e[0m\n";
|
||||
opt_replace AETR TAER;
|
||||
buildMulti;
|
||||
exitcode=$((exitcode+$?));
|
||||
mv build/Multiprotocol.ino.bin ./binaries/mm-stm-serial-taer-sfc-v$MULTI_VERSION.bin;
|
||||
|
||||
printf "\e[33;1mBuilding mm-stm-serial-reta-sfc-v$MULTI_VERSION.bin\e[0m\n";
|
||||
opt_replace TAER RETA;
|
||||
buildMulti;
|
||||
exitcode=$((exitcode+$?));
|
||||
mv build/Multiprotocol.ino.bin ./binaries/mm-stm-serial-reta-sfc-v$MULTI_VERSION.bin;
|
||||
|
||||
# Generic 4-in-1 LBT/EU builds
|
||||
printf "\e[33;1mBuilding mm-stm-serial-aetr-lbt-v$MULTI_VERSION.bin\e[0m\n";
|
||||
opt_replace RETA AETR;
|
||||
opt_remove MULTI_SURFACE;
|
||||
opt_add MULTI_EU;
|
||||
buildMulti;
|
||||
exitcode=$((exitcode+$?));
|
||||
mv build/Multiprotocol.ino.bin ./binaries/mm-stm-serial-aetr-lbt-v$MULTI_VERSION.bin;
|
||||
|
||||
printf "\e[33;1mBuilding mm-stm-serial-taer-lbt-v$MULTI_VERSION.bin\e[0m\n";
|
||||
opt_replace AETR TAER;
|
||||
buildMulti;
|
||||
exitcode=$((exitcode+$?));
|
||||
mv build/Multiprotocol.ino.bin ./binaries/mm-stm-serial-taer-lbt-v$MULTI_VERSION.bin;
|
||||
|
||||
printf "\e[33;1mBuilding mm-stm-serial-reta-lbt-v$MULTI_VERSION.bin\e[0m\n";
|
||||
opt_replace TAER RETA;
|
||||
buildMulti;
|
||||
exitcode=$((exitcode+$?));
|
||||
mv build/Multiprotocol.ino.bin ./binaries/mm-stm-serial-reta-lbt-v$MULTI_VERSION.bin;
|
||||
|
||||
# 4-in-1 PPM builds
|
||||
printf "\e[33;1mBuilding mm-stm-ppm-aetr-v$MULTI_VERSION.bin\e[0m\n";
|
||||
opt_add MULTI_AIR;
|
||||
opt_enable A7105_INSTALLED;
|
||||
opt_enable CYRF6936_INSTALLED;
|
||||
opt_enable NRF24L01_INSTALLED;
|
||||
opt_remove MULTI_EU;
|
||||
opt_enable ENABLE_PPM;
|
||||
opt_disable ENABLE_SERIAL;
|
||||
opt_replace RETA AETR;
|
||||
opt_disable MULTI_STATUS;
|
||||
opt_disable MULTI_TELEMETRY;
|
||||
opt_set NBR_BANKS 5;
|
||||
buildMulti;
|
||||
exitcode=$((exitcode+$?));
|
||||
mv build/Multiprotocol.ino.bin ./binaries/mm-stm-ppm-aetr-v$MULTI_VERSION.bin;
|
||||
|
||||
printf "\e[33;1mBuilding mm-stm-ppm-taer-v$MULTI_VERSION.bin\e[0m\n";
|
||||
opt_replace AETR TAER;
|
||||
buildMulti;
|
||||
exitcode=$((exitcode+$?));
|
||||
mv build/Multiprotocol.ino.bin ./binaries/mm-stm-ppm-taer-v$MULTI_VERSION.bin;
|
||||
|
||||
printf "\e[33;1mBuilding mm-stm-ppm-reta-v$MULTI_VERSION.bin\e[0m\n";
|
||||
opt_replace TAER RETA;
|
||||
buildMulti;
|
||||
exitcode=$((exitcode+$?));
|
||||
mv build/Multiprotocol.ino.bin ./binaries/mm-stm-ppm-reta-v$MULTI_VERSION.bin;
|
||||
|
||||
exit $exitcode;
|
||||
71
buildroot/bin/build_release_stm32f1_5in1
Normal file
71
buildroot/bin/build_release_stm32f1_5in1
Normal file
@@ -0,0 +1,71 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
source ./buildroot/bin/buildFunctions;
|
||||
exitcode=0;
|
||||
|
||||
# DIY 5-in-1 AIR builds
|
||||
printf "\e[33;1mBuilding mm-stm-5in1-aetr-air-v$MULTI_VERSION.bin\e[0m\n";
|
||||
opt_add MULTI_AIR;
|
||||
opt_disable ENABLE_PPM;
|
||||
opt_disable CFLIE_NRF24L01_INO
|
||||
opt_enable SX1276_INSTALLED;
|
||||
buildMulti;
|
||||
exitcode=$((exitcode+$?));
|
||||
mv build/Multiprotocol.ino.bin ./binaries/mm-stm-5in1-aetr-air-v$MULTI_VERSION.bin;
|
||||
|
||||
printf "\e[33;1mBuilding mm-stm-5in1-taer-air-v$MULTI_VERSION.bin\e[0m\n";
|
||||
opt_replace AETR TAER;
|
||||
buildMulti;
|
||||
exitcode=$((exitcode+$?));
|
||||
mv build/Multiprotocol.ino.bin ./binaries/mm-stm-5in1-taer-air-v$MULTI_VERSION.bin;
|
||||
|
||||
printf "\e[33;1mBuilding mm-stm-5in1-reta-air-v$MULTI_VERSION.bin\e[0m\n";
|
||||
opt_replace TAER RETA;
|
||||
buildMulti;
|
||||
exitcode=$((exitcode+$?));
|
||||
mv build/Multiprotocol.ino.bin ./binaries/mm-stm-5in1-reta-air-v$MULTI_VERSION.bin;
|
||||
|
||||
# DIY 5-in-1 SURFACE builds
|
||||
printf "\e[33;1mBuilding mm-stm-5in1-aetr-sfc-v$MULTI_VERSION.bin\e[0m\n";
|
||||
opt_add MULTI_SURFACE;
|
||||
opt_remove MULTI_AIR;
|
||||
opt_enable CFLIE_NRF24L01_INO
|
||||
opt_replace RETA AETR;
|
||||
buildMulti;
|
||||
exitcode=$((exitcode+$?));
|
||||
mv build/Multiprotocol.ino.bin ./binaries/mm-stm-5in1-aetr-sfc-v$MULTI_VERSION.bin;
|
||||
|
||||
printf "\e[33;1mBuilding mm-stm-5in1-taer-sfc-v$MULTI_VERSION.bin\e[0m\n";
|
||||
opt_replace AETR TAER;
|
||||
buildMulti;
|
||||
exitcode=$((exitcode+$?));
|
||||
mv build/Multiprotocol.ino.bin ./binaries/mm-stm-5in1-taer-sfc-v$MULTI_VERSION.bin;
|
||||
|
||||
printf "\e[33;1mBuilding mm-stm-5in1-reta-sfc-v$MULTI_VERSION.bin\e[0m\n";
|
||||
opt_replace TAER RETA;
|
||||
buildMulti;
|
||||
exitcode=$((exitcode+$?));
|
||||
mv build/Multiprotocol.ino.bin ./binaries/mm-stm-5in1-reta-sfc-v$MULTI_VERSION.bin;
|
||||
|
||||
# DIY 5-in-1 LBT builds
|
||||
printf "\e[33;1mBuilding mm-stm-5in1-aetr-lbt-v$MULTI_VERSION.bin\e[0m\n";
|
||||
opt_remove MULTI_SURFACE;
|
||||
opt_add MULTI_EU;
|
||||
opt_replace RETA AETR;
|
||||
buildMulti;
|
||||
exitcode=$((exitcode+$?));
|
||||
mv build/Multiprotocol.ino.bin ./binaries/mm-stm-5in1-aetr-lbt-v$MULTI_VERSION.bin;
|
||||
|
||||
printf "\e[33;1mBuilding mm-stm-5in1-taer-lbt-v$MULTI_VERSION.bin\e[0m\n";
|
||||
opt_replace AETR TAER;
|
||||
buildMulti;
|
||||
exitcode=$((exitcode+$?));
|
||||
mv build/Multiprotocol.ino.bin ./binaries/mm-stm-5in1-taer-lbt-v$MULTI_VERSION.bin;
|
||||
|
||||
printf "\e[33;1mBuilding mm-stm-5in1-reta-lbt-v$MULTI_VERSION.bin\e[0m\n";
|
||||
opt_replace TAER RETA;
|
||||
buildMulti;
|
||||
exitcode=$((exitcode+$?));
|
||||
mv build/Multiprotocol.ino.bin ./binaries/mm-stm-5in1-reta-lbt-v$MULTI_VERSION.bin;
|
||||
|
||||
exit $exitcode;
|
||||
49
buildroot/bin/build_release_stm32f1_cc2500_128k
Normal file
49
buildroot/bin/build_release_stm32f1_cc2500_128k
Normal file
@@ -0,0 +1,49 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
source ./buildroot/bin/buildFunctions;
|
||||
exitcode=0;
|
||||
|
||||
# CC2500-only FCC builds
|
||||
printf "\e[33;1mBuilding mm-stm-cc2500-aetr-v$MULTI_VERSION.bin\e[0m\n";
|
||||
opt_disable A7105_INSTALLED;
|
||||
opt_disable CYRF6936_INSTALLED;
|
||||
opt_disable NRF24L01_INSTALLED;
|
||||
opt_disable ENABLE_PPM;
|
||||
opt_disable INVERT_TELEMETRY;
|
||||
buildMulti;
|
||||
exitcode=$((exitcode+$?));
|
||||
mv build/Multiprotocol.ino.bin ./binaries/mm-stm-cc2500-aetr-v$MULTI_VERSION.bin;
|
||||
|
||||
printf "\e[33;1mBuilding mm-stm-cc2500-taer-v$MULTI_VERSION.bin\e[0m\n";
|
||||
opt_replace AETR TAER;
|
||||
buildMulti;
|
||||
exitcode=$((exitcode+$?));
|
||||
mv build/Multiprotocol.ino.bin ./binaries/mm-stm-cc2500-taer-v$MULTI_VERSION.bin;
|
||||
|
||||
printf "\e[33;1mBuilding mm-stm-cc2500-reta-v$MULTI_VERSION.bin\e[0m\n";
|
||||
opt_replace TAER RETA;
|
||||
buildMulti;
|
||||
exitcode=$((exitcode+$?));
|
||||
mv build/Multiprotocol.ino.bin ./binaries/mm-stm-cc2500-reta-v$MULTI_VERSION.bin;
|
||||
|
||||
# CC2500-only LBT/EU builds
|
||||
printf "\e[33;1mBuilding mm-stm-cc2500-aetr-lbt-v$MULTI_VERSION.bin\e[0m\n";
|
||||
opt_replace RETA AETR;
|
||||
opt_add MULTI_EU;
|
||||
buildMulti;
|
||||
exitcode=$((exitcode+$?));
|
||||
mv build/Multiprotocol.ino.bin ./binaries/mm-stm-cc2500-aetr-lbt-v$MULTI_VERSION.bin;
|
||||
|
||||
printf "\e[33;1mBuilding mm-stm-cc2500-taer-lbt-v$MULTI_VERSION.bin\e[0m\n";
|
||||
opt_replace AETR TAER;
|
||||
buildMulti;
|
||||
exitcode=$((exitcode+$?));
|
||||
mv build/Multiprotocol.ino.bin ./binaries/mm-stm-cc2500-taer-lbt-v$MULTI_VERSION.bin;
|
||||
|
||||
printf "\e[33;1mBuilding mm-stm-cc2500-reta-lbt-v$MULTI_VERSION.bin\e[0m\n";
|
||||
opt_replace TAER RETA;
|
||||
buildMulti;
|
||||
exitcode=$((exitcode+$?));
|
||||
mv build/Multiprotocol.ino.bin ./binaries/mm-stm-cc2500-reta-lbt-v$MULTI_VERSION.bin;
|
||||
|
||||
exit $exitcode;
|
||||
@@ -5,8 +5,8 @@ exitcode=0;
|
||||
|
||||
# CC2500-only 64Kb FCC builds
|
||||
printf "\e[33;1mBuilding mm-stm-cc2500-64-aetr-v$MULTI_VERSION.bin\e[0m\n";
|
||||
opt_enable $ALL_PROTOCOLS;
|
||||
opt_disable IKEAANSLUTA_CC2500_INO;
|
||||
#opt_enable $ALL_PROTOCOLS;
|
||||
#opt_disable IKEAANSLUTA_CC2500_INO;
|
||||
opt_disable ENABLE_PPM;
|
||||
opt_disable A7105_INSTALLED;
|
||||
opt_disable CYRF6936_INSTALLED;
|
||||
@@ -1,160 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
source ./buildroot/bin/buildFunctions;
|
||||
exitcode=0;
|
||||
|
||||
# Generic 4-in-1 FCC builds
|
||||
printf "\e[33;1mBuilding mm-stm-serial-aetr-v$MULTI_VERSION.bin\e[0m\n";
|
||||
opt_disable ENABLE_PPM;
|
||||
buildMulti;
|
||||
exitcode=$((exitcode+$?));
|
||||
mv build/Multiprotocol.ino.bin ./binaries/mm-stm-serial-aetr-v$MULTI_VERSION.bin;
|
||||
|
||||
printf "\e[33;1mBuilding mm-stm-serial-taer-v$MULTI_VERSION.bin\e[0m\n";
|
||||
opt_replace AETR TAER;
|
||||
buildMulti;
|
||||
exitcode=$((exitcode+$?));
|
||||
mv build/Multiprotocol.ino.bin ./binaries/mm-stm-serial-taer-v$MULTI_VERSION.bin;
|
||||
|
||||
printf "\e[33;1mBuilding mm-stm-serial-reta-v$MULTI_VERSION.bin\e[0m\n";
|
||||
opt_replace TAER RETA;
|
||||
buildMulti;
|
||||
exitcode=$((exitcode+$?));
|
||||
mv build/Multiprotocol.ino.bin ./binaries/mm-stm-serial-reta-v$MULTI_VERSION.bin;
|
||||
|
||||
# Generic 4-in-1 LBT/EU builds
|
||||
printf "\e[33;1mBuilding mm-stm-serial-aetr-lbt-v$MULTI_VERSION.bin\e[0m\n";
|
||||
opt_replace RETA AETR;
|
||||
opt_add MULTI_EU;
|
||||
buildMulti;
|
||||
exitcode=$((exitcode+$?));
|
||||
mv build/Multiprotocol.ino.bin ./binaries/mm-stm-serial-aetr-lbt-v$MULTI_VERSION.bin;
|
||||
|
||||
printf "\e[33;1mBuilding mm-stm-serial-taer-lbt-v$MULTI_VERSION.bin\e[0m\n";
|
||||
opt_replace AETR TAER;
|
||||
buildMulti;
|
||||
exitcode=$((exitcode+$?));
|
||||
mv build/Multiprotocol.ino.bin ./binaries/mm-stm-serial-taer-lbt-v$MULTI_VERSION.bin;
|
||||
|
||||
printf "\e[33;1mBuilding mm-stm-serial-reta-lbt-v$MULTI_VERSION.bin\e[0m\n";
|
||||
opt_replace TAER RETA;
|
||||
buildMulti;
|
||||
exitcode=$((exitcode+$?));
|
||||
mv build/Multiprotocol.ino.bin ./binaries/mm-stm-serial-reta-lbt-v$MULTI_VERSION.bin;
|
||||
|
||||
# DIY 5-in-1 builds
|
||||
printf "\e[33;1mBuilding mm-stm-5in1-aetr-v$MULTI_VERSION.bin\e[0m\n";
|
||||
opt_remove MULTI_EU;
|
||||
opt_replace RETA AETR;
|
||||
opt_enable SX1276_INSTALLED;
|
||||
buildMulti;
|
||||
exitcode=$((exitcode+$?));
|
||||
mv build/Multiprotocol.ino.bin ./binaries/mm-stm-5in1-aetr-v$MULTI_VERSION.bin;
|
||||
|
||||
printf "\e[33;1mBuilding mm-stm-5in1-taer-v$MULTI_VERSION.bin\e[0m\n";
|
||||
opt_replace AETR TAER;
|
||||
buildMulti;
|
||||
exitcode=$((exitcode+$?));
|
||||
mv build/Multiprotocol.ino.bin ./binaries/mm-stm-5in1-taer-v$MULTI_VERSION.bin;
|
||||
|
||||
printf "\e[33;1mBuilding mm-stm-5in1-reta-v$MULTI_VERSION.bin\e[0m\n";
|
||||
opt_replace TAER RETA;
|
||||
buildMulti;
|
||||
exitcode=$((exitcode+$?));
|
||||
mv build/Multiprotocol.ino.bin ./binaries/mm-stm-5in1-reta-v$MULTI_VERSION.bin;
|
||||
|
||||
# T-Lite 5-in-1 builds
|
||||
printf "\e[33;1mBuilding mm-tlite5in1-aetr-v$MULTI_VERSION.bin\e[0m\n";
|
||||
opt_replace RETA AETR;
|
||||
opt_disable INVERT_TELEMETRY;
|
||||
opt_disable SX1276_INSTALLED;
|
||||
opt_enable "MULTI_5IN1_INTERNAL JP_TLite"
|
||||
buildMulti;
|
||||
exitcode=$((exitcode+$?));
|
||||
mv build/Multiprotocol.ino.bin ./binaries/mm-tlite5in1-aetr-v$MULTI_VERSION.bin;
|
||||
|
||||
printf "\e[33;1mBuilding mm-tlite5in1-taer-v$MULTI_VERSION.bin\e[0m\n";
|
||||
opt_replace AETR TAER;
|
||||
buildMulti;
|
||||
exitcode=$((exitcode+$?));
|
||||
mv build/Multiprotocol.ino.bin ./binaries/mm-tlite5in1-taer-v$MULTI_VERSION.bin;
|
||||
|
||||
printf "\e[33;1mBuilding mm-tlite5in1-reta-v$MULTI_VERSION.bin\e[0m\n";
|
||||
opt_replace TAER RETA;
|
||||
buildMulti;
|
||||
exitcode=$((exitcode+$?));
|
||||
mv build/Multiprotocol.ino.bin ./binaries/mm-tlite5in1-reta-v$MULTI_VERSION.bin;
|
||||
|
||||
# CC2500-only FCC builds
|
||||
printf "\e[33;1mBuilding mm-stm-cc2500-aetr-v$MULTI_VERSION.bin\e[0m\n";
|
||||
opt_replace RETA AETR;
|
||||
opt_disable "MULTI_5IN1_INTERNAL JP_TLite"
|
||||
opt_disable A7105_INSTALLED;
|
||||
opt_disable CYRF6936_INSTALLED;
|
||||
opt_disable NRF24L01_INSTALLED;
|
||||
opt_disable INVERT_TELEMETRY;
|
||||
buildMulti;
|
||||
exitcode=$((exitcode+$?));
|
||||
mv build/Multiprotocol.ino.bin ./binaries/mm-stm-cc2500-aetr-v$MULTI_VERSION.bin;
|
||||
|
||||
printf "\e[33;1mBuilding mm-stm-cc2500-taer-v$MULTI_VERSION.bin\e[0m\n";
|
||||
opt_replace AETR TAER;
|
||||
buildMulti;
|
||||
exitcode=$((exitcode+$?));
|
||||
mv build/Multiprotocol.ino.bin ./binaries/mm-stm-cc2500-taer-v$MULTI_VERSION.bin;
|
||||
|
||||
printf "\e[33;1mBuilding mm-stm-cc2500-reta-v$MULTI_VERSION.bin\e[0m\n";
|
||||
opt_replace TAER RETA;
|
||||
buildMulti;
|
||||
exitcode=$((exitcode+$?));
|
||||
mv build/Multiprotocol.ino.bin ./binaries/mm-stm-cc2500-reta-v$MULTI_VERSION.bin;
|
||||
|
||||
# CC2500-only LBT/EU builds
|
||||
printf "\e[33;1mBuilding mm-stm-cc2500-aetr-lbt-v$MULTI_VERSION.bin\e[0m\n";
|
||||
opt_replace RETA AETR;
|
||||
opt_add MULTI_EU;
|
||||
buildMulti;
|
||||
exitcode=$((exitcode+$?));
|
||||
mv build/Multiprotocol.ino.bin ./binaries/mm-stm-cc2500-aetr-lbt-v$MULTI_VERSION.bin;
|
||||
|
||||
printf "\e[33;1mBuilding mm-stm-cc2500-taer-lbt-v$MULTI_VERSION.bin\e[0m\n";
|
||||
opt_replace AETR TAER;
|
||||
buildMulti;
|
||||
exitcode=$((exitcode+$?));
|
||||
mv build/Multiprotocol.ino.bin ./binaries/mm-stm-cc2500-taer-lbt-v$MULTI_VERSION.bin;
|
||||
|
||||
printf "\e[33;1mBuilding mm-stm-cc2500-reta-lbt-v$MULTI_VERSION.bin\e[0m\n";
|
||||
opt_replace TAER RETA;
|
||||
buildMulti;
|
||||
exitcode=$((exitcode+$?));
|
||||
mv build/Multiprotocol.ino.bin ./binaries/mm-stm-cc2500-reta-lbt-v$MULTI_VERSION.bin;
|
||||
|
||||
# 4-in-1 PPM builds
|
||||
printf "\e[33;1mBuilding mm-stm-ppm-aetr-v$MULTI_VERSION.bin\e[0m\n";
|
||||
opt_enable A7105_INSTALLED;
|
||||
opt_enable CYRF6936_INSTALLED;
|
||||
opt_enable NRF24L01_INSTALLED;
|
||||
opt_remove MULTI_EU;
|
||||
opt_enable ENABLE_PPM;
|
||||
opt_disable ENABLE_SERIAL;
|
||||
opt_replace RETA AETR;
|
||||
opt_disable MULTI_STATUS;
|
||||
opt_disable MULTI_TELEMETRY;
|
||||
opt_set NBR_BANKS 5;
|
||||
buildMulti;
|
||||
exitcode=$((exitcode+$?));
|
||||
mv build/Multiprotocol.ino.bin ./binaries/mm-stm-ppm-aetr-v$MULTI_VERSION.bin;
|
||||
|
||||
printf "\e[33;1mBuilding mm-stm-ppm-taer-v$MULTI_VERSION.bin\e[0m\n";
|
||||
opt_replace AETR TAER;
|
||||
buildMulti;
|
||||
exitcode=$((exitcode+$?));
|
||||
mv build/Multiprotocol.ino.bin ./binaries/mm-stm-ppm-taer-v$MULTI_VERSION.bin;
|
||||
|
||||
printf "\e[33;1mBuilding mm-stm-ppm-reta-v$MULTI_VERSION.bin\e[0m\n";
|
||||
opt_replace TAER RETA;
|
||||
buildMulti;
|
||||
exitcode=$((exitcode+$?));
|
||||
mv build/Multiprotocol.ino.bin ./binaries/mm-stm-ppm-reta-v$MULTI_VERSION.bin;
|
||||
|
||||
exit $exitcode;
|
||||
@@ -3,23 +3,65 @@
|
||||
source ./buildroot/bin/buildFunctions;
|
||||
exitcode=0;
|
||||
|
||||
printf "\e[33;1mBuilding mm-t18int-aetr-v$MULTI_VERSION.bin\e[0m\n";
|
||||
# T18 5-in-1 AIR builds
|
||||
printf "\e[33;1mBuilding mm-t18int-aetr-air-v$MULTI_VERSION.bin\e[0m\n";
|
||||
opt_add MULTI_AIR
|
||||
opt_disable ENABLE_PPM;
|
||||
opt_disable INVERT_TELEMETRY;
|
||||
buildMulti;
|
||||
exitcode=$((exitcode+$?));
|
||||
mv build/Multiprotocol.ino.bin ./binaries/mm-t18int-aetr-v$MULTI_VERSION.bin;
|
||||
mv build/Multiprotocol.ino.bin ./binaries/mm-t18int-aetr-air-v$MULTI_VERSION.bin;
|
||||
|
||||
printf "\e[33;1mBuilding mm-t18int-taer-v$MULTI_VERSION.bin\e[0m\n";
|
||||
printf "\e[33;1mBuilding mm-t18int-taer-air-v$MULTI_VERSION.bin\e[0m\n";
|
||||
opt_replace AETR TAER;
|
||||
buildMulti;
|
||||
exitcode=$((exitcode+$?));
|
||||
mv build/Multiprotocol.ino.bin ./binaries/mm-t18int-taer-v$MULTI_VERSION.bin;
|
||||
mv build/Multiprotocol.ino.bin ./binaries/mm-t18int-taer-air-v$MULTI_VERSION.bin;
|
||||
|
||||
printf "\e[33;1mBuilding mm-t18int-reta-v$MULTI_VERSION.bin\e[0m\n";
|
||||
printf "\e[33;1mBuilding mm-t18int-reta-air-v$MULTI_VERSION.bin\e[0m\n";
|
||||
opt_replace TAER RETA;
|
||||
buildMulti;
|
||||
exitcode=$((exitcode+$?));
|
||||
mv build/Multiprotocol.ino.bin ./binaries/mm-t18int-reta-v$MULTI_VERSION.bin;
|
||||
mv build/Multiprotocol.ino.bin ./binaries/mm-t18int-reta-air-v$MULTI_VERSION.bin;
|
||||
|
||||
# T18 5-in-1 SURFACE builds
|
||||
printf "\e[33;1mBuilding mm-t18int-aetr-sfc-v$MULTI_VERSION.bin\e[0m\n";
|
||||
opt_remove MULTI_AIR
|
||||
opt_add MULTI_SURFACE
|
||||
buildMulti;
|
||||
exitcode=$((exitcode+$?));
|
||||
mv build/Multiprotocol.ino.bin ./binaries/mm-t18int-aetr-sfc-v$MULTI_VERSION.bin;
|
||||
|
||||
printf "\e[33;1mBuilding mm-t18int-taer-sfc-v$MULTI_VERSION.bin\e[0m\n";
|
||||
opt_replace AETR TAER;
|
||||
buildMulti;
|
||||
exitcode=$((exitcode+$?));
|
||||
mv build/Multiprotocol.ino.bin ./binaries/mm-t18int-taer-sfc-v$MULTI_VERSION.bin;
|
||||
|
||||
printf "\e[33;1mBuilding mm-t18int-reta-sfc-v$MULTI_VERSION.bin\e[0m\n";
|
||||
opt_replace TAER RETA;
|
||||
buildMulti;
|
||||
exitcode=$((exitcode+$?));
|
||||
mv build/Multiprotocol.ino.bin ./binaries/mm-t18int-reta-sfc-v$MULTI_VERSION.bin;
|
||||
|
||||
# T18 5-in-1 LBT/EU builds
|
||||
printf "\e[33;1mBuilding mm-t18int-aetr-lbt-v$MULTI_VERSION.bin\e[0m\n";
|
||||
opt_remove MULTI_SURFACE
|
||||
opt_add MULTI_EU
|
||||
buildMulti;
|
||||
exitcode=$((exitcode+$?));
|
||||
mv build/Multiprotocol.ino.bin ./binaries/mm-t18int-aetr-lbt-v$MULTI_VERSION.bin;
|
||||
|
||||
printf "\e[33;1mBuilding mm-t18int-taer-lbt-v$MULTI_VERSION.bin\e[0m\n";
|
||||
opt_replace AETR TAER;
|
||||
buildMulti;
|
||||
exitcode=$((exitcode+$?));
|
||||
mv build/Multiprotocol.ino.bin ./binaries/mm-t18int-taer-lbt-v$MULTI_VERSION.bin;
|
||||
|
||||
printf "\e[33;1mBuilding mm-t18int-reta-lbt-v$MULTI_VERSION.bin\e[0m\n";
|
||||
opt_replace TAER RETA;
|
||||
buildMulti;
|
||||
exitcode=$((exitcode+$?));
|
||||
mv build/Multiprotocol.ino.bin ./binaries/mm-t18int-reta-lbt-v$MULTI_VERSION.bin;
|
||||
|
||||
exit $exitcode;
|
||||
|
||||
70
buildroot/bin/build_release_stm32f1_tlite
Normal file
70
buildroot/bin/build_release_stm32f1_tlite
Normal file
@@ -0,0 +1,70 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
source ./buildroot/bin/buildFunctions;
|
||||
exitcode=0;
|
||||
|
||||
# T-Lite 5-in-1 AIR builds
|
||||
printf "\e[33;1mBuilding mm-tlite5in1-aetr-air-v$MULTI_VERSION.bin\e[0m\n";
|
||||
opt_add MULTI_AIR;
|
||||
opt_disable ENABLE_PPM;
|
||||
opt_disable INVERT_TELEMETRY;
|
||||
opt_enable "MULTI_5IN1_INTERNAL JP_TLite"
|
||||
buildMulti;
|
||||
exitcode=$((exitcode+$?));
|
||||
mv build/Multiprotocol.ino.bin ./binaries/mm-tlite5in1-aetr-air-v$MULTI_VERSION.bin;
|
||||
|
||||
printf "\e[33;1mBuilding mm-tlite5in1-taer-air-v$MULTI_VERSION.bin\e[0m\n";
|
||||
opt_replace AETR TAER;
|
||||
buildMulti;
|
||||
exitcode=$((exitcode+$?));
|
||||
mv build/Multiprotocol.ino.bin ./binaries/mm-tlite5in1-taer-air-v$MULTI_VERSION.bin;
|
||||
|
||||
printf "\e[33;1mBuilding mm-tlite5in1-reta-air-v$MULTI_VERSION.bin\e[0m\n";
|
||||
opt_replace TAER RETA;
|
||||
buildMulti;
|
||||
exitcode=$((exitcode+$?));
|
||||
mv build/Multiprotocol.ino.bin ./binaries/mm-tlite5in1-reta-air-v$MULTI_VERSION.bin;
|
||||
|
||||
# T-Lite 5-in-1 SURFACE builds
|
||||
printf "\e[33;1mBuilding mm-tlite5in1-aetr-sfc-v$MULTI_VERSION.bin\e[0m\n";
|
||||
opt_add MULTI_SURFACE;
|
||||
opt_remove MULTI_AIR;
|
||||
opt_replace RETA AETR;
|
||||
buildMulti;
|
||||
exitcode=$((exitcode+$?));
|
||||
mv build/Multiprotocol.ino.bin ./binaries/mm-tlite5in1-aetr-sfc-v$MULTI_VERSION.bin;
|
||||
|
||||
printf "\e[33;1mBuilding mm-tlite5in1-taer-sfc-v$MULTI_VERSION.bin\e[0m\n";
|
||||
opt_replace AETR TAER;
|
||||
buildMulti;
|
||||
exitcode=$((exitcode+$?));
|
||||
mv build/Multiprotocol.ino.bin ./binaries/mm-tlite5in1-taer-sfc-v$MULTI_VERSION.bin;
|
||||
|
||||
printf "\e[33;1mBuilding mm-tlite5in1-reta-sfc-v$MULTI_VERSION.bin\e[0m\n";
|
||||
opt_replace TAER RETA;
|
||||
buildMulti;
|
||||
exitcode=$((exitcode+$?));
|
||||
mv build/Multiprotocol.ino.bin ./binaries/mm-tlite5in1-reta-sfc-v$MULTI_VERSION.bin;
|
||||
|
||||
# T-Lite 5-in-1 SURFACE builds
|
||||
printf "\e[33;1mBuilding mm-tlite5in1-aetr-lbt-v$MULTI_VERSION.bin\e[0m\n";
|
||||
opt_remove MULTI_SURFACE;
|
||||
opt_add MULTI_EU;
|
||||
opt_replace RETA AETR;
|
||||
buildMulti;
|
||||
exitcode=$((exitcode+$?));
|
||||
mv build/Multiprotocol.ino.bin ./binaries/mm-tlite5in1-aetr-lbt-v$MULTI_VERSION.bin;
|
||||
|
||||
printf "\e[33;1mBuilding mm-tlite5in1-taer-lbt-v$MULTI_VERSION.bin\e[0m\n";
|
||||
opt_replace AETR TAER;
|
||||
buildMulti;
|
||||
exitcode=$((exitcode+$?));
|
||||
mv build/Multiprotocol.ino.bin ./binaries/mm-tlite5in1-taer-lbt-v$MULTI_VERSION.bin;
|
||||
|
||||
printf "\e[33;1mBuilding mm-tlite5in1-reta-lbt-v$MULTI_VERSION.bin\e[0m\n";
|
||||
opt_replace TAER RETA;
|
||||
buildMulti;
|
||||
exitcode=$((exitcode+$?));
|
||||
mv build/Multiprotocol.ino.bin ./binaries/mm-tlite5in1-reta-lbt-v$MULTI_VERSION.bin;
|
||||
|
||||
exit $exitcode;
|
||||
Reference in New Issue
Block a user