kopia lustrzana https://github.com/Hamlib/Hamlib
ft817.c: Only get dig mode when needed.
This improves getting frequency and mode because we can skip reading EEPROM if not needed.pull/799/head
rodzic
ca43bf50da
commit
34492271bc
|
@ -772,8 +772,15 @@ static int ft817_get_status(RIG *rig, int status)
|
||||||
switch(status)
|
switch(status)
|
||||||
{
|
{
|
||||||
case FT817_NATIVE_CAT_GET_FREQ_MODE_STATUS:
|
case FT817_NATIVE_CAT_GET_FREQ_MODE_STATUS:
|
||||||
|
{
|
||||||
|
/* Only in digimode we need fetch to extra bits from EEPROM.
|
||||||
|
* This save communication cycle for all other modes.
|
||||||
|
* Because mode and frequency are shared this saves also when
|
||||||
|
* getting the frequency. */
|
||||||
|
switch (p->fm_status[4] & 0x7f)
|
||||||
{
|
{
|
||||||
unsigned char dig_mode;
|
unsigned char dig_mode;
|
||||||
|
case 0x0a:
|
||||||
if ((n = ft817_read_eeprom(rig, 0x0065, &dig_mode)) < 0)
|
if ((n = ft817_read_eeprom(rig, 0x0065, &dig_mode)) < 0)
|
||||||
{
|
{
|
||||||
return n;
|
return n;
|
||||||
|
@ -781,6 +788,10 @@ static int ft817_get_status(RIG *rig, int status)
|
||||||
|
|
||||||
/* Top 3 bit define the digi mode */
|
/* Top 3 bit define the digi mode */
|
||||||
p->dig_mode = dig_mode >> 5;
|
p->dig_mode = dig_mode >> 5;
|
||||||
|
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
Ładowanie…
Reference in New Issue