📄 interrupt.c
字号:
#ifndef _INT_C_
#define _INT_C_
#include "global.h"
/************************************************************************/
/* High-priority service */
/************************************************************************/
void interrupt HighInterruptSeviceRoutine(void)
{
/***** Timer 0 Code *****/
if(T0IE & T0IF)
fTimer0InterruptSeviceRoutine();
if(TMR2IE & TMR2IF)
fTimer2InterruptSeviceRoutine();
/***** PortB Code *****/
if (RBIF & RBIE)
fPortBInterruptSeviceRoutine();
}
void fTimer0InterruptSeviceRoutine(void) // Here be interrupt function
{
TMR0 = 255 - 125; // 8ms
bHavePassed8ms = 1;
T0IF = 0; // Clr interrDownt flag, ready for next
}
void fPortBInterruptSeviceRoutine(void)
{
PORTB = PORTB; //read portB(to itself) to end mismatch condition
bPortBIsIntterrupt = 1;
RBIF=0;
}
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -