我不知道如何實現這個C#代碼到Java? Dev是有這個代碼的類。這個C#代碼的java等效代碼是什麼?
public enum ConfigSetupByte0Bitmap
{
Config5VReg = 0x80,
ConfigPMux = 0x40,
}
public void SetVReg(bool val)
{
//vReg = val;
if (val)
{
configSetupByte0 |= (int)Dev.ConfigSetupByte0Bitmap.Config5VReg;
}
else
{
configSetupByte0 &= ~(int)Dev.ConfigSetupByte0Bitmap.Config5VReg;
}
}
我創建枚舉符合上述枚舉與構造。但是在SetVReg方法中,它說不能將ConfigSetupByte0Bitmap.Config5VReg轉換爲int。 – Milan 2012-03-30 11:29:29