|
程序老是进步了中断函数,麻烦各位大侠给看一下啦。调了好几天。
[复制链接]
#include "hw_ints.h"
#include "hw_memmap.h"
#include "hw_types.h"
#include "gpio.h"
#include "sysctl.h"
#include "cpu.h"
#include "interrupt.h"
#include "systick.h"
#define LEDPERIPH SYSCTL_PERIPH_GPIOB
#define LEDPORT GPIO_PORTB_BASE
#define LED GPIO_PIN_5
int main()
{
SysCtlClockSet(SYSCTL_SYSDIV_1 | SYSCTL_USE_OSC | SYSCTL_OSC_MAIN | SYSCTL_XTAL_6MHZ);
SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOB);
GPIOPinTypeGPIOInput(LEDPORT,LED);
GPIOPadConfigSet(LEDPORT,LED,GPIO_STRENGTH_8MA,GPIO_PIN_TYPE_STD_WPU);
SysTickPeriodSet(6000);
SysTickIntEnable();
IntMasterEnable();
SysTickEnable();
for (;;)
{
}
}
void SysTick_ISR(void)
{
unsigned char ucVal;
ucVal = GPIOPinRead(LEDPORT, LED);
GPIOPinWrite(LEDPORT, LED, ~ucVal);
}
在startup.s中已修改向量表
EXTERN SysTick_ISR
DCD SysTick_ISR ; SysTick Handler
thank u~
|
|