示例#1
0
        private void UpdatePreSel()
        {
            byte reg0 = 0, reg1 = 0;

            if (radBandA.Checked)
            {
                reg0 += (1 << 4); // Port 04
            }
            else if (radBandB.Checked)
            {
                reg0 += (1 << 1); // Port 01
            }
            else if (radBandC.Checked)
            {
                reg0 += (1 << 0); // Port 00
            }
            else if (radBandD.Checked)
            {
                reg0 += (1 << 2); // Port 02
            }
            else if (radBandE.Checked)
            {
                reg0 += (1 << 3); // Port 03
            }
            if (radAntRXOnly.Checked)
            {
                reg0 += (1 << 5); // Port 05
            }
            if (radAnt1.Checked)
            {
                reg0 += (1 << 6); // Port 06
            }
            if (mox && !chkBypassTR.Checked)
            {
                reg0 += (1 << 7); // Port 07
            }
            reg1 = ReverseBits((byte)tbTune.Value);
            //Debug.WriteLine("Presel slider: " + ((byte)tbTune.Value).ToString("X") + "  reg1: " + reg1.ToString("X"));

            switch (console.CurrentModel)
            {
            case Model.FLEX5000:
            case Model.FLEX3000:
                if (console.fwc_init)
                {
                    FWC.FlexWire_Write2Value(0x40, reg0, reg1);
                }
                break;

            case Model.FLEX1500:
                if (console.hid_init)
                {
                    USBHID.FlexWire_Write2Value(0x40, reg0, reg1);
                }
                break;
            }
        }