kopia lustrzana https://github.com/Hamlib/Hamlib
icom.c: Drop width check. Other code assumes != NULL.
I am not sure if the intention was to check for width == default. But that never worked, so for now do not change behaviour.pull/771/head
rodzic
51d4473ef0
commit
83a8b98a86
|
@ -2220,64 +2220,61 @@ int icom_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width)
|
||||||
|
|
||||||
// if we already set width we won't update with except during set_vfo or set_mode
|
// if we already set width we won't update with except during set_vfo or set_mode
|
||||||
// reason is we can't get width without swapping vfos -- yuck!!
|
// reason is we can't get width without swapping vfos -- yuck!!
|
||||||
if (width != NULL)
|
if (vfo & (RIG_VFO_A | RIG_VFO_MAIN | RIG_VFO_SUB_A | RIG_VFO_MAIN_A |
|
||||||
|
RIG_VFO_CURR))
|
||||||
{
|
{
|
||||||
if (vfo & (RIG_VFO_A | RIG_VFO_MAIN | RIG_VFO_SUB_A | RIG_VFO_MAIN_A |
|
// then we get what was asked for
|
||||||
RIG_VFO_CURR))
|
if (vfo == RIG_VFO_NONE && rig->state.current_vfo == RIG_VFO_NONE)
|
||||||
{
|
{
|
||||||
// then we get what was asked for
|
rig_debug(RIG_DEBUG_TRACE, "%s(%d): forcing default VFO_A\n", __func__,
|
||||||
if (vfo == RIG_VFO_NONE && rig->state.current_vfo == RIG_VFO_NONE)
|
__LINE__);
|
||||||
{
|
TRACE;
|
||||||
rig_debug(RIG_DEBUG_TRACE, "%s(%d): forcing default VFO_A\n", __func__,
|
rig_set_vfo(rig, RIG_VFO_A); // force VFOA
|
||||||
__LINE__);
|
}
|
||||||
TRACE;
|
|
||||||
rig_set_vfo(rig, RIG_VFO_A); // force VFOA
|
|
||||||
}
|
|
||||||
|
|
||||||
|
retval = icom_get_dsp_flt(rig, *mode);
|
||||||
|
*width = retval;
|
||||||
|
|
||||||
|
if (retval == 0)
|
||||||
|
{
|
||||||
|
rig_debug(RIG_DEBUG_TRACE,
|
||||||
|
"%s: vfo=%s returning mode=%s, width not available\n", __func__,
|
||||||
|
rig_strvfo(vfo), rig_strrmode(*mode));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (rig->state.cache.widthMainB == 0)
|
||||||
|
{
|
||||||
|
// we need to swap vfos to get the bandwidth -- yuck
|
||||||
|
// so we read it once and will let set_mode and transceive capability (4.3 hamlib) update it
|
||||||
|
vfo_t vfosave = rig->state.current_vfo;
|
||||||
|
|
||||||
|
if (vfosave != vfo)
|
||||||
|
{
|
||||||
|
// right now forcing VFOA/B arrangement -- reverse not supported yet
|
||||||
|
// If VFOB width is ever different than VFOA
|
||||||
|
// we need to figure out how to read VFOB without swapping VFOs
|
||||||
|
//TRACE;
|
||||||
|
//rig_set_vfo(rig, RIG_VFO_B);
|
||||||
retval = icom_get_dsp_flt(rig, *mode);
|
retval = icom_get_dsp_flt(rig, *mode);
|
||||||
*width = retval;
|
*width = retval;
|
||||||
|
|
||||||
if (retval == 0)
|
if (*width == 0) { *width = rig->state.cache.widthMainA; } // we'll use VFOA's width
|
||||||
{
|
|
||||||
rig_debug(RIG_DEBUG_TRACE,
|
// dont' really care about cache time here
|
||||||
"%s: vfo=%s returning mode=%s, width not available\n", __func__,
|
// this is just to prevent vfo swapping while getting width
|
||||||
rig_strvfo(vfo), rig_strrmode(*mode));
|
rig->state.cache.widthMainB = retval;
|
||||||
}
|
rig_debug(RIG_DEBUG_TRACE, "%s(%d): vfosave=%s, currvfo=%s\n", __func__,
|
||||||
|
__LINE__, rig_strvfo(vfo), rig_strvfo(rig->state.current_vfo));
|
||||||
|
//TRACE;
|
||||||
|
//rig_set_vfo(rig, RIG_VFO_A);
|
||||||
|
rig_debug(RIG_DEBUG_TRACE, "%s: vfo=%s returning mode=%s, width=%d\n", __func__,
|
||||||
|
rig_strvfo(vfo), rig_strrmode(*mode), (int)*width);
|
||||||
}
|
}
|
||||||
else if (rig->state.cache.widthMainB == 0)
|
else
|
||||||
{
|
{
|
||||||
// we need to swap vfos to get the bandwidth -- yuck
|
rig_debug(RIG_DEBUG_WARN,
|
||||||
// so we read it once and will let set_mode and transceive capability (4.3 hamlib) update it
|
"%s: vfo arrangement not supported yet, vfo=%s, currvfo=%s\n", __func__,
|
||||||
vfo_t vfosave = rig->state.current_vfo;
|
rig_strvfo(vfo), rig_strvfo(vfosave));
|
||||||
|
|
||||||
if (vfosave != vfo)
|
|
||||||
{
|
|
||||||
// right now forcing VFOA/B arrangement -- reverse not supported yet
|
|
||||||
// If VFOB width is ever different than VFOA
|
|
||||||
// we need to figure out how to read VFOB without swapping VFOs
|
|
||||||
//TRACE;
|
|
||||||
//rig_set_vfo(rig, RIG_VFO_B);
|
|
||||||
retval = icom_get_dsp_flt(rig, *mode);
|
|
||||||
*width = retval;
|
|
||||||
|
|
||||||
if (*width == 0) { *width = rig->state.cache.widthMainA; } // we'll use VFOA's width
|
|
||||||
|
|
||||||
// dont' really care about cache time here
|
|
||||||
// this is just to prevent vfo swapping while getting width
|
|
||||||
rig->state.cache.widthMainB = retval;
|
|
||||||
rig_debug(RIG_DEBUG_TRACE, "%s(%d): vfosave=%s, currvfo=%s\n", __func__,
|
|
||||||
__LINE__, rig_strvfo(vfo), rig_strvfo(rig->state.current_vfo));
|
|
||||||
//TRACE;
|
|
||||||
//rig_set_vfo(rig, RIG_VFO_A);
|
|
||||||
rig_debug(RIG_DEBUG_TRACE, "%s: vfo=%s returning mode=%s, width=%d\n", __func__,
|
|
||||||
rig_strvfo(vfo), rig_strrmode(*mode), (int)*width);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
rig_debug(RIG_DEBUG_WARN,
|
|
||||||
"%s: vfo arrangement not supported yet, vfo=%s, currvfo=%s\n", __func__,
|
|
||||||
rig_strvfo(vfo), rig_strvfo(vfosave));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Ładowanie…
Reference in New Issue