kopia lustrzana https://github.com/Hamlib/Hamlib
Make auto_power_on a bit more robust for RigPI which seems slow to get going
https://github.com/Hamlib/Hamlib/issues/1212pull/1242/head
rodzic
9d096c4ac9
commit
3daed948a8
|
@ -1140,7 +1140,8 @@ icom_rig_close(RIG *rig)
|
||||||
|
|
||||||
ENTERFUNC;
|
ENTERFUNC;
|
||||||
|
|
||||||
if (priv->poweron == 0) RETURNFUNC(RIG_OK); // nothing to do
|
if (priv->poweron == 0) { RETURNFUNC(RIG_OK); } // nothing to do
|
||||||
|
|
||||||
if (priv->poweron == 1 && rs->auto_power_off)
|
if (priv->poweron == 1 && rs->auto_power_off)
|
||||||
{
|
{
|
||||||
// maybe we need power off?
|
// maybe we need power off?
|
||||||
|
@ -8010,6 +8011,8 @@ int icom_set_powerstat(RIG *rig, powerstat_t status)
|
||||||
memset(fe_buf, 0xfe, fe_max);
|
memset(fe_buf, 0xfe, fe_max);
|
||||||
// sending more than enough 0xfe's to wake up the rs232
|
// sending more than enough 0xfe's to wake up the rs232
|
||||||
write_block(&rs->rigport, fe_buf, fe_max);
|
write_block(&rs->rigport, fe_buf, fe_max);
|
||||||
|
hl_usleep(200 *
|
||||||
|
1000); // need to wait a bit for RigPI and others to queue the echo
|
||||||
|
|
||||||
// we'll try 0x18 0x01 now -- should work on STBY rigs too
|
// we'll try 0x18 0x01 now -- should work on STBY rigs too
|
||||||
pwr_sc = S_PWR_ON;
|
pwr_sc = S_PWR_ON;
|
||||||
|
@ -8021,8 +8024,16 @@ int icom_set_powerstat(RIG *rig, powerstat_t status)
|
||||||
// poweron == 0 means never powered -- == 2 means CAT turned off
|
// poweron == 0 means never powered -- == 2 means CAT turned off
|
||||||
if (priv->poweron == 0 || priv->poweron == 2)
|
if (priv->poweron == 0 || priv->poweron == 2)
|
||||||
{
|
{
|
||||||
sleep(1); // give it a while to power up
|
retval = -1;
|
||||||
icom_get_usb_echo_off(rig);
|
|
||||||
|
for (i = 0; i < 5 && retval != RIG_OK; ++i)
|
||||||
|
{
|
||||||
|
sleep(1); // give it a while to power up
|
||||||
|
retval = icom_get_usb_echo_off(rig);
|
||||||
|
|
||||||
|
if (retval != RIG_OK) { sleep(1); }
|
||||||
|
}
|
||||||
|
|
||||||
return RIG_OK;
|
return RIG_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Ładowanie…
Reference in New Issue