EPIC USB EPL Code: ver.50
Written for EEPROM v.5
Checksum: 0xCFDF



#include
"modules.hpl"
#include "macros.hpl"
#include "epichid.inc"
#include "devices.hpl"


//DEFINE AUTOPILOT DISCRETES

#define "clrp" "clearpoint";
#define "setp" "setpoint";
#define CMD_R 0,0,0b00000001
#define CMD_L 0,1,0b00000010
#define THR 0,1,0b00000100
#define SPD 0,1,0b00001000
#define LNAV 0,1,0b01000000
#define VNAV 0,1,0b10000000
#define FLCH 0,1,0b00000001
#define HDG 0,0,0b00100000
#define VS 0,0,0b00010000
#define ALT 0,0,0b00001000
#define LOC 0,0,0b00000010
#define APP 0,0,0b00000100
#define
COM1_lt 0,3,0b00000010
#define NAV1_lt 0,3,0b00000001

//DEFINE LANDING GEAR LIGHTS

#define LW_Down 0,7,0b10000000
#define LW_Up 0,7,0b01000000
#define RW_Down 0,7,0b00100000
#define RW_Up 0,7,0b00010000
#define NW_Down 0,7,0b00001000
#define NW_Up 0,7,0b00000100


//------------------COMMENTS-----------------------
// Joy/Pov: Function:
//
// P0 Transponder Code
// P1 MCP IAS
// P2 MCP Heading
// P3 COM1 Active Freq, after SWAP is pressed
// P4 MCP Altitude
// P5 NAV1 Active Frequency
// P6 COM1 Standby Frequency
// P7 NAV2 Active Frequency
// Y4 COM1 Standby Frequency (Doesn't Work)
// X4: VOR1 OBI in EPICINFO

//Define all Variables and Flags

byte XPDR_pos = 5; //xpdr tune digit, if = 0; not tuning
byte NAV1_pos = 3; //NAV1 tune digit, if = 0; not tuning
byte NAV2_pos = 3; //NAV2 tune digit, if = 0; not tuning
byte COM1_pos = 3; //COM1 tune digit, if = 0; not tuning

//For Digit Flash Timer

byte testByte;
byte tick;

word w_COM1;
word w_NAV1;
word w_NAV2;
word w_XPDR;
word w_TEMP;

bcd TempBCD;

//Define Autopilot RVARS

rvar(rvar_MCP_HDG, 0, 359, 000, false);
rvar(rvar_MCP_IAS, 0, 500, 000, true );
rvar(rvar_MCP_ALT, 5, 500, 005, true );
rvar(rvar_MCP_VS, 0, 50, 25, true );

rvar(rv_COM1a_HI, 18, 35, 18, false);
rvar(rv_COM1a_LO, 0, 99, 0, false);
rvar(rv_COM1s_HI, 18, 35, 18, false);
rvar(rv_COM1s_LO, 0, 99, 00, false);

rvar(rv_NAV1a_HI, 8, 17, 08, false);
rvar(rv_NAV1a_LO, 0, 99, 00, false);
rvar(rv_NAV1s_HI, 8, 17, 08, false);
rvar(rv_NAV1s_LO, 0, 99, 00, false);

rvar(rv_NAV2a_HI, 8, 17, 08, false);
rvar(rv_NAV2a_LO, 0, 99, 00, false);
rvar(rv_NAV2s_HI, 8, 17, 08, false);
rvar(rv_NAV2s_LO, 0, 99, 00, false);

rvar(rvar_NAV1_CRS, 0, 359, 000, false);
rvar(rvar_NAV2_CRS, 0, 359, 000, false);

rvar(rv_XPD1, 0, 7, 0, false);
rvar(rv_XPD2, 0, 7, 0, false);
rvar(rv_XPD3, 0, 7, 2, false);
rvar(rv_XPD4, 0, 7, 1, false);

var Radio_Type = 1; //-- 1 = COM1
//-- 2 = COM2
//-- 3 = NAV1
//-- 4 = NAV2


