One way to increase the readability of your code would be to use an enum to keep track of the drive mode. This also lets you simplify the logic for tracking the button press state:
Code:
void OperatorControl(void)
{
typedef enum _DriveMode { kArcadeDrive, kTankDrive } DriveMode;
DriveMode mode = kArcadeDrive;
bool current, prev;
prev = current = false;
while (IsOperatorControl())
{
// Check the mode toggle button
current = secondaryControler->GetRawButton(6);
if (mode == kArcadeDrive) {
// Arcade Drive code here...
// Check for state chagne
if (current && !prev)
mode = kTankDrive;
} else if (mode == kTankDrive) {
// Tank Drive code here...
// Check for state change
if (current && !prev)
mode = kArcadeDrive;
}
// Set old button value for next iteration
prev = current;
}
// Other code goes here...
}