在线时间4 小时
UID354545
注册时间2012-4-22
NXP金币0
该用户从未签到
注册会员

- 积分
- 76
- 最后登录
- 1970-1-1
|

楼主 |
发表于 2015-1-28 09:35:32
|
显示全部楼层
// Standard C Included Files
#include <stdio.h>
// SDK Included Files
#include "board.h"
#include "fsl_hwtimer.h"
#include "fsl_interrupt_manager.h"
#include "fsl_gpio_driver.h"
#ifdef DEBUG
#include "fsl_debug_console.h"
#endif
///////////////////////////////////////////////////////////////////////////////
// Definitions
///////////////////////////////////////////////////////////////////////////////
// Variables
///////////////////////////////////////////////////////////////////////////////
/* gpio IRQ handler with the same name in startup code. */
void MYPORTA_IRQHandler(void)
{
/* Clear interrupt flag.*/
PORT_HAL_ClearPortIntFlag(PORTA_BASE);
if(GPIO_DRV_ReadPinInput(kGpioSW1)==1)
{
printf("High\r\n");
}
else
{
printf("Low\r\n");
}
}
/*!
* @brief Main function
*/
int main (void)
{
// Initialize standard SDK demo application pins
hardware_init();
// Call this function to initialize the console UART. This function
// enables the use of STDIO functions (printf, scanf, etc.)
dbg_uart_init();
INT_SYS_InstallHandler(PORTA_IRQn, MYPORTA_IRQHandler);
GPIO_DRV_Init(&switchPins, &ledPins);
while(1)
{
}
}
|
|