:INIT{ //This INIT{} MUST BE IN CAPS!

//Set for 6Mhz Processor (3 FOR 18Mhz Board)

pushc(1); exec(140);

//Test & Clear all Lights
clearpoint(0, 0, 0b11111111);
clearpoint(0, 1, 0b11111111);
clearpoint(0, 2, 0b11111111);
clearpoint(0, 3, 0b11111111);

setpoint(0, 0, 0b11111111);
setpoint(0, 1, 0b11111111);
setpoint(0, 2, 0b11111111);
setpoint(0, 3, 0b11111111);

delay( 50);

clearpoint(0, 0, 0b11111111);
clearpoint(0, 1, 0b11111111);
clearpoint(0, 2, 0b11111111);
clearpoint(0, 3, 0b11111111);

//Set Wheel Lights
setp(0, 7, 0b10101000);

//Configure Rotary Module
senddata(7,0,0b10101010); // 0=NAV1_freq 1=NAV1_OBI
senddata(7,1,0b01010101);
senddata(7,2,0b01010101);
senddata(7,3,0b01010101);

//Initiate Displays
Display.IAS = 0;
Display.ALTzero = 0;

Display.Test1 = 123.45;
Display.Test2 = 678;
Display.Test3 = 123.45;
Display.Test4 = 678;

Display.VSzero = blank;
Display.VS_SIGN = 8;
Display.HDG_ = dash;

Display.NAV1_HI = dash;
Display.NAV1_LO = dash;
Display.NAV1_CRS = dash;

Display.NAV2_HI = dash;
Display.NAV2_LO = dash;
Display.NAV2_CRS = dash;

//Set up for Transponder
setqlogon(0x11); //allow user control of TP2 for debugging
exec(139); //TP2off
jump(MainLoop);
}

:MainLoop{

tick++;
if(tick > 7) {tick = 0;}
if(tick > 2) DIGITS_on; //1/2 second flasher
if(tick == 0) DIGITS_off; //1/2 second flasher
delay(1);
jump(MainLoop);
}


:DIGITS_on{

if(XPDR_pos == 1) {Display.xpdrD1 = rv_XPD1;}
if(XPDR_pos == 2) {Display.xpdrD2 = rv_XPD2;}
if(XPDR_pos == 3) {Display.xpdrD3 = rv_XPD3;}
if(XPDR_pos == 4) {Display.xpdrD4 = rv_XPD4;}

Display.NAV1_LO = rv_NAV1a_LO;
Display.NAV1_HI = rv_NAV1a_HI + 100 ;

Display.NAV2_LO = rv_NAV2a_LO;
Display.NAV2_HI = rv_NAV2a_HI + 100 ;

if(Radio_Type == 1) //-- COM1
{
if(COM1_pos == 1) {Display.COM1_STB_LO = rv_COM1s_LO;}
if(COM1_pos == 2) {Display.COM1_STB_HI = rv_COM1s_HI;}
}
if(Radio_Type == 3) //-- NAV1
{
if(COM1_pos == 1) {Display.COM1_STB_LO = rv_NAV1s_LO;}
if(COM1_pos == 2) {Display.COM1_STB_HI = rv_NAV1s_HI;}
}
if(Radio_Type == 4) //--NAV2
{
if(COM1_pos == 1) {Display.COM1_STB_LO = rv_NAV2s_LO;}
if(COM1_pos == 2) {Display.COM1_STB_HI = rv_NAV2s_HI;}
}
}

:DIGITS_off{

if(XPDR_pos == 1) {Display.xpdrD1 = blank;}
if(XPDR_pos == 2) {Display.xpdrD2 = blank;}
if(XPDR_pos == 3) {Display.xpdrD3 = blank;}
if(XPDR_pos == 4) {Display.xpdrD4 = blank;}

if(NAV1_pos == 1) {Display.NAV1_LO = blank;}
if(NAV1_pos == 2) {Display.NAV1_HI = blank;}

if(NAV2_pos == 1) {Display.NAV2_LO = blank;}
if(NAV2_pos == 2) {Display.NAV2_HI = blank;}

if(COM1_pos == 1) {Display.COM1_STB_LO = blank;}
if(COM1_pos == 2) {Display.COM1_STB_HI = blank;}

}

:Select_COM1{

Radio_Type = 1;
Buttons.COM_RADIO=pulse;
jump(Set_COM1_DISP);
}

:Select_NAV1{

Radio_Type = 3;
Buttons.NAV_RADIO=pulse;
jump(Set_NAV1_DISP);
}

:Select_NAV2{

Radio_Type = 4;
clrp(NAV1_lt);
clrp(COM1_lt);
keyhit(N);
delay(2);
keyhit(2);
jump(Set_NAV2_DISP);
}

