Now it is working, honest.

git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@1805 35acf78f-673a-0410-8e92-d51de3d6d3f4
This commit is contained in:
gdisirio 2010-03-29 20:27:35 +00:00
parent 14f0fb44f8
commit 97436c3443
3 changed files with 5 additions and 7 deletions

View File

@ -58,13 +58,8 @@
*/ */
void hal_lld_init(void) { void hal_lld_init(void) {
/* Note: PRIGROUP 2:0 (2:6).*/
// SCB->AIRCR = AIRCR_VECTKEY | SCB_AIRCR_PRIGROUP_0 | SCB_AIRCR_PRIGROUP_1;
NVICSetSystemHandlerPriority(HANDLER_SVCALL, CORTEX_PRIORITY_SVCALL);
NVICSetSystemHandlerPriority(HANDLER_SYSTICK, CORTEX_PRIORITY_SYSTICK);
NVICSetSystemHandlerPriority(HANDLER_PENDSV, CORTEX_PRIORITY_PENDSV);
/* SysTick initialization using the system clock.*/ /* SysTick initialization using the system clock.*/
NVICSetSystemHandlerPriority(HANDLER_SYSTICK, CORTEX_PRIORITY_SYSTICK);
SysTick->LOAD = LPC11xx_SYSCLK / CH_FREQUENCY - 1; SysTick->LOAD = LPC11xx_SYSCLK / CH_FREQUENCY - 1;
SysTick->VAL = 0; SysTick->VAL = 0;
SysTick->CTRL = SysTick_CTRL_CLKSOURCE_Msk | SysTick->CTRL = SysTick_CTRL_CLKSOURCE_Msk |

View File

@ -80,6 +80,8 @@ void _port_switch_from_irq(void) {
"mrs r1, XPSR \n\t" \ "mrs r1, XPSR \n\t" \
"push {r0, r1, lr} \n\t" \ "push {r0, r1, lr} \n\t" \
"ldr r0, =_port_saved_pc \n\t" \ "ldr r0, =_port_saved_pc \n\t" \
"ldr r0, [r0] \n\t" \
"add r0, r0, #1 \n\t" \
"str r0, [sp, #28]"); "str r0, [sp, #28]");
chSchDoRescheduleI(); chSchDoRescheduleI();

View File

@ -211,7 +211,8 @@ struct context {
*/ */
#define PORT_IRQ_EPILOGUE() { \ #define PORT_IRQ_EPILOGUE() { \
chSysLockFromIsr(); \ chSysLockFromIsr(); \
if (((SCB_ICSR & ICSR_RETTOBASE) != 0) && chSchIsRescRequiredExI()) { \ if (((SCB_ICSR & ICSR_VECTPENDING_MASK) == 0) && \
chSchIsRescRequiredExI()) { \
register struct cmxctx *ctxp asm ("r3"); \ register struct cmxctx *ctxp asm ("r3"); \
\ \
asm volatile ("mrs %0, PSP" : "=r" (ctxp) : "r" (ctxp)); \ asm volatile ("mrs %0, PSP" : "=r" (ctxp) : "r" (ctxp)); \