/*
  ******************************************************************************
  * @file    acm32g103_it.c
  * @brief   acm32g103_it source File.
  ******************************************************************************
*/

#include "acm32g103_it.h"
#include "app.h"

extern CanTxRxMsg CAN_RxMessage;
volatile uint8_t gu8_CAN_ReceiveFlag=0;


void NMI_Handler(void)
{   
}


void HardFault_Handler(void)
{
    while (1)
    {
    }
}


void MemManage_Handler(void)
{
    while (1)
    {
    }
}


void BusFault_Handler(void)
{
    while (1)
    {
    }
}


void UsageFault_Handler(void)
{
    while (1)
    {
    }
}


void SVC_Handler(void)
{
}


void DebugMon_Handler(void)
{
}


void PendSV_Handler(void)
{
}

void EXTI15_10_IRQHandler(void)
{
    if (EXTI->PDR & BSP_PB_PIN)
    {
        EXTI->PDR = BSP_PB_PIN;
        //PB_IRQHandler();
    }
}

/******************************************************************************
*@brief : System tick handler
*@param : none
*@return: none
******************************************************************************/
void SysTick_Handler(void)
{
	SysTick_Inc();
}

void CAN_IRQHandler(void)
{
    if(CAN_GetITStatus(CANx, CAN_IER_RIE)) //RI
    {
        /* CAN ReceiveIT complete callback */ 
        CAN_GetRxMessage(CANx, &CAN_RxMessage);  
        gu8_CAN_ReceiveFlag=1;
    }
}