:Freq_Swap
{

if(Radio_Type == 1)
{

//Set the Active frequency
nqw(SetBcdPov3, w_COM1);
rv_COM1s_HI = rv_COM1a_HI;
rv_COM1s_LO = rv_COM1a_LO;
}

if(Radio_Type == 3)
{

//Set the Active frequency
nqw(SetBcdPov5, w_NAV1);
rv_NAV1s_HI = rv_NAV1a_HI;
rv_NAV1s_LO = rv_NAV1a_LO;
}

if(Radio_Type == 4)
{

//Set the Active frequency
nqw(SetBcdPov7, w_NAV2);
rv_NAV2s_HI = rv_NAV2a_HI;
rv_NAV2s_LO = rv_NAV2a_LO;
}

Buttons.FREQUENCY_SWAP=pulse;

COM1_pos = 3;

}

//----------------------------------------------------------------
// RADIO STACK PIGEONHOLES
//----------------------------------------------------------------

ph PH1(1){ //-------- Get COM1 Active Freq

byte B0;
byte B1;

rv_COM1a_LO = PH1.B0;
rv_COM1a_HI = PH1.B1;

jump(Set_COM1_DISP);

};

ph PH2(2){ //-------- Get NAV1 Active Freq

byte B0;
byte B1;

rv_NAV1a_LO = PH2.B0;
rv_NAV1a_HI = PH2.B1;

jump(Set_NAV1_DISP);

};

ph PH3(3){ //-------- Get NAV1 Active Freq

byte B0;
byte B1;

rv_NAV2a_LO = PH3.B0;
rv_NAV2a_HI = PH3.B1;

jump(Set_NAV2_DISP);

};


//----------------------------------------------------------------
// SET RADIO STACK DISPLAYS
//----------------------------------------------------------------


:Set_COM1_DISP

{
Display.COM1_ACT_LO = rv_COM1a_LO;
Display.COM1_ACT_HI = rv_COM1a_HI;

Display.COM1_STB_LO = rv_COM1s_LO;
Display.COM1_STB_HI = rv_COM1s_HI;
}

:Set_NAV1_DISP

{
Display.COM1_ACT_LO = rv_NAV1a_LO;
Display.COM1_ACT_HI = rv_NAV1a_HI;
Display.COM1_STB_LO = rv_NAV1s_LO;
Display.COM1_STB_HI = rv_NAV1s_HI;
}

:Set_NAV2_DISP

{
Display.COM1_ACT_LO = rv_NAV2a_LO;
Display.COM1_ACT_HI = rv_NAV2a_HI;
Display.COM1_STB_LO = rv_NAV2s_LO;
Display.COM1_STB_HI = rv_NAV2s_HI;
}

//DIGIT SELECT (Integrated Rotary Pushbuttons)

:Tune_COM1

{
call(DIGITS_on);
COM1_pos-=1;
if(COM1_pos == 0 ) {COM1_pos = 3;} //stop digit flashing
}

:Tune_NAV1

{
call(DIGITS_on);
NAV1_pos-=1;
if(NAV1_pos == 0 ) {NAV1_pos = 3;} //stop digit flashing
}

:Tune_NAV2

{
call(DIGITS_on);
NAV2_pos-=1;
if(NAV2_pos == 0 ) {NAV2_pos = 3;} //stop digit flashing
if(NAV2_pos != 1) {Buttons.FREQUENCY_SWAP=pulse;} //-- Perform SWAP since NAV Radio
} //-- only has 1 set of Digits

:Tune_XPDR

{
call(DIGITS_on);
XPDR_pos-=1;
if(XPDR_pos == 0 ) {XPDR_pos = 5;} //stop digit flashing
}

:XPDR_Tune

{
if(XPDR_pos == 1){
if(Rotaries.XPDRdir) {rv_XPD1 += 1;}
else {rv_XPD1 -= 1;}}

if(XPDR_pos == 2){
if(Rotaries.XPDRdir) {rv_XPD2 += 1;}
else {rv_XPD2 -= 1;}}

if(XPDR_pos == 3){
if(Rotaries.XPDRdir) {rv_XPD3 += 1;}
else {rv_XPD3 -= 1;}}

if(XPDR_pos == 4){
if(Rotaries.XPDRdir) {rv_XPD4 += 1;}
else {rv_XPD4 -= 1;}}

w_XPDR = rv_XPD4 * 1000;
w_TEMP = rv_XPD3 * 100;
w_XPDR = w_XPDR + w_TEMP;
w_TEMP = rv_XPD2 * 10;
w_XPDR = w_XPDR + w_TEMP;
w_XPDR = w_XPDR + rv_XPD1;

nqw(SetBcdPov0, w_XPDR);

}

