Motor Speed Toggle

I wanted to make a toggle button for my shooter, this is the code:
}#pragma config(Motor, port1, LeftDrive, tmotorVex393_HBridge, openLoop, reversed)
#pragma config(Motor, port2, RightDrive, tmotorVex393_MC29, openLoop)
//!!Code automatically generated by ‘ROBOTC’ configuration wizard !!//

task main()
{
int toggle;
toggle = 0;

while(1 == 1)
{
	if(toggle == 0)
	{
	 if(vexRT[Btn7D] == 1)
	 {
	   toggle = 1;
	 }
	 else if(vexRT[Btn8D] == 1)
	 {
	 	  motor[LeftDrive] = 63;
			motor[RightDrive] = 63;
	 }
	}
	else if(toggle == 1)
	{
		if(vexRT[Btn7D] == 1)
		{
			toggle = 0;	
		}
		else if(vexRT[Btn8D] == 1)
		{
			motor[LeftDrive] = 127;
			motor[RightDrive] = 127;
		}
	}
}

}
Can you tell me what I did wrong?

There’s a much simpler way of doing it using ternary operators.

int toggle=0;
int speed = 0;
int btn=0;
while(1)
{
  Wait1Msec(100); // check button every 100ms
  btn = joy1Btn(01);
  if(btn && (btn != toggle))
    speed = speed?0:50;  // speed is modified only if btn is pressed and was unpressed.
  motor[motoC] = speed;
  toggle = btn;
}

Info from the RobotC forums.
I’ve used this on my robot, so I can confirm that it does work.