kopia lustrzana https://github.com/OpenRTX/OpenRTX
Fixed decoding of CT/DCSS codeplug field in MDx nvmem driver
rodzic
83d91b555d
commit
2fee6d0d06
|
@ -113,7 +113,8 @@ typedef struct
|
||||||
}
|
}
|
||||||
md3x0Channel_t;
|
md3x0Channel_t;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct
|
||||||
|
{
|
||||||
// Bytes 0-31
|
// Bytes 0-31
|
||||||
uint16_t name[16]; // Zone Name (Unicode)
|
uint16_t name[16]; // Zone Name (Unicode)
|
||||||
|
|
||||||
|
@ -121,7 +122,8 @@ typedef struct {
|
||||||
uint16_t member[16]; // Member: channels 1...16
|
uint16_t member[16]; // Member: channels 1...16
|
||||||
} md3x0Zone_t;
|
} md3x0Zone_t;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct
|
||||||
|
{
|
||||||
// Bytes 0-2
|
// Bytes 0-2
|
||||||
uint8_t id[3]; // Call ID: 1...16777215
|
uint8_t id[3]; // Call ID: 1...16777215
|
||||||
|
|
||||||
|
@ -302,32 +304,38 @@ int nvm_readChannelData(channel_t *channel, uint16_t pos)
|
||||||
/* Load mode-specific parameters */
|
/* Load mode-specific parameters */
|
||||||
if(channel->mode == FM)
|
if(channel->mode == FM)
|
||||||
{
|
{
|
||||||
channel->fm.rxToneEn = chData.ctcss_dcs_receive != 0;
|
channel->fm.txToneEn = 0;
|
||||||
channel->fm.txToneEn = chData.ctcss_dcs_transmit != 0;
|
channel->fm.rxToneEn = 0;
|
||||||
|
uint16_t rx_css = chData.ctcss_dcs_receive;
|
||||||
|
uint16_t tx_css = chData.ctcss_dcs_transmit;
|
||||||
|
|
||||||
// TODO: Implement binary search to speed up this lookup
|
// TODO: Implement binary search to speed up this lookup
|
||||||
if (channel->fm.rxToneEn)
|
if((rx_css != 0) && (rx_css != 0xFFFF))
|
||||||
{
|
{
|
||||||
for(int i = 0; i < MAX_TONE_INDEX; i++)
|
for(int i = 0; i < MAX_TONE_INDEX; i++)
|
||||||
{
|
{
|
||||||
if (ctcss_tone[i] == chData.ctcss_dcs_receive)
|
if(ctcss_tone[i] == ((uint16_t) _bcd2bin(rx_css)))
|
||||||
{
|
{
|
||||||
channel->fm.rxTone = i;
|
channel->fm.rxTone = i;
|
||||||
|
channel->fm.rxToneEn = 1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
if((tx_css != 0) && (tx_css != 0xFFFF))
|
||||||
if (channel->fm.txToneEn)
|
|
||||||
{
|
{
|
||||||
for(int i = 0; i < MAX_TONE_INDEX; i++)
|
for(int i = 0; i < MAX_TONE_INDEX; i++)
|
||||||
{
|
{
|
||||||
if (ctcss_tone[i] == chData.ctcss_dcs_transmit)
|
if(ctcss_tone[i] == ((uint16_t) _bcd2bin(tx_css)))
|
||||||
{
|
{
|
||||||
channel->fm.txTone = i;
|
channel->fm.txTone = i;
|
||||||
|
channel->fm.txToneEn = 1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: Implement warning screen if tone was not found
|
// TODO: Implement warning screen if tone was not found
|
||||||
}
|
}
|
||||||
else if(channel->mode == DMR)
|
else if(channel->mode == DMR)
|
||||||
|
@ -404,4 +412,3 @@ int nvm_readContactData(contact_t *contact, uint16_t pos)
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -116,7 +116,8 @@ typedef struct
|
||||||
uint16_t name[16];
|
uint16_t name[16];
|
||||||
} mduv3x0Channel_t;
|
} mduv3x0Channel_t;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct
|
||||||
|
{
|
||||||
// Bytes 0-31
|
// Bytes 0-31
|
||||||
uint16_t name[16]; // Zone Name (Unicode)
|
uint16_t name[16]; // Zone Name (Unicode)
|
||||||
|
|
||||||
|
@ -124,7 +125,8 @@ typedef struct {
|
||||||
uint16_t member_a[16]; // Member A: channels 1...16
|
uint16_t member_a[16]; // Member A: channels 1...16
|
||||||
} mduv3x0Zone_t;
|
} mduv3x0Zone_t;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct
|
||||||
|
{
|
||||||
// Bytes 0-95
|
// Bytes 0-95
|
||||||
uint16_t ext_a[48]; // Member A: channels 17...64
|
uint16_t ext_a[48]; // Member A: channels 17...64
|
||||||
|
|
||||||
|
@ -132,7 +134,8 @@ typedef struct {
|
||||||
uint16_t member_b[64]; // Member B: channels 1...64
|
uint16_t member_b[64]; // Member B: channels 1...64
|
||||||
} mduv3x0ZoneExt_t;
|
} mduv3x0ZoneExt_t;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct
|
||||||
|
{
|
||||||
// Bytes 0-2
|
// Bytes 0-2
|
||||||
uint8_t id[3]; // Call ID: 1...16777215
|
uint8_t id[3]; // Call ID: 1...16777215
|
||||||
|
|
||||||
|
@ -339,32 +342,38 @@ int nvm_readChannelData(channel_t *channel, uint16_t pos)
|
||||||
/* Load mode-specific parameters */
|
/* Load mode-specific parameters */
|
||||||
if(channel->mode == FM)
|
if(channel->mode == FM)
|
||||||
{
|
{
|
||||||
channel->fm.rxToneEn = chData.ctcss_dcs_receive != 0;
|
channel->fm.txToneEn = 0;
|
||||||
channel->fm.txToneEn = chData.ctcss_dcs_transmit != 0;
|
channel->fm.rxToneEn = 0;
|
||||||
|
uint16_t rx_css = chData.ctcss_dcs_receive;
|
||||||
|
uint16_t tx_css = chData.ctcss_dcs_transmit;
|
||||||
|
|
||||||
// TODO: Implement binary search to speed up this lookup
|
// TODO: Implement binary search to speed up this lookup
|
||||||
if (channel->fm.rxToneEn)
|
if((rx_css != 0) && (rx_css != 0xFFFF))
|
||||||
{
|
{
|
||||||
for(int i = 0; i < MAX_TONE_INDEX; i++)
|
for(int i = 0; i < MAX_TONE_INDEX; i++)
|
||||||
{
|
{
|
||||||
if (ctcss_tone[i] == chData.ctcss_dcs_receive)
|
if(ctcss_tone[i] == ((uint16_t) _bcd2bin(rx_css)))
|
||||||
{
|
{
|
||||||
channel->fm.rxTone = i;
|
channel->fm.rxTone = i;
|
||||||
|
channel->fm.rxToneEn = 1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
if((tx_css != 0) && (tx_css != 0xFFFF))
|
||||||
if (channel->fm.txToneEn)
|
|
||||||
{
|
{
|
||||||
for(int i = 0; i < MAX_TONE_INDEX; i++)
|
for(int i = 0; i < MAX_TONE_INDEX; i++)
|
||||||
{
|
{
|
||||||
if (ctcss_tone[i] == chData.ctcss_dcs_transmit)
|
if(ctcss_tone[i] == ((uint16_t) _bcd2bin(tx_css)))
|
||||||
{
|
{
|
||||||
channel->fm.txTone = i;
|
channel->fm.txTone = i;
|
||||||
|
channel->fm.txToneEn = 1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: Implement warning screen if tone was not found
|
// TODO: Implement warning screen if tone was not found
|
||||||
}
|
}
|
||||||
else if(channel->mode == DMR)
|
else if(channel->mode == DMR)
|
||||||
|
|
Ładowanie…
Reference in New Issue