Merge branch 'untested'

This commit is contained in:
Mariano Alvira 2009-04-24 16:04:37 -04:00
commit efb6671bf7
15 changed files with 20 additions and 47 deletions

View file

@ -88,7 +88,7 @@ src/isr.o: src/isr.c
%.dis: %.obj %.dis: %.obj
$(OBJDUMP) -SD $< > $@ $(OBJDUMP) -SD $< > $@
%.obj: $(LDSCRIPT) %.o #src/interrupt-utils.o %.obj: $(LDSCRIPT) %.o src/isr.o
$(LD) $(LDFLAGS) $(AOBJS) \ $(LD) $(LDFLAGS) $(AOBJS) \
--start-group $(PLATFORM_LIBS) --end-group \ --start-group $(PLATFORM_LIBS) --end-group \
-Map $*.map $^ -o $@ -Map $*.map $^ -o $@

View file

@ -28,13 +28,13 @@ ENTRY(_start)
SECTIONS SECTIONS
{ {
. = 0x00400000; . = 0x00400000;
. = ALIGN(4); . = ALIGN(4);
.text : .text :
{ {
src/start.o (.text) src/start.o (.text)
src/isr.o (.text) *(.irq)
*(.text) *(.text)
} }
. = ALIGN(4); . = ALIGN(4);

View file

@ -10,13 +10,9 @@
#define INTENNUM INTBASE + INTENNUM_OFF #define INTENNUM INTBASE + INTENNUM_OFF
#define INTSRC INTBASE + INTSRC_OFF #define INTSRC INTBASE + INTSRC_OFF
#define no_isrs() no_tmr_isr();
#define enable_tmr_irq() *(volatile uint32_t *)(INTENNUM) = 5; #define enable_tmr_irq() *(volatile uint32_t *)(INTENNUM) = 5;
#define no_tmr_isr() void tmr_isr(void) { return; }
extern void tmr_isr(void); extern void tmr_isr(void) __attribute__((weak));
#endif #endif

View file

@ -4,12 +4,15 @@
#define reg32(x) (*(volatile uint32_t *)(x)) #define reg32(x) (*(volatile uint32_t *)(x))
//__attribute__ ((interrupt("IRQ"))) __attribute__ ((section (".irq")))
void isr(void) __attribute__ ((interrupt("IRQ")))
void irq(void)
{ {
// ISR_ENTRY(); // ISR_ENTRY();
/* check for TMR0 interrupt */ /* check for TMR0 interrupt */
tmr_isr(); // led turns off if I have this, indicating that the isr does jump to tmr_isr if(tmr_isr != NULL) {
tmr_isr(); // led turns off if I have this, indicating that the isr does jump to tmr_isr
}
// if(reg32(INTSRC) & (1<<5)) { tmr_isr(); } // if(reg32(INTSRC) & (1<<5)) { tmr_isr(); }
// asm("SUBS PC,R14_IRQ,#4") // asm("SUBS PC,R14_IRQ,#4")
// enableIRQ(); // I think this is necessary, but the LED never turns off when I have this // enableIRQ(); // I think this is necessary, but the LED never turns off when I have this

View file

@ -215,19 +215,12 @@ not_used:
.align 5 .align 5
irq: //irq:
push {lr} // push {lr}
movs lr,pc // movs lr,pc
b isr // b isr
pop {lr} // pop {lr}
subs pc,r14,#4 // suggested irq return cmd // subs pc,r14,#4 // suggested irq return cmd
// STMFD sp!, {r0-r12,lr}
// MOVNE lr,pc
// ldr r0, =isr
// BX r0
// LDMFD r13!, {r0-r12,r14}
// MOVS PC, R14
// subs pc, r14, #4
fiq: fiq:
.align 5 .align 5

View file

@ -7,8 +7,6 @@
#include "embedded_types.h" #include "embedded_types.h"
#include "isr.h" #include "isr.h"
no_isrs();
__attribute__ ((section ("startup"))) __attribute__ ((section ("startup")))
void main(void) { void main(void) {

View file

@ -7,8 +7,6 @@
#include "embedded_types.h" #include "embedded_types.h"
#include "isr.h" #include "isr.h"
no_isrs();
__attribute__ ((section ("startup"))) __attribute__ ((section ("startup")))
void main(void) { void main(void) {

View file

@ -7,8 +7,6 @@
#include "embedded_types.h" #include "embedded_types.h"
#include "isr.h" #include "isr.h"
no_isrs();
__attribute__ ((section ("startup"))) void main(void) { __attribute__ ((section ("startup"))) void main(void) {
*(volatile uint32_t *)GPIO_PAD_DIR0 = 0x00000100; *(volatile uint32_t *)GPIO_PAD_DIR0 = 0x00000100;

View file

@ -7,8 +7,6 @@
#include "embedded_types.h" #include "embedded_types.h"
#include "isr.h" #include "isr.h"
no_isrs();
__attribute__ ((section ("startup"))) __attribute__ ((section ("startup")))
void main(void) { void main(void) {

View file

@ -31,8 +31,6 @@ const uint8_t hex[16]={'0','1','2','3','4','5','6','7',
#include "isr.h" #include "isr.h"
no_isrs();
#define NBYTES 1024 #define NBYTES 1024
__attribute__ ((section ("startup"))) __attribute__ ((section ("startup")))
void main(void) { void main(void) {

View file

@ -14,6 +14,7 @@
#include "maca.h" #include "maca.h"
#include "embedded_types.h" #include "embedded_types.h"
#include "isr.h"
#define reg(x) (*(volatile uint32_t *)(x)) #define reg(x) (*(volatile uint32_t *)(x))
@ -77,9 +78,6 @@ void toggle_led(void) {
} }
} }
#include "isr.h"
no_isrs();
__attribute__ ((section ("startup"))) __attribute__ ((section ("startup")))
void main(void) { void main(void) {
uint8_t c; uint8_t c;

View file

@ -14,6 +14,7 @@
#include "maca.h" #include "maca.h"
#include "embedded_types.h" #include "embedded_types.h"
#include "isr.h"
#define reg(x) (*(volatile uint32_t *)(x)) #define reg(x) (*(volatile uint32_t *)(x))
@ -112,9 +113,6 @@ void fill_data(void) {
} }
} }
#include "isr.h"
no_isrs();
__attribute__ ((section ("startup"))) __attribute__ ((section ("startup")))
void main(void) { void main(void) {
uint8_t c; uint8_t c;

View file

@ -29,7 +29,6 @@ const uint8_t hex[16]={'0','1','2','3','4','5','6','7',
//#define DUMP_LEN 16 //#define DUMP_LEN 16
#include "isr.h" #include "isr.h"
no_isrs();
__attribute__ ((section ("startup"))) __attribute__ ((section ("startup")))
void main(void) { void main(void) {

View file

@ -47,9 +47,7 @@
#define reg16(x) (*(volatile uint16_t *)(x)) #define reg16(x) (*(volatile uint16_t *)(x))
#include "embedded_types.h" #include "embedded_types.h"
#include "isr.h" #include "isr.h"
no_isrs();
__attribute__ ((section ("startup"))) __attribute__ ((section ("startup")))
void main(void) { void main(void) {

View file

@ -10,9 +10,7 @@
#define UART1_BR 0x80005018 #define UART1_BR 0x80005018
#include "embedded_types.h" #include "embedded_types.h"
#include "isr.h" #include "isr.h"
no_isrs();
__attribute__ ((section ("startup"))) __attribute__ ((section ("startup")))
void main(void) { void main(void) {