[En-Nut-Discussion] Cortex ih_xxx_interuptY code duplication, continued

Uwe Bonnes bon at elektron.ikp.physik.tu-darmstadt.de
Thu Jul 19 14:14:42 CEST 2012


>>>>> "Ole" == Ole Reinhardt <ole.reinhardt at embedded-it.de> writes:

    Ole> Hi Uwe,
    >> if we accept the additional redirection for a common IrqCtl()
    >> function, placement of IQR_HANDLER could be eased with a macro like

    Ole> But using this macro would result in duplicate code (flash space)
    Ole> again, wouldn't it?

I don't think so. There is no difference between explict code and macro
generated code. Only if the main programm links to the code, the code is
actual included. 
  
    Ole> What about my idea to use the totally same code for all IRQs by
    Ole> changing the API a little and pass the sig_xxx struct to IrqCtl and
    Ole> to the signal handler as well (which could then read the users
    Ole> argument from the struct).

    Ole> Unfortunately my approach would need changes in the NutRegisterIrq
    Ole> as well. So we would have to adjust all platforms accordingly.

STM32 has some shared interrupts, where I don't have any idea yet how make
it to work with NutRegisterIrqHandler(). These IRQ are no "basic" ones, like
USART, so probably I can live with STM32 specific registration code, or
could even use the IRQs directly. But a generalized solution would be
fine. Maybe you approach could help for that too. On the short run the
fastest approach is if the Cortex people (you and me) decide for the macro .

Bye
-- 
Uwe Bonnes                bon at elektron.ikp.physik.tu-darmstadt.de

Institut fuer Kernphysik  Schlossgartenstrasse 9  64289 Darmstadt
--------- Tel. 06151 162516 -------- Fax. 06151 164321 ----------



More information about the En-Nut-Discussion mailing list