微波EDA网,见证研发工程师的成长!
首页 > 研发问答 > 无线和射频 > TI Zigbee设计交流 > Z-Stack Lighting 1.0.2 中PWM 的亮度为何 限定不能100%?

Z-Stack Lighting 1.0.2 中PWM 的亮度为何 限定不能100%?

时间:10-02 整理:3721RD 点击:

void halTimer1SetChannelDuty (uint8 channel, uint16 promill)
{
#define MIN_PROMILL 20
uint16 count;

if (promill < MIN_PROMILL)
promill = 0;

/* Load count = ((sec/tick) x clock) / prescale */
count = (uint16)( ((uint32)(Timer1MaxCount) * promill + 500)/ 1000 );
count = ( (count >= Timer1MaxCount) ? Timer1MaxCount-1 : (count == 0 ? 1 : count) );

halTimer1SetChannelCount(channel, count);
}

count 限定 Timer1MaxCount - 1 到 1之间。

请教下!

怎么没有人回答啊,工程师们,我现在也有同样的疑问,求解答!

Copyright © 2017-2020 微波EDA网 版权所有

网站地图

Top