Fix set_powerstat wait loop

pull/97/head
Michael Black 2019-03-25 15:47:15 -05:00
rodzic 03b4c0912e
commit 40519ef2d8
1 zmienionych plików z 9 dodań i 4 usunięć

Wyświetl plik

@ -2798,16 +2798,21 @@ int kenwood_set_powerstat(RIG *rig, powerstat_t status)
int retval = kenwood_transaction(rig, (status == RIG_POWER_ON) ? "PS1" : "PS0", NULL, 0);
if (retval == RIG_OK && status==RIG_POWER_ON) { // wait for wakeup only
for(int i=0;i<15;++i) { // up to 15 seconds
int i=0;
if (status==RIG_POWER_ON) { // wait for wakeup only
for(i=0;i<15;++i) { // up to 15 seconds
sleep(1);
powerstat_t status;
retval = kenwood_get_powerstat(rig, &status);
if (retval == RIG_OK) return retval;
rig_debug(RIG_DEBUG_TRACE,"Wait %d of 15 for powerstatus\n",i+1);
rig_debug(RIG_DEBUG_TRACE,"%s: Wait %d of 15 for get_powerstat\n",__func__,i+1);
}
}
return retval;
if (i==15) {
rig_debug(RIG_DEBUG_TRACE,"%s: Wait for get_powerstat\n",__func__,i+1);
retval = -RIG_ETIMEOUT;
}
return retval;
}
/*