コード例 #1
0
ファイル: interrupt.c プロジェクト: XMC-CAN/UsbCanNode
/*
 * API to initialize the INTERRUPT APP
 */
INTERRUPT_STATUS_t INTERRUPT_Init(const INTERRUPT_t *const handler)
{
  XMC_ASSERT("INTERRUPT_Init:HandlePtr NULL", (handler != NULL));
  
#if(UC_FAMILY == XMC4)

  NVIC_SetPriority(handler->node,
                   NVIC_EncodePriority(NVIC_GetPriorityGrouping(),
                                       handler->priority,
                                       handler->subpriority));
  if (handler->enable_at_init == true)
  {
    INTERRUPT_Enable(handler);
  }
#endif

#if(UC_FAMILY == XMC1)
  NVIC_SetPriority(handler->node, handler->priority);
  
#if (UC_SERIES == XMC14)
  XMC_SCU_SetInterruptControl((uint8_t)handler->node, (XMC_SCU_IRQCTRL_t)((handler->node << 8) | handler->irqctrl));
#endif

  /* Enable the interrupt if enable_at_init is enabled */
  if (handler->enable_at_init == true)
  {
    INTERRUPT_Enable(handler);
  }
#endif

  return (INTERRUPT_STATUS_SUCCESS);
}
コード例 #2
0
/**
 *  \brief Function for enabling all Interrupt-Service-Routines
 *
 *  \details This function enables all Interrupt-Service-Routines
 */
void enableIRQ(void)
{
	INTERRUPT_Enable(&GeneralPurpose_Timer_ISR_Handle);
	NVIC_EnableIRQ(backgnd_rs_intr_handle.node_id); //Enables ADC Interrupt
	INTERRUPT_Enable(&Control_Timer_ISR_Handle);
    INTERRUPT_Enable(&Bluetooth_RX_ISR_Handle);
    INTERRUPT_Enable(&DPS310_Ext_Int_ISR_Handle);
	INTERRUPT_Enable(&RemoteControl_RX_ISR_Handle);
}