⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ext_irq.c

📁 一、开发环境 1、开发板: AT91SAM7X256-EK 2、仿真器: SAM-ICE(ATMEL) 3、开发软件: ADS1.2 (ARM调试模式) 二、程序功能 1、程序目的:AT
💻 C
字号:
//*----------------------------------------------------------------------------
//* 文件名  : 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 + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -