ISR sample code

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

ISR sample code

1,066 次查看
Senu
Contributor I

can I get interrupt enabled UART sample C code?

标签 (1)
0 项奖励
回复
4 回复数

572 次查看
CrasyCat
Specialist III

Hello

 

- Which CPU are you targeting (HC08, HC12, Coldfire, ..)
- Which version of CodeWarrior are you using?

CrasyCat

0 项奖励
回复

572 次查看
Senu
Contributor I

Hello,

 

I am using CW7.2, MCF5272., in XP platform.

I could not find the macros for the INTR subroutine ,

Like, _ISR, _INTR et.

0 项奖励
回复

572 次查看
CrasyCat
Specialist III

Hello

 

You can specify a specific function is an interrupt function using following notation:

    __declspec(interrupt) void MyInterrupt(void) {

       /* Add your code here. */

    }

 

See ColdFire_Build_Tools_Reference manual for more details on this notation.

 

Then you need to initialize the appropriate entry in the vector table with the address of this function.

 

If you have created your project using the project wizard the source file exceptions.c contains such a table (it is called _vect).

Just add the name of your interrupt function at the appropriate location.

 

I hope this helps.

 

CrasyCat

0 项奖励
回复

572 次查看
Senu
Contributor I

Hello,

 

I am trying this, hope this can resolve my issue,

 

Thanks,

Senu

0 项奖励
回复