首页 | 新闻 | 新品 | 文库 | 方案 | 视频 | 下载 | 商城 | 开发板 | 数据中心 | 座谈新版 | 培训 | 工具 | 博客 | 论坛 | 百科 | GEC | 活动 | 主题月 | 电子展
返回列表 回复 发帖

Cortex-M3 异常和中断---基于NXP LPC177x/8x(2)

Cortex-M3 异常和中断---基于NXP LPC177x/8x(2)

keil编译器已命名的寄存器变量为:

寄存器

__asm修饰的字符串

处理器

APSR
"apsr"

All processors

CPSR
"cpsr"

All processors

BASEPRI
"basepri"

Cortex-M3, Cortex-M4

BASEPRI_MAX
"basepri_max"

Cortex-M3, Cortex-M4

CONTROL
"control"

Cortex-M0, Cortex-M1, Cortex-M3, Cortex-M4

DSP
"dsp"

Cortex-M0, Cortex-M1, Cortex-M3, Cortex-M4

EAPSR
"eapsr"

Cortex-M0, Cortex-M1, Cortex-M3, Cortex-M4

EPSR
"epsr"

Cortex-M0, Cortex-M1, Cortex-M3, Cortex-M4

FAULTMASK
"faultmask"

Cortex-M3, Cortex-M4

IAPSR
"iapsr"

Cortex-M0, Cortex-M1, Cortex-M3, Cortex-M4

IEPSR
"iepsr"

Cortex-M0, Cortex-M1, Cortex-M3, Cortex-M4

IPSR
"ipsr"

Cortex-M0, Cortex-M1, Cortex-M3, Cortex-M4

MSP
"msp"

Cortex-M0, Cortex-M1, Cortex-M3, Cortex-M4

PRIMASK
"primask"

Cortex-M0, Cortex-M1, Cortex-M3, Cortex-M4

PSP
"psp"

Cortex-M0, Cortex-M1, Cortex-M3, Cortex-M4

PSR
"psr"

Cortex-M0, Cortex-M1, Cortex-M3, Cortex-M4

r0 to r12
"r0" to "r12"

All processors

r14 or lr
"r14" or "lr"

All processors

r13 or sp
"r13" or "sp"

All processors

r15 or pc
"r15" or "pc"

All processors

SPSR
"spsr"

All processors, apart from Cortex-M series processors.

XPSR
"xpsr"

Cortex-M0, Cortex-M1, Cortex-M3, Cortex-M4

1.2 开/关异常   1: /**   2: * @brief  Set the Fault Mask value   3: *   4: * @param  faultMask  faultMask value   5: *   6: * Set the fault mask register   7: */   8: static __INLINE void __set_FAULTMASK(uint32_t faultMask)   9: {  10:   register uint32_t __regFaultMask       __ASM("faultmask");  11:   __regFaultMask = (faultMask & 1);  12: }

使用__set_FAULTMASK(1)来关闭中断和异常;使用__set_FAULTMASK(0)开启中断和异常.
继承事业,薪火相传
返回列表