本人刚开始玩arm,在8962 中调一个蜂鸣器小程序! 问题倒不少,希望大家帮忙解决…… #include "hw_memmap.h" #include "hw_types.h" #include "gpio.h" #include "sysctl.h" #include "ssi.h" #include "systick.h" #include "hw_ints.h" #include "cpu.h" #include "interrupt.h"
#define BEEP GPIO_PIN_7
void delay(int d) { for( ; d; --d); }
int main(void) { unsigned long i; SysCtlClockSet(SYSCTL_SYSDIV_1 | SYSCTL_USE_OSC | SYSCTL_OSC_MAIN | SYSCTL_XTAL_6MHZ);
SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOA);
GPIOPadConfigSet(GPIO_PORTA_BASE, BEEP, GPIO_STRENGTH_2MA, GPIO_PIN_TYPE_STD);
GPIODirModeSet(GPIO_PORTA_BASE, BEEP, GPIO_DIR_MODE_OUT); for(i=1;i<10;i++) { GPIOPinWrite(GPIO_PORTA_BASE, BEEP, ~BEEP); delay(500000); GPIOPinWrite(GPIO_PORTA_BASE, BEEP,BEEP); delay(500000); } }
这个错误是 Warning[Pe069]: integer conversion resulted in truncation C:Documents and SettingsAdministrator桌面工程模板main.c 33 Warning[Pe001]: last line of file ends without a newline C:Documents and SettingsAdministrator桌面工程模板main.c 38 Warning[Pe111]: statement is unreachable C:Documents and SettingsAdministrator桌面工程模板main.c 78
有时还会蹦出这个,然后iar就自动退出
这怎么调这么个小程序都那么难啊^^^^!
|