Improve FT-857 get_vfo response when error occurs

This could be FT-857 EEPROM burnout
https://github.com/Hamlib/Hamlib/issues/1232
pull/1242/head
Mike Black W9MDB 2023-02-06 15:14:34 -06:00
rodzic c903c09cd1
commit cc7c335dc5
1 zmienionych plików z 8 dodań i 1 usunięć

Wyświetl plik

@ -607,13 +607,20 @@ static int ft857_send_icmd(RIG *rig, int index, unsigned char *data)
int ft857_get_vfo(RIG *rig, vfo_t *vfo)
{
unsigned char c;
static int ignore = 0;
*vfo = RIG_VFO_B;
rig_debug(RIG_DEBUG_VERBOSE, "%s: called \n", __func__);
// Some 857's cannnot read so we'll just return the cached value if we've seen an error
if (ignore)
{
*vfo = rig->state.cache.vfo;
return RIG_OK;
}
if (ft857_read_eeprom(rig, 0x0068, &c) < 0) /* get vfo status */
{
// Some 857's cannnot read so we'll just return the cached value
ignore = 1;
*vfo = rig->state.cache.vfo;
return RIG_OK;
}