//----------------------------------------------------------------
// TUNE RADIO STACK
//----------------------------------------------------------------

:Tune_Radio

{
if(Radio_Type == 1) // COM1 FREQ Set
{

// TUNE UPPER DIGITS IF FLAG SET
if(COM1_pos == 2)

{
if(!Rotaries.Radio_dir)
{rv_COM1s_HI -= 1;}
else {rv_COM1s_HI += 1;}
}

if(COM1_pos == 1)

{
if(!Rotaries.Radio_dir)
{rv_COM1s_LO -= 5;}
else {rv_COM1s_LO += 5;}
}

w_COM1 = rv_COM1s_HI * 100;
w_COM1 = w_COM1 + rv_COM1s_LO;

nqw(SetBcdPov6, w_COM1);
}

if(Radio_Type == 3)
{

if(COM1_pos == 2)

{
if(!Rotaries.Radio_dir)
{rv_NAV1s_HI -= 1;}
else {rv_NAV1s_HI += 1;}
}


if(COM1_pos == 1)

{
if(!Rotaries.Radio_dir)
{rv_NAV1s_LO -= 5;}
else {rv_NAV1s_LO += 5;}
}

w_NAV1 = rv_NAV1s_HI * 100;
w_NAV1 = w_NAV1 + rv_NAV1s_LO;
}

if(Radio_Type == 4)

{
if(COM1_pos == 2)

{
if(!Rotaries.Radio_dir)
{rv_NAV2s_HI -= 1;}
else {rv_NAV2s_HI += 1;}
}

if(COM1_pos == 1)

{
if(!Rotaries.Radio_dir)
{rv_NAV2s_LO -= 5;}
else {rv_NAV2s_LO += 5;}
}

w_NAV2 = rv_NAV2s_HI * 100;
w_NAV2 = w_NAV2 + rv_NAV2s_LO;
}
}

//----------------------------------------------------------------------
// VOR OBI DIALS
//----------------------------------------------------------------------

:NAV1_CRS_Set

{
if(Rotaries.NAV1CRSdir) { rvar_NAV1_CRS+=1;}
else { rvar_NAV1_CRS-=1;}

nqw(SetX4, rvar_NAV1_CRS); // -- Set SOFT Axis X4 (used by EPICINFO)

Display.NAV1_CRS = rvar_NAV1_CRS;
}

//----------------------------------------------------------------------
// AUTOPILOT PANEL LIGHTS
//----------------------------------------------------------------------

defqp(18, AP_CMD_OFF)
defqp(19, AP_CMD_ON)
defqp(20, AP_ALT_OFF)
defqp(21, AP_ALT_ON)
defqp(22, AP_HDG_OFF)
defqp(23, AP_HDG_ON)
defqp(24, AP_LOC_OFF)
defqp(25, AP_LOC_ON)
//defqp(40, AP_APP_OFF)
defqp(41, AP_APP_ON)
defqp(46, AP_IAS_OFF)
defqp(47, AP_IAS_ON)
defqp(50, AP_VS_OFF)
defqp(51, AP_VS_ON)
defqp(138, AP_THR_OFF)
defqp(139, AP_THR_ON)

:AP_CMD_ON{ setp(CMD_R); setp(CMD_L);}
:AP_CMD_OFF{clrp(CMD_R); clrp(CMD_L);}

:AP_ALT_ON{setp(ALT);}
:AP_ALT_OFF{clrp(ALT);}


:AP_HDG_OFF
{clrp(HDG);}
:AP_HDG_ON{setp(HDG);}

:AP_LOC_OFF{clrp(LOC);}
:AP_LOC_ON{setp(LOC);}


:AP_APP_OFF{clrp(APP);}
:AP_APP_ON{setp(APP);}

:AP_IAS_OFF{clrp(SPD);}
:AP_IAS_ON{setp(SPD);}

:AP_VS_OFF{clrp(VS);}
:AP_VS_ON{setp(VS);}

:AP_THR_OFF{clrp(THR);}
:AP_THR_ON{setp(THR);}

//----------------------------------------------------------------------
// AUTOPILOT BUTTONS
//----------------------------------------------------------------------

