Hi Alberto,

I implemented the new function "int SetHWLO(long freq)" for the return 
value if the freq is out of range.
Stepping the freq up in Winrad calls the SetHWLO function with the 
correct freq, stepping 'one' down Winrad will call continues the 
function with a freq countdown of 100KHz until zero. Then it keeps 
calling the function with freq zero.
Is there some misunderstanding or did I make a program error?

73, PE0FKO
Fred

extern "C"
int __stdcall SetHWLO(long freq)
{
    TRACE("SetHWLO(%ld)\n", freq);

    if (freq < Value.ElektuurMinFreq)
        return -1;

    if (freq > Value.ElektuurMaxFreq)
        return 1;

    LOfreq = freq;

    // set here the LO frequency in the controlled hardware
    if (bActive)
    {
        __int64 osc = LOfreq;
        if (Value.ElektuurUseMF) osc += Value.ElektuurMF;
        if (osc < 0) osc -= 2 * Value.ElektuurMF;
        int cnt = (int)((osc << 32) / Value.ElektuurNCO);
        LoadDDSRegisters(cnt);
    }

    return 0;
}


Reply via email to