Is there a Macro to return I bit value in status register?

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

Is there a Macro to return I bit value in status register?

跳至解决方案
1,391 次查看
PG1
Contributor I

Is there a macro to return the status of the I (global int enable) bit in the status register?

 

Or do you have to roll your own assembly language function?

标签 (1)
标记 (1)
0 项奖励
回复
1 解答
1,189 次查看
bigmac
Specialist III

Hello,

 

For 8-bit MCUs there is the function __isflag_int_enabled() that returns the status if the I-bit.  The prototype is within "intrinsics_HC08.h".  There are also similar functions for returning the status of the carry flag, the half carry flag, and the external interrupt pin.

 

Regards,

Mac

 

在原帖中查看解决方案

0 项奖励
回复
3 回复数
1,190 次查看
bigmac
Specialist III

Hello,

 

For 8-bit MCUs there is the function __isflag_int_enabled() that returns the status if the I-bit.  The prototype is within "intrinsics_HC08.h".  There are also similar functions for returning the status of the carry flag, the half carry flag, and the external interrupt pin.

 

Regards,

Mac

 

0 项奖励
回复
1,189 次查看
PG1
Contributor I

Thanks. I will do a search for it in the HCS08 version of codewarrior, or see if I can port it over.

0 项奖励
回复
1,189 次查看
CrasyCat
Specialist III

Hello

 

Function __isflag_int_enabled() is an intrinsic function of the HC08, HCS08 and RS08 compiler.

If you are targeting another MCU it might not be available.

 

By the way which MCU are you targeting?

 

CrasyCat

0 项奖励
回复