:Pulse_alt_hold_on{Buttons.alt_hold_on = pulse; }
:Pulse_vs_on {Buttons.vs_on = pulse;}
:Pulse_app_on {Buttons.app_on = pulse; }
:Pulse_cmd_r_on {Buttons.cmd_r_on = pulse; }
:Pulse_loc_on {Buttons.loc_on = pulse; }
:Pulse_at_arm {Buttons.at_arm = pulse; }
:Pulse_lnav_on {Buttons.lnav_on = pulse; }
:Pulse_vnav_on {Buttons.vnav_on = pulse; }
:Pulse_flch_on {Buttons.flch_on = pulse; }
:Pulse_MCP_APL {Buttons.MCP_APL = pulse; }
:Pulse_MCP_SPD {Buttons.MCP_SPD = pulse; }
:Pulse_thr_on {Buttons.thr_on = pulse; }
:Pulse_hdg_hold_on{Buttons.hdg_hold_on = pulse;}


//----------------------------------------------------------------------
// AUTOPILOT PIGEONHOLES
//----------------------------------------------------------------------


ph PH19(19){ //-------- Get MCP VS

byte B0;
byte B1;
byte B2; //passing 0= Positive 1= negative
byte B3;

Display.VS_ = PH19.B1;

if(PH19.B3 > 28 ) {Display.VS_SIGN = dash;}
else {Display.VS_SIGN = blank;}

if(PH19.B1 == 0)
{Display.VS_ = blank;
Display.VSzero = blank;
Display.VS_SIGN = blank;}

else {Display.VSzero = 00;}

};


//----------------------------------------------------------------------
// AUTOPILOT ROTARIES
//----------------------------------------------------------------------

:AP_IAS_Set

{ if(Rotaries.IASdir){rvar_MCP_IAS+=5;}
else {rvar_MCP_IAS-=5;}

nqw(SetFinePov1, rvar_MCP_IAS);

// Virtual_Axis.MCP_IAS = rvar_MCP_IAS + 1; //Yeah.. off by one
Display.IAS = rvar_MCP_IAS;
}

:AP_HDG_Set

{ if(!Rotaries.HDGdir){rvar_MCP_HDG+=1;}
else {rvar_MCP_HDG-=1;}

nqw(SetFinePov2, rvar_MCP_HDG);

// Virtual_Axis.MCP_HDG = rvar_MCP_HDG + 1;
Display.HDG_ = rvar_MCP_HDG;
}


:AP_VS_On

{ if(!Rotaries.VSdir){Events_R.AP_VS_VAR_INC = pulse;}
else {Events_R.AP_VS_VAR_DEC = pulse;}
}


:AP_Alt_Set

{ if(Rotaries.ALTdir){rvar_MCP_ALT+=5;}
else {rvar_MCP_ALT-=5;}

nqw(setpov4, rvar_MCP_ALT);

// Virtual_Axis.MCP_ALT = rvar_MCP_ALT * 100; //Scale the MCP Value correctly
// Virtual_Axis.MCP_ALT = Virtual_Axis.MCP_ALT + 100; //Adjust for MCP Offset

Display.ALT_ = rvar_MCP_ALT;
}


//----------------------------------------------------------------------
// LANDING GEAR ROUTINES
//----------------------------------------------------------------------

defqp(3, LM_DOWN)
defqp(4, LM_MOVE)
defqp(5, LM_UP)
defqp(6, NS_DOWN)
defqp(7, NS_MOVE)
defqp(8, NS_UP)
defqp(9, RM_DOWN)
defqp(10, RM_MOVE)
defqp(11, RM_UP)


//:GEAR_UP {Enque16(Btnpulse, 8);}
//:GEAR_DOWN{Enque16(Btnpulse, 9);}

:LM_UP{delay(80); clrp(LW_Up);}
:NS_UP{delay(20); clrp(NW_Up);}
:RM_UP{delay(90); clrp(RW_Up);}
:LM_MOVE{clrp(LW_Down); setp(LW_Up);}
:NS_MOVE{clrp(NW_Down); setp(NW_Up);}
:RM_MOVE{clrp(RW_Down); setp(RW_Up);}
:LM_DOWN{delay(70); clrp(LW_Up); setp(LW_Down);}
:NS_DOWN{delay(10); clrp(NW_Up); setp(NW_Down);}
:RM_DOWN{delay(85); clrp(RW_Up); setp(RW_Down);}

//---------------------------------------------------- CONTROL YOKE

:Yoke_ap_disengage{nqw(BtnPulse, 0);} //Disengage Autopilot

:Yoke_flaps_up{ nqw(BtnPulse, 1);} //Flaps Up


:Yoke_flaps_dn
{ nqw(BtnPulse, 2);} //Flaps Down


