TIM1_DeInit()
//设置死区时间10/16=0.6us
TIM1_BDTRConfig(TIM1_OSSISTATE_ENABLE,TIM1_LOCKLEVEL_OFF,10,TIM1_BREAK_DISABLE,
TIM1_BREAKPOLARITY_LOW,TIM1_AUTOMATICOUTPUT_DISABLE)
//设置PWM频率10K
TIM1_TimeBaseInit(0, TIM1_COUNTERMODE_UP, 100*16, 0) //100us 10K
//PWM极性设置相同,则输出为互补,否则为同步信号。
TIM1_OC1Init(TIM1_OCMODE_PWM1, TIM1_OUTPUTSTATE_DISABLE, TIM1_OUTPUTNSTATE_DISABLE,
PulseWidth, TIM1_OCPOLARITY_HIGH, TIM1_OCNPOLARITY_HIGH,
TIM1_OCIDLESTATE_RESET, TIM1_OCNIDLESTATE_RESET)
TIM1_OC2Init(TIM1_OCMODE_PWM1, TIM1_OUTPUTSTATE_DISABLE, TIM1_OUTPUTNSTATE_DISABLE,
PulseWidth, TIM1_OCPOLARITY_HIGH, TIM1_OCNPOLARITY_HIGH,
TIM1_OCIDLESTATE_RESET, TIM1_OCNIDLESTATE_RESET)
TIM1_OC3Init(TIM1_OCMODE_PWM1, TIM1_OUTPUTSTATE_DISABLE, TIM1_OUTPUTNSTATE_DISABLE,
PulseWidth, TIM1_OCPOLARITY_HIGH, TIM1_OCNPOLARITY_HIGH,
TIM1_OCIDLESTATE_RESET, TIM1_OCNIDLESTATE_RESET)
TIM1_ITConfig(TIM1_IT_UPDATE, ENABLE)
TIM1_ARRPreloadConfig(ENABLE)
TIM1_Cmd(ENABLE)
TIM1_CtrlPWMOutputs(ENABLE)
config指的是用来保存你的设置的一个文本,你设置完参数呀,鼠标速度呀,键盘哪些按键呀,都保存在config.cfg这个文件里,你下在再进入时CS就会自动读取config文件,你的设置就自己出来了,不用再调了,GUI需要网上下载或找别人做,config在CS文件夹/cstrike里面,如果CS1.6中文版的话就在CS文件夹/cstrike_chinese里面欢迎分享,转载请注明来源:内存溢出
评论列表(0条)