mirror of
https://github.com/pascallanger/DIY-Multiprotocol-TX-Module.git
synced 2026-10-03 19:12:01 +00:00
Compare commits
5
Commits
1e65452d68
...
ee984c403d
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ee984c403d | ||
|
|
ced6bbc5c8 | ||
|
|
f10fe7bbf0 | ||
|
|
9691730be6 | ||
|
|
5353281ed7 |
@@ -183,16 +183,22 @@ static void AFHDS2A_build_bind_packet()
|
||||
static void AFHDS2A_build_packet(uint8_t type)
|
||||
{
|
||||
uint16_t val;
|
||||
uint8_t num_ch = 14; //14 channels
|
||||
if(RX_num > 31)
|
||||
num_ch = 17; //16 channels
|
||||
memcpy( &packet[1], rx_tx_addr, 4);
|
||||
memcpy( &packet[5], rx_id, 4);
|
||||
switch(type)
|
||||
{
|
||||
case AFHDS2A_PACKET_STICKS:
|
||||
packet[0] = 0x58;
|
||||
//16 channels + RX_LQI on channel 17
|
||||
for(uint8_t ch=0; ch<17; ch++)
|
||||
for(uint8_t ch=0; ch<num_ch; ch++)
|
||||
{
|
||||
val = convert_channel_ppm(sub_protocol<AFHDS2A_GYRO_OFF?CH_AETR[ch]:ch); // No remapping for BS receivers
|
||||
if(ch != 16)
|
||||
val = convert_channel_ppm(sub_protocol<AFHDS2A_GYRO_OFF?CH_AETR[ch]:ch); // No remapping for BS receivers
|
||||
else
|
||||
val = 2000 - 10*RX_LQI; //CH17=RX_LQI
|
||||
|
||||
if(ch<14)
|
||||
{
|
||||
packet[9 + ch*2] = val;
|
||||
@@ -200,8 +206,6 @@ static void AFHDS2A_build_packet(uint8_t type)
|
||||
}
|
||||
else
|
||||
{
|
||||
if(ch == 16) //CH17=RX_LQI
|
||||
val = 2000 - 10*RX_LQI;
|
||||
packet[10 + (ch-14)*6] |= (val)<<4;
|
||||
packet[12 + (ch-14)*6] |= (val)&0xF0;
|
||||
packet[14 + (ch-14)*6] |= (val>>4)&0xF0;
|
||||
@@ -215,7 +219,9 @@ static void AFHDS2A_build_packet(uint8_t type)
|
||||
break;
|
||||
case AFHDS2A_PACKET_FAILSAFE:
|
||||
packet[0] = 0x56;
|
||||
for(uint8_t ch=0; ch<16; ch++)
|
||||
if(num_ch == 17)
|
||||
num_ch--;
|
||||
for(uint8_t ch=0; ch<num_ch; ch++)
|
||||
{ // Failsafe values
|
||||
#ifdef FAILSAFE_ENABLE
|
||||
val = Failsafe_data[protocol==PROTO_AFHDS2A?CH_AETR[ch]:ch]; // No remapping for BS receivers
|
||||
|
||||
@@ -102,7 +102,7 @@ static void __attribute__((unused)) DSM_build_bind_packet()
|
||||
if(sub_protocol==DSM_AUTO)
|
||||
packet[11] = 12;
|
||||
else
|
||||
packet[11] = num_ch; // DX5 DSMR sends 0x48...
|
||||
packet[11] = min(num_ch,12); // DX5 DSMR sends 0x48...
|
||||
//packet[11] = 3; // DX3R
|
||||
|
||||
if (sub_protocol==DSMR)
|
||||
@@ -142,10 +142,13 @@ static void __attribute__((unused)) DSM_initialize_bind_phase()
|
||||
static void __attribute__((unused)) DSM_update_channels()
|
||||
{
|
||||
prev_option=option;
|
||||
num_ch=option & 0x0F; // Remove flags 0x80=max_throw, 0x40=11ms
|
||||
num_ch=option & 0x0F; // Remove flags 0x80=max_throw, 0x40=11ms, 0x20=Cloned
|
||||
|
||||
if (num_ch==0) // Special case for 16ch, since channels are encoded in lower 4 bits, 0=16 channels
|
||||
num_ch=16;
|
||||
|
||||
if(num_ch<3)
|
||||
num_ch=6; // Default to 6 channels if invalid choice...
|
||||
num_ch=6; // Default to 6 channels if invalid choice...
|
||||
|
||||
#ifndef MULTI_AIR
|
||||
if(sub_protocol==DSMR && num_ch>7)
|
||||
@@ -329,7 +332,7 @@ uint16_t DSM_callback()
|
||||
#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
|
||||
#define DSM_READ_DELAY 300 // Time before write to check read phase, and switch channels.
|
||||
#define DSM_READ_DELAY 400 // Time before write to check read phase, and switch channels.
|
||||
#else
|
||||
#define DSM_WRITE_DELAY 1950 // Time after write to verify write complete
|
||||
#define DSM_READ_DELAY 600 // Time before write to check read phase, and switch channels.
|
||||
@@ -499,7 +502,7 @@ uint16_t DSM_callback()
|
||||
else
|
||||
return DSM2_SFC_PERIOD - DSM_CH1_CH2_DELAY - DSM_WRITE_DELAY - DSM_READ_DELAY;
|
||||
}
|
||||
return 10900 - DSM_WRITE_DELAY - DSM_READ_DELAY; //Was 11000 but the SR6200A needs 10900 to report telemetry correctly
|
||||
return 11000 - DSM_WRITE_DELAY - DSM_READ_DELAY; //Was 11000 but the SR6200A needs 10900 to report telemetry correctly
|
||||
}
|
||||
#endif
|
||||
return 11000 - DSM_CH1_CH2_DELAY - DSM_WRITE_DELAY - DSM_READ_DELAY;
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
#define VERSION_MAJOR 1
|
||||
#define VERSION_MINOR 3
|
||||
#define VERSION_REVISION 4
|
||||
#define VERSION_PATCH_LEVEL 72
|
||||
#define VERSION_PATCH_LEVEL 74
|
||||
|
||||
#define MODE_SERIAL 0
|
||||
|
||||
|
||||
+12
-6
@@ -237,26 +237,32 @@ Option is used to change the servo refresh rate. A value of 0 gives 50Hz (min),
|
||||
**RX_Num is used to give a number a given RX. You must use a different RX_Num per RX. A maximum of 64 AFHDS2A RXs are supported.**
|
||||
|
||||
### Sub_protocol PWM_IBUS - *0*
|
||||
RX output will match the Flysky standard AETR.
|
||||
|
||||
If the RX number is between 0 and 31, only 14 channels are sent. Between 32 and 63, all 17 channels are sent.
|
||||
|
||||
CH1|CH2|CH3|CH4|CH5|CH6|CH7|CH8|CH9|CH10|CH11|CH12|CH13|CH14|CH15|CH16|CH17
|
||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---
|
||||
A|E|T|R|CH5|CH6|CH7|CH8|CH9|CH10|CH11|CH12|CH13|CH14|CH15|CH16|LQI
|
||||
|
||||
RX output will match the Flysky standard AETR.
|
||||
|
||||
### Sub_protocol PPM_IBUS - *1*
|
||||
RX output will match the Flysky standard AETR.
|
||||
|
||||
If the RX number is between 0 and 31, only 14 channels are sent. Between 32 and 63, all 17 channels are sent.
|
||||
|
||||
CH1|CH2|CH3|CH4|CH5|CH6|CH7|CH8|CH9|CH10|CH11|CH12|CH13|CH14|CH15|CH16|CH17
|
||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---
|
||||
A|E|T|R|CH5|CH6|CH7|CH8|CH9|CH10|CH11|CH12|CH13|CH14|CH15|CH16|LQI
|
||||
|
||||
RX output will match the Flysky standard AETR.
|
||||
|
||||
### Sub_protocol PWM_SBUS - *2*
|
||||
RX output will match the Flysky standard AETR.
|
||||
|
||||
If the RX number is between 0 and 31, only 14 channels are sent. Between 32 and 63, all 17 channels are sent.
|
||||
|
||||
CH1|CH2|CH3|CH4|CH5|CH6|CH7|CH8|CH9|CH10|CH11|CH12|CH13|CH14|CH15|CH16|CH17
|
||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---
|
||||
A|E|T|R|CH5|CH6|CH7|CH8|CH9|CH10|CH11|CH12|CH13|CH14|CH15|CH16|LQI
|
||||
|
||||
RX output will match the Flysky standard AETR.
|
||||
|
||||
### Sub_protocol Gyro_Off - *3*
|
||||
RXs: FS-BS6, FS-BS4
|
||||
|
||||
|
||||
Reference in New Issue
Block a user