:Spoilers_arm
{ nqw(BtnPulse, 5);} //Flaps Retract

:Yoke_trim_d {Yoke.trim_dn = BtnOn;}
:Yoke_trim_u {Yoke.trim_up = BtnOn;}

:Yoke_trim_d_off {Yoke.trim_dn = BtnOff;}
:Yoke_trim_u_off {Yoke.trim_up = BtnOff;}

:Yoke_trim_l {Yoke.trim_left = BtnOn;}
:Yoke_trim_r {Yoke.trim_right = BtnOn;}


:Yoke_trim_l_off {Yoke.trim_left = BtnOff;}
:Yoke_trim_r_off {Yoke.trim_right = BtnOff;}

//----------------------------------------- GEAR AND BRAKES
:Gear_dn

{
nqw(BtnPulse, 0x0006);
}

:Gear_up

{
nqw(BtnPulse, 0x0007);
}

defbtn(Yoke.trim_up, on, Yoke_trim_u)
defbtn(Yoke.trim_dn, on, Yoke_trim_d)
defbtn(Yoke.trim_up, off, Yoke_trim_u_off)
defbtn(Yoke.trim_dn, off, Yoke_trim_d_off)

defbtn(Yoke.trim_left, on, Yoke_trim_l)
defbtn(Yoke.trim_right, on, Yoke_trim_r)
defbtn(Yoke.trim_left, off, Yoke_trim_l_off)
defbtn(Yoke.trim_right, off, Yoke_trim_r_off)


defbtn(Yoke.ap_disengage, on, Yoke_ap_disengage)
defbtn(Yoke.btn1, on, Yoke_flaps_dn)

defbtn(Yoke.btn2, on, Yoke_flaps_up)
defbtn(Yoke.gear, on, Gear_dn)
defbtn(Yoke.gear, off, Gear_up)

//AUTOPILOT ROTARIES

defbtn(Rotaries.ALTset, on, AP_Alt_Set)
defbtn(Rotaries.ALTset, off, AP_Alt_Set)
defbtn(Rotaries.VSset, on, AP_VS_On)
defbtn(Rotaries.VSset, off, AP_VS_On)
defbtn(Rotaries.IASset, on, AP_IAS_Set)
defbtn(Rotaries.IASset, off, AP_IAS_Set)
defbtn(Rotaries.HDGset, on, AP_HDG_Set)
defbtn(Rotaries.HDGset, off, AP_HDG_Set)

//AUTOPILOT BUTTONS

defbtn(Buttons.alt_hold_on, on, Pulse_alt_hold_on)
defbtn(Buttons.vs_on, on, Pulse_vs_on)
defbtn(Buttons.app_on, on, Pulse_app_on)
defbtn(Buttons.cmd_r_on, on, Pulse_cmd_r_on)
defbtn(Buttons.loc_on, on, Pulse_loc_on)
defbtn(Buttons.at_arm, on, Pulse_at_arm)
defbtn(Buttons.lnav_on, on, Pulse_lnav_on)
defbtn(Buttons.vnav_on, on, Pulse_vnav_on)
defbtn(Buttons.flch_on, on, Pulse_flch_on)
defbtn(Buttons.MCP_APL, on, Pulse_MCP_APL)
defbtn(Buttons.MCP_SPD, on, Pulse_MCP_SPD)
defbtn(Buttons.thr_on, on, Pulse_thr_on)
defbtn(Buttons.hdg_hold_on, on, Pulse_hdg_hold_on)


//RADIO STACK ROTARIES

//defbtn(Buttons.Radio_PWR, on, Radio_PWR)

defbtn(Rotaries.NAV1CRSset, on, NAV1_CRS_Set)
defbtn(Rotaries.NAV1CRSset, off, NAV1_CRS_Set)
defbtn(Rotaries.COM1set, on, Tune_Radio)
defbtn(Rotaries.COM1set, off, Tune_Radio)
defbtn(Rotaries.XPDRset, on, XPDR_Tune)
defbtn(Rotaries.XPDRset, off, XPDR_Tune)
defbtn(Buttons.COM1_Toggle, on, Tune_COM1)
defbtn(Buttons.XPDR_Toggle, on, Tune_XPDR)
defbtn(Buttons.FREQUENCY_SWAP,on, Freq_Swap)
defbtn(Buttons.COM_RADIO, on, Select_COM1)
defbtn(Buttons.NAV_RADIO, on, Select_NAV1)
defbtn(Buttons.Sel_NAV2, on, Select_NAV2)