我在研究这个ITE8712看门狗定时器演示代码时,发现了这个:
void InitWD(char cSetWatchDogUnit, char cSetTriggerSignal)
{
OpenIoConfig(); //open super IO of configuration for Super I/O
SelectIoDevice(0x07); //select device7
//set watch dog counter of unit
WriteIoCR(0x72, cSetWatchDogUnit|cSetTriggerSignal);
//CloseIoConfig(); //close super IO of configuration for Super I/O
}
我想知道这行代码的含义:
cSetWatchDogUnit|cSetTriggerSignal
因为WriteIoCR函数的代码如下:
void WriteIoCR(char cIndex, char cData)
{
//super IO of index port for Super I/O
//select super IO of index register for Super I/O
outportb(equIndexPort,cIndex);
//super IO of data for Super I/O
//write data to data register
outportb(equDataPort,cData);
}
所以cIndex应该是0x72,但是cData呢?我真的不明白"|"这个符号,因为我只在条件语句中使用过它作为OR("||")。