mirror of
https://github.com/pascallanger/DIY-Multiprotocol-TX-Module.git
synced 2025-07-01 10:10:39 +00:00
DSM2/X pncodes fix and FrSky RSSI&TSSI swap fix
This commit is contained in:
parent
9b74e19a99
commit
fc61753953
@ -84,7 +84,7 @@ const uint8_t PROGMEM pncodes[5][9][8] = {
|
|||||||
/* Col 5 */ {0x9B, 0x75, 0xF7, 0xE0, 0x14, 0x8D, 0xB5, 0x80},
|
/* Col 5 */ {0x9B, 0x75, 0xF7, 0xE0, 0x14, 0x8D, 0xB5, 0x80},
|
||||||
/* Col 6 */ {0xBF, 0x54, 0x98, 0xB9, 0xB7, 0x30, 0x5A, 0x88},
|
/* Col 6 */ {0xBF, 0x54, 0x98, 0xB9, 0xB7, 0x30, 0x5A, 0x88},
|
||||||
/* Col 7 */ {0x35, 0xD1, 0xFC, 0x97, 0x23, 0xD4, 0xC9, 0x88},
|
/* Col 7 */ {0x35, 0xD1, 0xFC, 0x97, 0x23, 0xD4, 0xC9, 0x88},
|
||||||
/* Col 8 */ {0x88, 0xE1, 0xD6, 0x31, 0x26, 0x5F, 0xBD, 0x40}
|
/* Col 8 */ {0xE1, 0xD6, 0x31, 0x26, 0x5F, 0xBD, 0x40, 0x93}
|
||||||
},
|
},
|
||||||
{ /* Row 4 */
|
{ /* Row 4 */
|
||||||
/* Col 0 */ {0xE1, 0xD6, 0x31, 0x26, 0x5F, 0xBD, 0x40, 0x93},
|
/* Col 0 */ {0xE1, 0xD6, 0x31, 0x26, 0x5F, 0xBD, 0x40, 0x93},
|
||||||
|
@ -402,7 +402,7 @@ enum CC2500_POWER
|
|||||||
CC2500_POWER_17 = 0xFF // +1dbm
|
CC2500_POWER_17 = 0xFF // +1dbm
|
||||||
};
|
};
|
||||||
#define CC2500_HIGH_POWER CC2500_POWER_16
|
#define CC2500_HIGH_POWER CC2500_POWER_16
|
||||||
#define CC2500_LOW_POWER CC2500_POWER_13
|
#define CC2500_LOW_POWER CC2500_POWER_13
|
||||||
#define CC2500_RANGE_POWER CC2500_POWER_1
|
#define CC2500_RANGE_POWER CC2500_POWER_1
|
||||||
#define CC2500_BIND_POWER CC2500_POWER_1
|
#define CC2500_BIND_POWER CC2500_POWER_1
|
||||||
|
|
||||||
|
@ -99,6 +99,15 @@ uint8_t prev_protocol=0;
|
|||||||
#define MAX_PKT 27
|
#define MAX_PKT 27
|
||||||
uint8_t pkt[MAX_PKT];//telemetry receiving packets
|
uint8_t pkt[MAX_PKT];//telemetry receiving packets
|
||||||
#if defined(TELEMETRY)
|
#if defined(TELEMETRY)
|
||||||
|
#if defined DSM2_CYRF6936_INO
|
||||||
|
#define DSM_TELEMETRY
|
||||||
|
#endif
|
||||||
|
#if defined FRSKYX_CC2500_INO
|
||||||
|
#define SPORT_TELEMETRY
|
||||||
|
#endif
|
||||||
|
#if defined FRSKY_CC2500_INO
|
||||||
|
#define HUB_TELEMETRY
|
||||||
|
#endif
|
||||||
uint8_t pktt[MAX_PKT];//telemetry receiving packets
|
uint8_t pktt[MAX_PKT];//telemetry receiving packets
|
||||||
volatile uint8_t tx_head=0;
|
volatile uint8_t tx_head=0;
|
||||||
volatile uint8_t tx_tail=0;
|
volatile uint8_t tx_tail=0;
|
||||||
|
@ -5,15 +5,6 @@
|
|||||||
|
|
||||||
#if defined TELEMETRY
|
#if defined TELEMETRY
|
||||||
|
|
||||||
#if defined DSM2_CYRF6936_INO
|
|
||||||
#define DSM_TELEMETRY
|
|
||||||
#endif
|
|
||||||
#if defined FRSKYX_CC2500_INO
|
|
||||||
#define SPORT_TELEMETRY
|
|
||||||
#endif
|
|
||||||
#if defined FRSKY_CC2500_INO
|
|
||||||
#define HUB_TELEMETRY
|
|
||||||
#endif
|
|
||||||
#if defined SPORT_TELEMETRY
|
#if defined SPORT_TELEMETRY
|
||||||
#define SPORT_TIME 12000
|
#define SPORT_TIME 12000
|
||||||
#define FRSKY_SPORT_PACKET_SIZE 8
|
#define FRSKY_SPORT_PACKET_SIZE 8
|
||||||
@ -64,11 +55,11 @@ void frskySendStuffed()
|
|||||||
void compute_RSSIdbm()
|
void compute_RSSIdbm()
|
||||||
{
|
{
|
||||||
|
|
||||||
RSSI_dBm = (((uint16_t)(pktt[len-2])*18)>>5);
|
RSSI_dBm = (((uint16_t)(pktt[len-2])*18)>>4);
|
||||||
if(pktt[len-2] >=128)
|
if(pktt[len-2] >=128)
|
||||||
RSSI_dBm -= 82;
|
RSSI_dBm -= 164;
|
||||||
else
|
else
|
||||||
RSSI_dBm += 65;
|
RSSI_dBm += 130;
|
||||||
}
|
}
|
||||||
|
|
||||||
void frsky_check_telemetry(uint8_t *pkt,uint8_t len)
|
void frsky_check_telemetry(uint8_t *pkt,uint8_t len)
|
||||||
@ -110,8 +101,8 @@ void frsky_link_frame()
|
|||||||
compute_RSSIdbm();
|
compute_RSSIdbm();
|
||||||
frame[1] = pktt[3];
|
frame[1] = pktt[3];
|
||||||
frame[2] = pktt[4];
|
frame[2] = pktt[4];
|
||||||
frame[3] = (uint8_t)RSSI_dBm;
|
frame[3] = pktt[5];
|
||||||
frame[4] = pktt[5]*2;
|
frame[4] = (uint8_t)RSSI_dBm;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
if ((cur_protocol[0]&0x1F)==MODE_HUBSAN)
|
if ((cur_protocol[0]&0x1F)==MODE_HUBSAN)
|
||||||
|
@ -21,9 +21,6 @@
|
|||||||
//#define TX_SPEKTRUM //Spektrum TAER (1100<->1900µs)
|
//#define TX_SPEKTRUM //Spektrum TAER (1100<->1900µs)
|
||||||
//#define TX_HISKY //HISKY AETR (1100<->1900µs)
|
//#define TX_HISKY //HISKY AETR (1100<->1900µs)
|
||||||
|
|
||||||
//Uncomment to enable telemetry
|
|
||||||
#define TELEMETRY
|
|
||||||
|
|
||||||
//Comment if a module is not installed
|
//Comment if a module is not installed
|
||||||
#define A7105_INSTALLED
|
#define A7105_INSTALLED
|
||||||
#define CYRF6936_INSTALLED
|
#define CYRF6936_INSTALLED
|
||||||
@ -61,6 +58,22 @@
|
|||||||
#define FY326_NRF24L01_INO
|
#define FY326_NRF24L01_INO
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
//Uncomment to enable telemetry
|
||||||
|
#define TELEMETRY
|
||||||
|
|
||||||
|
//Comment to disable a specific telemetry
|
||||||
|
#if defined(TELEMETRY)
|
||||||
|
#if defined DSM2_CYRF6936_INO
|
||||||
|
#define DSM_TELEMETRY
|
||||||
|
#endif
|
||||||
|
#if defined FRSKYX_CC2500_INO
|
||||||
|
#define SPORT_TELEMETRY
|
||||||
|
#endif
|
||||||
|
#if defined FRSKY_CC2500_INO
|
||||||
|
#define HUB_TELEMETRY
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
//Update this table to set which protocol and all associated settings are called for the corresponding dial number
|
//Update this table to set which protocol and all associated settings are called for the corresponding dial number
|
||||||
const PPM_Parameters PPM_prot[15]= {
|
const PPM_Parameters PPM_prot[15]= {
|
||||||
// Dial Protocol Sub protocol RX_Num Power Auto Bind Option
|
// Dial Protocol Sub protocol RX_Num Power Auto Bind Option
|
||||||
|
Loading…
x
Reference in New Issue
Block a user