//----------------------------------------------------------------------------
///
///   Just create file for linker mapping IRQ function names to real
///   implementation functions.
///
//----------------------------------------------------------------------------


#define link_irq_symbol(a)    a##_IRQHandler = a##_IRQHandler_imp

#define link_irq_symbol3(a)    a = a##_imp
#define link_irq_symbol2(a)    link_irq_symbol3(a)

#define link_raw_symbol(a)    a = a##a2


#include "arena/config_defines.h"

#ifdef USE_CAN0
   link_irq_symbol( CAN0 );
#endif

#ifdef ARENA_USE_UART
   #ifdef ARENA_UART_0
      link_irq_symbol2( ARENA_UART_0_IRQ );
   #endif
   #ifdef ARENA_UART_1
      link_irq_symbol2( ARENA_UART_1_IRQ );
   #endif
#endif

#ifdef ARENA_USE_GPIO_0_EXTI
    causedby_ARENA_USE_GPIO_0_EXTI = 1;
    link_irq_symbol2( ARENA_GPIO_0_EXTI_IRQ );
#endif

#ifdef ARENA_USE_GPIO_1_EXTI
    causedby_ARENA_USE_GPIO_1_EXTI = 1;
    link_irq_symbol2( ARENA_GPIO_1_EXTI_IRQ );
#endif

#ifdef ARENA_USE_GPIO_2_EXTI
    causedby_ARENA_USE_GPIO_2_EXTI = 1;
    link_irq_symbol2( ARENA_GPIO_2_EXTI_IRQ );
#endif

#ifdef ARENA_USE_GPIO_3_EXTI
    causedby_ARENA_USE_GPIO_3_EXTI = 1;
    link_irq_symbol2( ARENA_GPIO_3_EXTI_IRQ );
#endif

#ifdef ARENA_USE_GPIO_4_EXTI
    causedby_ARENA_USE_GPIO_4_EXTI = 1;
    link_irq_symbol2( ARENA_GPIO_4_EXTI_IRQ );
#endif

#ifdef ARENA_USE_GPIO_5_EXTI
    causedby_ARENA_USE_GPIO_5_EXTI = 1;
    link_irq_symbol2( ARENA_GPIO_5_EXTI_IRQ );
#endif

#ifdef ARENA_USE_GPIO_6_EXTI
    causedby_ARENA_USE_GPIO_6_EXTI = 1;
    link_irq_symbol2( ARENA_GPIO_6_EXTI_IRQ );
#endif

#ifdef ARENA_USE_BUTTON_0_EXTI
    causedby_ARENA_USE_BUTTON_0_EXTI = 1;
    link_irq_symbol2( ARENA_BUTTON_0_EXTI_IRQ );
#endif

#ifdef ARENA_USE_BUTTON_1_EXTI
    causedby_ARENA_USE_BUTTON_1_EXTI = 1;
    link_irq_symbol2( ARENA_BUTTON_1_EXTI_IRQ );
#endif

#ifdef ARENA_USE_TIMER
   link_irq_symbol( TIM3 );
#endif

#if defined ( ARENA_USE_TIMER ) && defined ( ARENA_USE_DAC )
   link_irq_symbol( TIM6_DAC1  );
#endif

#ifdef ARENA_USE_DMA
   link_irq_symbol( DMA1_Channel1 );
   link_irq_symbol( DMA1_Channel2 );
   link_irq_symbol( DMA1_Channel3 );
   link_irq_symbol( DMA1_Channel4 );
#endif

#ifdef ARENA_USE_PWM
   link_irq_symbol( TIM2 );
#endif

// Bug in GCC ? backward-mapping syscalls
_fstat = _fstat;
_open = _open;


//---fin----------------------------------------------------------------------
