?? inter.c
字號(hào):
/************************************************
* 文件名:inter.c *
* 文件功能:中斷服務(wù)程序 *
* 作者:xxlxws *
* 日期:2007-05-15 *
* 版本號(hào):1.0 *
************************************************/
#include <ioavr.h>
#include <intrinsics.h>
#include "mylib.h"
#include "common.h"
#include "main.h"
#include "init.h"
#include "func.h"
#include "inter.h"
extern struct _Led Led;
extern struct _Data Data;
extern struct _Count Count;
extern struct _Moto Moto_A,Moto_B,Moto_Mid,Moto_HT;
extern uint8 Mass[4];
extern uint8 LedCode[10];
/************************************************
* 函數(shù)名:Inter_Timer0_CMPA *
* 入口參數(shù):無(wú) *
* 出口參數(shù):無(wú) *
* 作者:xxlxws *
* 日期:2007-05-15 *
* 函數(shù)功能:16.32ms溢出產(chǎn)生PWM,控制振動(dòng)電機(jī)MA*
************************************************/
#pragma vector=TIMER0_COMPA_vect
__interrupt void Inter_Timer0_CMPA(void) /*16ms溢出*/
{
Moto_A.Count++;
Moto_Mid = Moto_A;
Moto_Mode_Set();
Moto_A = Moto_Mid;
OCR0A = Moto_A.Mass;
return;
}
/************************************************
* 函數(shù)名:Inter_Timer0_CMPB *
* 入口參數(shù):無(wú) *
* 出口參數(shù):無(wú) *
* 作者:xxlxws *
* 日期:2007-05-15 *
* 函數(shù)功能:32us溢出產(chǎn)生PWM,控制加熱片HT *
************************************************/
#pragma vector=TIMER0_COMPB_vect
__interrupt void Inter_Timer0_CMPB(void) /*32us溢出*/
{
OCR0B = Moto_HT.Mass;
return;
}
/************************************************
* 函數(shù)名:Inter_Timer1 *
* 入口參數(shù):無(wú) *
* 出口參數(shù):無(wú) *
* 作者:xxlxws *
* 日期:2007-05-15 *
* 函數(shù)功能:320us溢出,定時(shí)、LED顯示及鍵盤掃描*
************************************************/
#pragma vector=TIMER1_OVF_vect
__interrupt void Inter_Timer1(void) /*320us*/
{
return;
}
/************************************************
* 函數(shù)名:Inter_Timer2_CMPB *
* 入口參數(shù):無(wú) *
* 出口參數(shù):無(wú) *
* 作者:xxlxws *
* 日期:2007-05-15 *
* 函數(shù)功能:32us溢出產(chǎn)生PWM,控制振動(dòng)電機(jī)MB *
************************************************/
#pragma vector=TIMER2_COMPB_vect
__interrupt void Inter_Timer2_CMPB(void) /*32us溢出*/
{
Moto_B.Count++;
Moto_Mid = Moto_B;
Moto_Mode_Set();
Moto_B = Moto_Mid;
OCR2B = Moto_B.Mass;
return;
}
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -