sam3x8e: Clear all bits of PSR register when clearing IRQ status

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
Kevin O'Connor 2016-10-31 11:47:57 -04:00
parent 41ef0bd98c
commit 233a90ce8b
1 changed files with 2 additions and 3 deletions

View File

@ -43,8 +43,7 @@ clear_active_irq(void)
// Shutdown did not occur in an irq - nothing to do. // Shutdown did not occur in an irq - nothing to do.
return; return;
// Clear active irq status // Clear active irq status
psr &= ~0x1ff; psr = 1<<24; // T-bit
psr |= 1<<24; // T-bit
uint32_t temp; uint32_t temp;
asm volatile( asm volatile(
" push { %1 }\n" " push { %1 }\n"
@ -53,7 +52,7 @@ clear_active_irq(void)
" push { r0, r1, r2, r3, r12, lr }\n" " push { r0, r1, r2, r3, r12, lr }\n"
" bx %2\n" " bx %2\n"
"1:\n" "1:\n"
: "=&r"(temp) : "r"(psr), "r"(0xfffffff9)); : "=&r"(temp) : "r"(psr), "r"(0xfffffff9) : "cc");
} }
DECL_SHUTDOWN(clear_active_irq); DECL_SHUTDOWN(clear_active_irq);