尊敬的先生:
我们正在从 Stellaris LM3S9B96迁移到 TM4C129XCNZAD。
ROM.h 也进行了修改、因为文件下面缺少定义
#if defined (target_in_blizzard_RA1)||\
已定义(target_in_blizzard_RA3)||\
已定义(target_in_blizzard_RB1)||\
已定义(TARGET_IS _雪花_RA0)
#define ROM_GPIOPinIntEnable \
((void (*)(uint32_t ui32Port、\
uint8_t ui8引脚) rom_gpioTABLE[7])
#endif
#if defined (target_in_blizzard_RA1)||\
已定义(target_in_blizzard_RA3)||\
已定义(target_in_blizzard_RB1)||\
已定义(TARGET_IS _雪花_RA0)
#define ROM_GPIOPinIntDisable \
((void (*)(uint32_t ui32Port、\
uint8_t ui8引脚) rom_gpioTABLE[8])
#endif
#if defined (target_in_blizzard_RA1)||\
已定义(target_in_blizzard_RA3)||\
已定义(target_in_blizzard_RB1)||\
已定义(TARGET_IS _雪花_RA0)
#define ROM_GPIOPinIntStatus \
((long (*)(uint32_t ulPort、\
bool bMsed)) ROM_GPIOTABLE[9])
#endif
#if defined (target_in_blizzard_RA1)||\
已定义(target_in_blizzard_RA3)||\
已定义(target_in_blizzard_RB1)||\
已定义(TARGET_IS _雪花_RA0)
#define ROM_GPIOPinIntClear \
((void (*)(uint32_t ui32Port、\
uint8_t ui8引脚) rom_gpioTABLE[10])
#endif
我们将 引脚6配置为外部中断、但程序在执行"ROM_GPIOPinIntEnable (GPIO_PORTM_BASE、GPIO_PIN_6);"和 ROM_GPIOPinIntDisable 后卡住。
我在两 种不同的情况下使用了此命令、并得出结论、在启用程序卡滞和禁用它之后、它可以正常工作。
Stellaris LM3S9B96也是如此。 什么是问题?
以下是步骤
SysCtlPeripheralEnable (SYSCTL_Periph_GPIOM);//启用所用端口引脚的 GPIO 块。
ROM_GPIOPinTypeGPIOInput (GPIO_PORTM_BASE、GPIO_PIN_6);//外部中断引脚
ROM_IntMasterEnable();
ROM_GPIOIntTypeSet (GPIO_PORTM_BASE、GPIO_PIN_6、GPIO_FALLING_EDGE);//为引脚设置中断类型
ROM_GPIOPinIntEnable (GPIO_PORTM_BASE、GPIO_PIN_6);//启用单个引脚感应中断
ROM_IntEnable (INT_GPIOM);
完成任务后
ROM_GPIOPinIntDisable (GPIO_PORTM_BASE、GPIO_PIN_6);//禁用单个引脚感应中断
ROM_IntDisable (INT_GPIOM);