ext_irq.c
来自「ATMEL AT91RM9200开发板配套光盘上的全部示例程序」· C语言 代码 · 共 65 行
C
65 行
//*----------------------------------------------------------------------------
//* ATMEL Microcontroller Software Support - ROUSSET -
//*----------------------------------------------------------------------------
//* The software is delivered "AS IS" without warranty or condition of any
//* kind, either express, implied or statutory. This includes without
//* limitation any warranty or condition with respect to merchantability or
//* fitness for any particular purpose, or against the infringements of
//* intellectual property rights of others.
//*----------------------------------------------------------------------------
//* File Name : ext_irq.c
//* Object : External interrupt handler for irq
//* : Use LED5 & LED6 for status interrupt
//* 1.0 18/11/02 JPP : Creation
//*----------------------------------------------------------------------------
// Include Standart LIB files
#include "include/AT91M55800A.h"
#include "include/lib_AT91M55800A.h"
#include "eb55.h"
int status_irq = 0 ;
//*----------------------------------------------------------------------------
//* Function Name : at91_IRQ0_handler
//* Object : Irq Handler called by the IRQ0 interrupt with AT91
//* compatibility
//* Input Parameters : none
//* Output Parameters : none
//*----------------------------------------------------------------------------
void at91_IRQ0_handler(void)
{
if (status_irq == 0) status_irq = 1;
else status_irq = 0 ;
//* read the ouput state
//* read the ouput state
if ( (AT91F_PIO_GetInput(AT91C_BASE_PIOB) & LED6 ) == LED6 )
{
AT91F_PIO_ClearOutput( AT91C_BASE_PIOB, LED6 );
}
else
{
AT91F_PIO_SetOutput( AT91C_BASE_PIOB, LED6 );
}
//* while SW1 is push loop
while ( (AT91F_PIO_GetInput(AT91C_BASE_PIOB) & SW1_MASK ) != SW1_MASK );
}
//*----------------------------------------------------------------------------
//* Function Name : FIQ_init_handler
//* Object : Irq Handler called by the FIQ interrupt with AT91
//* compatibility
//* Input Parameters : none
//* Output Parameters : none
//* Functions called : at91_pio_read, at91_pio_write
//*----------------------------------------------------------------------------
void FIQ_init_handler(void)
{
AT91F_PIO_ClearOutput( AT91C_BASE_PIOB, LED4 );
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?