altos: Fix ISR declarations to make them non-weak
authorKeith Packard <keithp@keithp.com>
Fri, 22 Feb 2019 03:26:41 +0000 (19:26 -0800)
committerKeith Packard <keithp@keithp.com>
Fri, 22 Feb 2019 03:40:08 +0000 (19:40 -0800)
In my zeal to eliminate warnings, I added declarations of all ISR
functions to a shared header file. However, I managed to include the
'weak' declaration, which meant that the intended ISR functions were
as weak as the 'default' ISR functions. This left all interrupts
non-functional, which doesn't make for a happy program.

Signed-off-by: Keith Packard <keithp@keithp.com>
src/lpc/ao_interrupt.c
src/lpc/lpc.h
src/stm/ao_interrupt.c
src/stm/stm32l.h
src/stmf0/ao_interrupt.c
src/stmf0/stm32f0.h

index 77be7fa..8d71f43 100644 (file)
@@ -40,12 +40,12 @@ extern char __interrupt_rom__, __interrupt_start__, __interrupt_end__;
 
 /* Interrupt functions */
 
-static void lpc_halt_isr(void)
+void lpc_halt_isr(void)
 {
        ao_panic(AO_PANIC_CRASH);
 }
 
-static void lpc_ignore_isr(void)
+void lpc_ignore_isr(void)
 {
 }
 
index 1d02e2e..56b8523 100644 (file)
@@ -1348,47 +1348,49 @@ extern struct lpc_ct32b lpc_ct32b0, lpc_ct32b1;
 #define LPC_CT32B_EMR_EMC_TOGGLE       3
 
 #define isr_decl(name) \
-       void __attribute__ ((weak)) lpc_ ## name ## _isr(void);
-
-isr_decl(nmi)
-isr_decl(hardfault)
-isr_decl(memmanage)
-isr_decl(busfault)
-isr_decl(usagefault)
-isr_decl(svc)
-isr_decl(debugmon)
-isr_decl(pendsv)
-isr_decl(systick)
-
-isr_decl(pin_int0)     /* IRQ0 */
-isr_decl(pin_int1)
-isr_decl(pin_int2)
-isr_decl(pin_int3)
-isr_decl(pin_int4)     /* IRQ4 */
-isr_decl(pin_int5)
-isr_decl(pin_int6)
-isr_decl(pin_int7)
-
-isr_decl(gint0)        /* IRQ8 */
-isr_decl(gint1)
-isr_decl(ssp1)
-isr_decl(i2c)
-
-isr_decl(ct16b0)       /* IRQ16 */
-isr_decl(ct16b1)
-isr_decl(ct32b0)
-isr_decl(ct32b1)
-isr_decl(ssp0) /* IRQ20 */
-isr_decl(usart)
-isr_decl(usb_irq)
-isr_decl(usb_fiq)
-
-isr_decl(adc)  /* IRQ24 */
-isr_decl(wwdt)
-isr_decl(bod)
-isr_decl(flash)
-
-isr_decl(usb_wakeup)
-
+       void lpc_ ## name ## _isr(void)
+
+isr_decl(halt);
+isr_decl(ignore);
+
+isr_decl(nmi);
+isr_decl(hardfault);
+isr_decl(memmanage);
+isr_decl(busfault);
+isr_decl(usagefault);
+isr_decl(svc);
+isr_decl(debugmon);
+isr_decl(pendsv);
+isr_decl(systick);
+
+isr_decl(pin_int0);    /* IRQ0 */
+isr_decl(pin_int1);
+isr_decl(pin_int2);
+isr_decl(pin_int3);
+isr_decl(pin_int4);    /* IRQ4 */
+isr_decl(pin_int5);
+isr_decl(pin_int6);
+isr_decl(pin_int7);
+
+isr_decl(gint0);       /* IRQ8 */
+isr_decl(gint1);
+isr_decl(ssp1);
+isr_decl(i2c);
+
+isr_decl(ct16b0);      /* IRQ16 */
+isr_decl(ct16b1);
+isr_decl(ct32b0);
+isr_decl(ct32b1);
+isr_decl(ssp0);        /* IRQ20 */
+isr_decl(usart);
+isr_decl(usb_irq);
+isr_decl(usb_fiq);
+
+isr_decl(adc); /* IRQ24 */
+isr_decl(wwdt);
+isr_decl(bod);
+isr_decl(flash);
+
+isr_decl(usb_wakeup);
 
 #endif /* _LPC_H_ */
