unresolved symbol FPUEnable, first referenced in ./main.obj CH2_1 C/C++ Problem
unresolved symbol FPULazyStackingEnable, first referenced in ./main.obj CH2_1 C/C++ Problem
这是什么情况啊 ??? 请大神指教!!!
#include <stdint.h>
#include <stdbool.h>
#include "inc/hw_memmap.h"
#include "inc/hw_types.h"
#include "driverlib/sysctl.h"
#include "driverlib/rom.h"
#include "driverlib/gpio.h"
#include "driverlib/pwm.h"
#include "driverlib/fpu.h"
#include "driverlib/pin_map.h"
#include <inc\tm4c123gh6pm.h>
int main (void)
{
//使能
FPU FPUEnable();
FPULazyStackingEnable();
//设置系统时钟为50MHz
SysCtlClockSet(SYSCTL_SYSDIV_4 |SYSCTL_USE_PLL |SYSCTL_OSC_MAIN |SYSCTL_XTAL_16MHZ);
//使能PWM模块
ROM_SysCtlPeripheralEnable((SYSCTL_PERIPH_PWM0)||(SYSCTL_PERIPH_PWM1));
//使能PWM2和PWM3输出所在GPIO
ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOH);
//配置PH0/PH1为PWM功能
ROM_GPIOPinTypePWM(GPIO_PORTH_BASE, GPIO_PIN_0);
ROM_GPIOPinTypePWM(GPIO_PORTH_BASE, GPIO_PIN_1);
// PWM时钟配置:不分频
ROM_SysCtlPWMClockSet(SYSCTL_PWMDIV_1);
//配置PWM发生器1:加减计数
ROM_PWMGenConfigure(PWM_BASE,
PWM_GEN_0,PWM_GEN_MODE_UP_DOWN | PWM_GEN_MODE_NO_SYNC);
//设置PWM发生器1的周期
ROM_PWMGenPeriodSet(PWM_BASE, PWM_GEN_0, 6000);
//设置PWM2/PWM3输出的脉冲宽度
ROM_PWMPulseWidthSet(PWM_BASE, PWM_OUT_0, 4200);
ROM_PWMPulseWidthSet(PWM_BASE, PWM_OUT_1, 1800);
//使能PWM2和PWM3的输出
ROM_PWMOutputState(PWM_BASE, (PWM_OUT_0_BIT |
PWM_OUT_1_BIT), true);
//使能PWM发生器1
ROM_PWMGenEnable(PWM0_BASE, PWM_GEN_0);
while(1); { }
}
这个PWM 程序有什么问题啊??
xyz549040622:
FPU FPUEnable();
FPULazyStackingEnable();
这两句使能了没有用到吧,把这两句屏蔽掉
Jianglong Jiang:
回复 xyz549040622:
屏蔽以后还是有错!!而且错误时两个pwm的语句!!
不理解发生了什么!!
谢谢!!
Jianglong Jiang:
回复 Michael Sun:
谢谢!!改了过后是这样的!!!