📄 extint_chris.c
字号:
//***********extint.c
void extintInit_IO_M16( u08 INTx )
{
//INT0
if( INTx==INT0 )
{
//set input
cbi(DDRD,PD2);
//set the pull-up resistance
sbi(PORTD,PD2);
}
//INT1
if( INTx==INT1 )
{
//set input
cbi(DDRD,PD3);
//set the pull-up resistance
sbi(PORTD,PD3);
}
//INT2
if( INTx==INT2 )
{
//set input
cbi(DDRB,PB2);
//set the pull-up resistance
sbi(PORTB,PB2);
}
}
//*************************
//enable the extint interrupt
void extintEnable_M16(u08 INTx)
{
sbi(GICR,INTx);
}
//disable the extint interrupt
void extintDisable_M16(u08 INTx)
{
cbi(GICR,INTx);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -