/*
* main.c
*/
#include <msp430f5529.h>
void TAPwmSetPeriod (unsigned int Period);
void TAPwmSetDuty(unsigned int Duty);
void main(void)
{
WDTCTL = WDTPW + WDTHOLD;
P2DIR |= BIT0;
P2SEL |= BIT0;
//TA1CCTL2 = OUTMOD_7;
TA1CCTL1 = OUTMOD_7;
TA1CTL = TASSEL_1 + MC_1 + TACLR;
TAPwmSetPeriod (500); //通道1/2的PWM 方波周期均设为500个时钟周期
TAPwmSetDuty (200); //D[1]中的值作为占空比输出
__bis_SR_register(LPM3_bits); // Enter LPM3
__no_operation(); // For debugger
}
//增计数模式确定输的PWM周期
voidTAPwmSetPeriod (unsigned int Period)
{
TA1CCR0 = Period;
}
//占空比函数
voidTAPwmSetDuty(unsigned int Duty)
{
TA1CCR1=Duty;
}
程序如上,总有错误‘error #10010: errors encountered during linking; "PWMout.out" not built’
我是新手,怎么解决这个错误呢
peng zhang13:
回复 Susan Yang:
,的确是编译没通过,问题找到了,后面子函数void和函数名分开编译就好了