那么、我将尝试在 MSP430FR2533上创建 PWM。 我的代码如下。 当我尝试编译代码时、 会 显示标识符"TB0CCR1"未定义"和标识符"TB0CCR2"未定义"错误。 已在线查看示例、但未看到任何内容。 已检查数据表、TB0CCR1和2是有效的寄存器名称。 我不知道发生了什么。 如果有任何帮助,将不胜感激。
静态空 PWM1 (uint16_t PWMValue)
{
IF (PWMValue > MaxPWM)
{
PWMValue = MaxPWM;
}
TB0CCR1 = PWMValue;
}静态空 PWM2 (uint16_t PWMValue)
{
IF (PWMValue > MaxPWM)
{
PWMValue = MaxPWM;
}
TB0CCR2 = PWMValue;
}