ext_irq.c

来自「一、开发环境 1、开发板: AT91SAM7X256-EK 2、仿真器: S」· C语言 代码 · 共 57 行

C
57
字号
//*----------------------------------------------------------------------------
//* 文件名  : ext_irq.c
//* 创建人  :张正锋 2006/2/21  zhangzf@baite-group.com
//*----------------------------------------------------------------------------

// Include Standard LIB  files
#include "project.h"

int status_irq = 0 ;

//*----------------------------------------------------------------------------
//* 函数名           : at91_IRQ0_handler
//* 功能             : Irq Handler called by the IRQ0 interrupt with AT91 compatibility
//* 输入参数         : none
//* 返回值           : none
//* 创建人           :张正锋 2006/2/21  zhangzf@baite-group.com
//*----------------------------------------------------------------------------
void at91_IRQ0_handler(void)
{
    if (status_irq == 0) status_irq = 1;
    else status_irq = 0 ;
    //* Read the output state
    if ( (AT91F_PIO_GetInput(AT91C_BASE_PIOA) & AT91B_LED1 ) == AT91B_LED1)
    {
        AT91F_PIO_ClearOutput( AT91C_BASE_PIOA, AT91B_LED1 );
    }
    else
    {
        AT91F_PIO_SetOutput( AT91C_BASE_PIOA, AT91B_LED1 );
    }
    //* while SW1 is push loop
    while ( (AT91F_PIO_GetInput(AT91C_BASE_PIOA) & AT91A_SW1 ) != AT91A_SW1);
}

//*----------------------------------------------------------------------------
//* 函数名          : FIQ_init_handler
//* 功能            : Irq Handler called by the FIQ interrupt with AT91  compatibility
//* 输入参数         : none
//* 返回值           : none
//* 创建人           :张正锋 2006/2/21  zhangzf@baite-group.com
///*----------------------------------------------------------------------------
 void FIQ_init_handler(void)
{

  // Read the output state
    if ( (AT91F_PIO_GetInput(AT91C_BASE_PIOA) & AT91B_LED2 ) == AT91B_LED2 )
    {
        AT91F_PIO_ClearOutput( AT91C_BASE_PIOA, AT91B_LED2 );
    }
    else
    {
        AT91F_PIO_SetOutput( AT91C_BASE_PIOA, AT91B_LED2 );
    }

}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?