diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2013-01-22 01:25:40 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2013-01-22 01:25:40 +0000 |
commit | 4742f55507b6e1392f459a2c228efb75b567b62e (patch) | |
tree | a1914fb5c45a61232078c98064198ac8818f07b4 /nuttx/arch/arm/src/armv7-m/up_hardfault.c | |
parent | e504d643fc23cefe61340e4d3a75d6e80f4b76fb (diff) | |
download | px4-firmware-4742f55507b6e1392f459a2c228efb75b567b62e.tar.gz px4-firmware-4742f55507b6e1392f459a2c228efb75b567b62e.tar.bz2 px4-firmware-4742f55507b6e1392f459a2c228efb75b567b62e.zip |
Add option to use BASEPRI instead of PRIMASK to disable interrupts in all ARMv7-M architectures
git-svn-id: http://svn.code.sf.net/p/nuttx/code/trunk@5546 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/arch/arm/src/armv7-m/up_hardfault.c')
-rw-r--r-- | nuttx/arch/arm/src/armv7-m/up_hardfault.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/nuttx/arch/arm/src/armv7-m/up_hardfault.c b/nuttx/arch/arm/src/armv7-m/up_hardfault.c index c30015ad2..b043db3df 100644 --- a/nuttx/arch/arm/src/armv7-m/up_hardfault.c +++ b/nuttx/arch/arm/src/armv7-m/up_hardfault.c @@ -93,17 +93,16 @@ int up_hardfault(int irq, FAR void *context) { uint32_t *regs = (uint32_t*)context; - uint16_t *pc; - uint16_t insn; /* Get the value of the program counter where the fault occurred */ - pc = (uint16_t*)regs[REG_PC] - 1; +#ifndef CONFIG_ARMV7M_USEBASEPRI + uint16_t *pc = (uint16_t*)regs[REG_PC] - 1; if ((void*)pc >= (void*)&_stext && (void*)pc < (void*)&_etext) { /* Fetch the instruction that caused the Hard fault */ - insn = *pc; + uint16_t insn = *pc; hfdbg(" PC: %p INSN: %04x\n", pc, insn); /* If this was the instruction 'svc 0', then forward processing @@ -116,6 +115,7 @@ int up_hardfault(int irq, FAR void *context) return up_svcall(irq, context); } } +#endif /* Dump some hard fault info */ |