本帖最后由 727210614 于 2012-10-8 09:46 编辑
#include "iostm8s105c6.h"
#include "nokia_5110.h"
void Gpio_Init()
{ PA_DDR = 0xff;
PA_CR1 = 0xff;
PA_CR2 = 0;
PD_CR1 = 0;
PD_CR2 = 0xff; //使能EXIT
}
void Exit_Init()
{
EXTI_CR1 = 0x80; // PD口下降沿触发中断
}
int main( void )
{
Gpio_Init();
Exit_Init();
LCD_init(); LCD_clear();
LCD_write_english_string(0,0,"wait!"); while(1);
}
#pragma vector = 0x08
__interrupt void EXIT_PD()
{
LCD_write_english_string(1,2,"PUT DOWN!");
}以上是程序,将PD口作为中断口(PD_7除外),但不能进中断? |