diff --git a/kenwood/kenwood.c b/kenwood/kenwood.c index 9ffc57f96..e45459d60 100644 --- a/kenwood/kenwood.c +++ b/kenwood/kenwood.c @@ -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; } /*