From 28eb4a57d93f2cf13d3693ce4dba677f22cbf1cc Mon Sep 17 00:00:00 2001 From: laforge Date: Sun, 15 Oct 2006 20:21:40 +0000 Subject: - add svn:ignore property to make 'svn st' output more realistic - remove old copy+paste+edit port of parts of librfid - add ability to directly link librfid.a from mainline librfid - make usb string descriptors optional again (config.h) - fix TC_CDIV to reset correctly on swtrig (For OpenPICC) - temporarily re-implement ep0_send_data() in pcd_enumerate.c - make UDP_PUPv4 switching conditional to PCD - introduce DEBUG_UNBUFFERED define in dbgu.c - fix some signed/unsigned/typecast related compiler warnings - remove dead code from src/os/led.c - implement a 'mdelay' and 'usleep' stub function (FIXME!) - rename rc632_... functions into opcd_rc632_... to avoid confusion - introduce new 'main_librfid' TARGET - make main_{reqa,analog} work with librfid rather than old code - introduce mroe debugging options for FIQ handler code in Cstartup_app - lots of PICC work that doesn't need comments now git-svn-id: https://svn.openpcd.org:2342/trunk@266 6dc7ffe9-61d6-0310-9af1-9938baff3ed1 --- firmware/src/start/Cstartup_app.S | 56 +++++++++++---------------------------- 1 file changed, 16 insertions(+), 40 deletions(-) (limited to 'firmware/src/start') diff --git a/firmware/src/start/Cstartup_app.S b/firmware/src/start/Cstartup_app.S index fb70272..448cc93 100644 --- a/firmware/src/start/Cstartup_app.S +++ b/firmware/src/start/Cstartup_app.S @@ -124,6 +124,9 @@ exit: .endfunc +#define LED_TRIGGER +#define CALL_PIO_IRQ_DEMUX + .text .arm .section .fastrun, "ax" @@ -140,25 +143,32 @@ fiq_handler: r13 stack r14 lr */ -#if 0 - mov r11, #PIO_LED1 - str r11, [r10, #PIOA_CODR] /* enable LED */ - str r11, [r10, #PIOA_SODR] /* disable LED */ -#endif ldr r8, [r10, #PIOA_ISR] tst r8, #PIO_DATA /* check for PIO_DATA change */ ldrne r11, [r10, #PIOA_PDSR] tstne r11, #PIO_DATA /* check for PIO_DATA == 1 */ strne r9, [r12, #TC_CCR] /* software trigger */ +#ifdef LED_TRIGGER + movne r11, #PIO_LED1 + strne r11, [r10, #PIOA_CODR] /* enable LED */ +#endif +#if 1 movne r11, #PIO_DATA strne r11, [r10, #PIOA_IDR] /* disable further PIO_DATA FIQ */ +#endif /*- Mark the End of Interrupt on the AIC */ ldr r11, =AT91C_BASE_AIC str r11, [r11, #AIC_EOICR] +#ifdef LED_TRIGGER + mov r11, #PIO_LED1 + str r11, [r10, #PIOA_SODR] /* disable LED */ +#endif + +#ifdef CALL_PIO_IRQ_DEMUX /* push r0, r1-r3, r12, r14 onto FIQ stack */ stmfd sp!, { r0-r3, r12, lr} mov r0, r8 @@ -172,43 +182,9 @@ fiq_handler: bx r11 /* msr CPSR_c, #I_BIT | F_BIT | ARM_MODE_FIQ */ - ldmia sp!, { r0-r3, r12, lr } - -#if 0 -/*- Save and r0 in FIQ_Register */ - mov r9, r0 - ldr r0, [r11, #AIC_FVR] - str r8, [r11, #AIC_FVR] - /* msr CPSR_c, #I_BIT | F_BIT | ARM_MODE_SVC */ - - /*- Save scratch/used registers and LR in User Stack */ - stmfd sp!, { r1-r3, r12, lr} - - led1on - - /*- Branch to the routine pointed by the AIC_FVR */ - mov r14, pc - bx r0 - - /*- Restore scratch/used registers and LR from User Stack */ - ldmia sp!, { r1-r3, r12, lr} - - /*- Leave Interrupts disabled and switch back in FIQ mode */ - /* msr CPSR_c, #I_BIT | F_BIT | ARM_MODE_FIQ */ - - /*- Mark the End of Interrupt on the AIC */ - ldr r0, =AT91C_BASE_AIC - str r0, [r0, #AIC_EOICR] - - /*- Restore the R0 ARM_MODE_SVC register */ - mov r0,r9 - - ldr r10, =PIOA_SODR - mov r11, #(1 << LED1) - str r11, [r10] - #endif + /*- Restore the Program Counter using the LR_fiq directly in the PC */ subs pc, lr, #4 -- cgit v1.2.3