index a98d799..d8be366 100644 (file)
@@ -29,12 +29,12 @@ extern char __bss_start__, __bss_end__;
 
 /* Interrupt functions */
 
-static void stm_halt_isr(void)
+void stm_halt_isr(void)
 {
        ao_panic(AO_PANIC_CRASH);
 }
 
-static void stm_ignore_isr(void)
+void stm_ignore_isr(void)
 {
 }
 
index 6c459cf..7195598 100644 (file)
@@ -1103,64 +1103,67 @@ extern struct stm_mpu stm_mpu;
 #define  STM_MPU_RASR_SIZE_MASK                0x1f
 #define STM_MPU_RASR_ENABLE    0
 
-#define isr(name) void stm_ ## name ## _isr(void);
-
-isr(nmi)
-isr(hardfault)
-isr(memmanage)
-isr(busfault)
-isr(usagefault)
-isr(svc)
-isr(debugmon)
-isr(pendsv)
-isr(systick)
-isr(wwdg)
-isr(pvd)
-isr(tamper_stamp)
-isr(rtc_wkup)
-isr(flash)
-isr(rcc)
-isr(exti0)
-isr(exti1)
-isr(exti2)
-isr(exti3)
-isr(exti4)
-isr(dma1_channel1)
-isr(dma1_channel2)
-isr(dma1_channel3)
-isr(dma1_channel4)
-isr(dma1_channel5)
-isr(dma1_channel6)
-isr(dma1_channel7)
-isr(adc1)
-isr(usb_hp)
-isr(usb_lp)
-isr(dac)
-isr(comp)
-isr(exti9_5)
-isr(lcd)
-isr(tim9)
-isr(tim10)
-isr(tim11)
-isr(tim2)
-isr(tim3)
-isr(tim4)
-isr(i2c1_ev)
-isr(i2c1_er)
-isr(i2c2_ev)
-isr(i2c2_er)
-isr(spi1)
-isr(spi2)
-isr(usart1)
-isr(usart2)
-isr(usart3)
-isr(exti15_10)
-isr(rtc_alarm)
-isr(usb_fs_wkup)
-isr(tim6)
-isr(tim7)
-
-#undef isr
+#define isr_decl(name) void stm_ ## name ## _isr(void)
+
+isr_decl(halt);
+isr_decl(ignore);
+
+isr_decl(nmi);
+isr_decl(hardfault);
+isr_decl(memmanage);
+isr_decl(busfault);
+isr_decl(usagefault);
+isr_decl(svc);
+isr_decl(debugmon);
+isr_decl(pendsv);
+isr_decl(systick);
+isr_decl(wwdg);
+isr_decl(pvd);
+isr_decl(tamper_stamp);
+isr_decl(rtc_wkup);
+isr_decl(flash);
+isr_decl(rcc);
+isr_decl(exti0);
+isr_decl(exti1);
+isr_decl(exti2);
+isr_decl(exti3);
+isr_decl(exti4);
+isr_decl(dma1_channel1);
+isr_decl(dma1_channel2);
+isr_decl(dma1_channel3);
+isr_decl(dma1_channel4);
+isr_decl(dma1_channel5);
+isr_decl(dma1_channel6);
+isr_decl(dma1_channel7);
+isr_decl(adc1);
+isr_decl(usb_hp);
+isr_decl(usb_lp);
+isr_decl(dac);
+isr_decl(comp);
+isr_decl(exti9_5);
+isr_decl(lcd);
+isr_decl(tim9);
+isr_decl(tim10);
+isr_decl(tim11);
+isr_decl(tim2);
+isr_decl(tim3);
+isr_decl(tim4);
+isr_decl(i2c1_ev);
+isr_decl(i2c1_er);
+isr_decl(i2c2_ev);
+isr_decl(i2c2_er);
+isr_decl(spi1);
+isr_decl(spi2);
+isr_decl(usart1);
+isr_decl(usart2);
+isr_decl(usart3);
+isr_decl(exti15_10);
+isr_decl(rtc_alarm);
+isr_decl(usb_fs_wkup);
+isr_decl(tim6);
+isr_decl(tim7);
+
+#undef isr_decl
 
 #define STM_ISR_WWDG_POS               0
 #define STM_ISR_PVD_POS                        1
