This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Z-StackLighting1.0.2中各channel的pwm设置函数是不是有bug?

Other Parts Discussed in Thread: CC2530, Z-STACK

Z-StackLighting1.0.2,在修改调光设置时,碰到问题,查看了代码,下面这个函数似乎有bug.

void halTimer1SetChannelCount (uint8 channel, uint16 count)
{
  uint8 high, low;
  high = (uint8) (count >> 8);
  low = (uint8) count;
  *(halTimer1Channel[0].TxCCH + 2*channel) = high;
  *(halTimer1Channel[0].TxCCL + 2*channel) = low;
}

比如设置channel 0,它是先设置T1CC0H,再设置T1CC0L的,而CC2530的手册是这样写的:

先设置T1CC0L,把值缓存到buffer,再设置T1CC0H,然后整个T1CC0才真的写入。

所以觉得Z-Stack里面的设置方法好像有问题。

如果说错了还望轻拍……