diff --git a/BaS_gcc/Makefile b/BaS_gcc/Makefile index b2272a7..817652b 100644 --- a/BaS_gcc/Makefile +++ b/BaS_gcc/Makefile @@ -41,7 +41,8 @@ CFLAGS= -Wall \ -fomit-frame-pointer \ -ffreestanding \ -fleading-underscore \ - -Wa,--register-prefix-optional + -Wa,--register-prefix-optional \ + -g CFLAGS_OPTIMIZED = -mcpu=5474 \ -Wall \ -O2 \ diff --git a/BaS_gcc/sys/interrupts.c b/BaS_gcc/sys/interrupts.c index 47d0bc0..3e1896d 100644 --- a/BaS_gcc/sys/interrupts.c +++ b/BaS_gcc/sys/interrupts.c @@ -37,7 +37,7 @@ #include "dma.h" #include "pci.h" -//#define IRQ_DEBUG +// #define IRQ_DEBUG #if defined(IRQ_DEBUG) #define dbg(format, arg...) do { xprintf("DEBUG %s(): " format, __FUNCTION__, ##arg); } while (0) #else @@ -247,20 +247,20 @@ bool pic_interrupt_handler(void *arg1, void *arg2) dbg("PIC interrupt\r\n"); - rcv_byte = MCF_PSC3_PSCRB_8BIT; + rcv_byte = * (volatile uint8_t *) (&MCF_PSC3_PSCRB_8BIT); if (rcv_byte == 2) /* PIC requests RTC data */ { - uint8_t *rtc_reg = (uint8_t *) 0xffff8961; - uint8_t *rtc_data = (uint8_t *) 0xffff8963; + volatile uint8_t *rtc_reg = (uint8_t *) 0xffff8961; + volatile uint8_t *rtc_data = (uint8_t *) 0xffff8963; int index = 0; err("PIC interrupt: requesting RTC data\r\n"); - MCF_PSC3_PSCTB_8BIT = 0x82; // header byte to PIC + * (volatile uint8_t *) (&MCF_PSC3_PSCTB_8BIT) = 0x82; // header byte to PIC do { *rtc_reg = 0; - MCF_PSC3_PSCTB_8BIT = *rtc_data; + * (volatile uint8_t *) (&MCF_PSC3_PSCTB_8BIT) = *rtc_data; } while (index++ < 64); } return true; diff --git a/BaS_gcc/sys/sysinit.c b/BaS_gcc/sys/sysinit.c index 1153453..438b907 100644 --- a/BaS_gcc/sys/sysinit.c +++ b/BaS_gcc/sys/sysinit.c @@ -265,9 +265,6 @@ static void init_serial(void) MCF_PSC3_PSCCR = 0x05; #endif /* MACHINE_FIREBEE */ - MCF_INTC_ICR32 = MCF_INTC_ICR_IL(7) | - MCF_INTC_ICR_IL(4); /* PSC3 interrupt vector. Do we need it? */ - xprintf("\r\nserial interfaces initialization: finished\r\n"); }