@@ -2045,62 +2048,4 @@ struct stm_exti {
 
 extern struct stm_exti stm_exti;
 
-#define isr_decl(name) \
-       void __attribute__ ((weak)) stm_ ## name ## _isr(void);
-
-isr_decl(nmi)
-isr_decl(hardfault)
-isr_decl(memmanage)
-isr_decl(busfault)
-isr_decl(usagefault)
-isr_decl(svc)
-isr_decl(debugmon)
-isr_decl(pendsv)
-isr_decl(systick)
-isr_decl(wwdg)
-isr_decl(pvd)
-isr_decl(tamper_stamp)
-isr_decl(rtc_wkup)
-isr_decl(flash)
-isr_decl(rcc)
-isr_decl(exti0)
-isr_decl(exti1)
-isr_decl(exti2)
-isr_decl(exti3)
-isr_decl(exti4)
-isr_decl(dma1_channel1)
-isr_decl(dma1_channel2)
-isr_decl(dma1_channel3)
-isr_decl(dma1_channel4)
-isr_decl(dma1_channel5)
-isr_decl(dma1_channel6)
-isr_decl(dma1_channel7)
-isr_decl(adc1)
-isr_decl(usb_hp)
-isr_decl(usb_lp)
-isr_decl(dac)
-isr_decl(comp)
-isr_decl(exti9_5)
-isr_decl(lcd)
-isr_decl(tim9)
-isr_decl(tim10)
-isr_decl(tim11)
-isr_decl(tim2)
-isr_decl(tim3)
-isr_decl(tim4)
-isr_decl(i2c1_ev)
-isr_decl(i2c1_er)
-isr_decl(i2c2_ev)
-isr_decl(i2c2_er)
-isr_decl(spi1)
-isr_decl(spi2)
-isr_decl(usart1)
-isr_decl(usart2)
-isr_decl(usart3)
-isr_decl(exti15_10)
-isr_decl(rtc_alarm)
-isr_decl(usb_fs_wkup)
-isr_decl(tim6)
-isr_decl(tim7)
-
 #endif /* _STM32L_H_ */
index ab835ba..0025de4 100644 (file)
@@ -43,12 +43,12 @@ extern char __interrupt_rom__, __interrupt_start__, __interrupt_end__;
 
 /* Interrupt functions */
 
-static void stm_halt_isr(void)
+void stm_halt_isr(void)
 {
        ao_panic(AO_PANIC_CRASH);
 }
 
-static void stm_ignore_isr(void)
+void stm_ignore_isr(void)
 {
 }
 
@@ -145,6 +145,9 @@ isr(usart3_4_5_6_7_8)
 isr(cec_can)
 isr(usb)
 
+#undef isr
+#undef isr_halt
+
 #define i(addr,name)   [(addr)/4] = stm_ ## name ## _isr
 
 __attribute__ ((section(".interrupt")))
index a2a58ce..fb81596 100644 (file)
@@ -753,65 +753,6 @@ extern struct stm_scb stm_scb;
 #define STM_SCB_AIRCR_VECTCLRACTIVE    1
 #define STM_SCB_AIRCR_VECTRESET                0
 
-#define isr(name) void stm_ ## name ## _isr(void);
-
-isr(nmi)
-isr(hardfault)
-isr(memmanage)
-isr(busfault)
-isr(usagefault)
-isr(svc)
-isr(debugmon)
-isr(pendsv)
-isr(systick)
-isr(wwdg)
-isr(pvd)
-isr(tamper_stamp)
-isr(rtc_wkup)
-isr(flash)
-isr(rcc)
-isr(exti0)
-isr(exti1)
-isr(exti2)
-isr(exti3)
-isr(exti4)
-isr(dma1_channel1)
-isr(dma1_channel2)
-isr(dma1_channel3)
-isr(dma1_channel4)
-isr(dma1_channel5)
-isr(dma1_channel6)
-isr(dma1_channel7)
-isr(adc1)
-isr(usb_hp)
-isr(usb_lp)
-isr(dac)
-isr(comp)
-isr(exti9_5)
-isr(lcd)
-isr(tim9)
-isr(tim10)
-isr(tim11)
-isr(tim2)
-isr(tim3)
-isr(tim4)
-isr(i2c1_ev)
-isr(i2c1_er)
-isr(i2c2_ev)
-isr(i2c2_er)
-isr(spi1)
-isr(spi2)
-isr(usart1)
-isr(usart2)
-isr(usart3)
-isr(exti15_10)
-isr(rtc_alarm)
-isr(usb_fs_wkup)
-isr(tim6)
-isr(tim7)
-
-#undef isr
-
 #define STM_ISR_WWDG_POS               0
 #define STM_ISR_PVD_VDDIO2_POS         1
 #define STM_ISR_RTC_POS                        2
@@ -2145,48 +2086,50 @@ extern struct stm_usart stm_usart1;
 extern struct stm_usart stm_usart2;
 
 #define isr_decl(name) \
-       void __attribute__ ((weak)) stm_ ## name ## _isr(void);
-
-isr_decl(nmi)
-isr_decl(hardfault)
-isr_decl(memmanage)
-isr_decl(busfault)
-isr_decl(usagefault)
-isr_decl(svc)
-isr_decl(debugmon)
-isr_decl(pendsv)
-isr_decl(systick)
-isr_decl(wwdg)
-isr_decl(pvd)
-isr_decl(rtc)
-isr_decl(flash)
-isr_decl(rcc_crs)
-isr_decl(exti0_1)
-isr_decl(exti2_3)
-isr_decl(exti4_15)
-isr_decl(tsc)
-isr_decl(dma_ch1)
-isr_decl(dma_ch2_3)
-isr_decl(dma_ch4_5_6)
-isr_decl(adc_comp)
-isr_decl(tim1_brk_up_trg_com)
-isr_decl(tim1_cc)
-isr_decl(tim2)
-isr_decl(tim3)
-isr_decl(tim6_dac)
-isr_decl(tim7)
-isr_decl(tim14)
-isr_decl(tim15)
-isr_decl(tim16)
-isr_decl(tim17)
-isr_decl(i2c1)
-isr_decl(i2c2)
-isr_decl(spi1)
-isr_decl(spi2)
-isr_decl(usart1)
-isr_decl(usart2)
-isr_decl(usart3_4_5_6_7_8)
-isr_decl(cec_can)
-isr_decl(usb)
+       void stm_ ## name ## _isr(void)
+
+isr_decl(halt);
+isr_decl(ignore);
+isr_decl(nmi);
+isr_decl(hardfault);
+isr_decl(memmanage);
+isr_decl(busfault);
+isr_decl(usagefault);
+isr_decl(svc);
+isr_decl(debugmon);
+isr_decl(pendsv);
+isr_decl(systick);
+isr_decl(wwdg);
+isr_decl(pvd);
+isr_decl(rtc);
+isr_decl(flash);
+isr_decl(rcc_crs);
+isr_decl(exti0_1);
+isr_decl(exti2_3);
+isr_decl(exti4_15);
+isr_decl(tsc);
+isr_decl(dma_ch1);
+isr_decl(dma_ch2_3);
+isr_decl(dma_ch4_5_6);
+isr_decl(adc_comp);
+isr_decl(tim1_brk_up_trg_com);
+isr_decl(tim1_cc);
+isr_decl(tim2);
+isr_decl(tim3);
+isr_decl(tim6_dac);
+isr_decl(tim7);
+isr_decl(tim14);
+isr_decl(tim15);
+isr_decl(tim16);
+isr_decl(tim17);
+isr_decl(i2c1);
+isr_decl(i2c2);
+isr_decl(spi1);
+isr_decl(spi2);
+isr_decl(usart1);
+isr_decl(usart2);
+isr_decl(usart3_4_5_6_7_8);
+isr_decl(cec_can);
+isr_decl(usb);
 
 #endif /* _STM32F0_H_ */