2015年9月7日,在使用pwm时,调试发现stm32 v3.5的库有几个函数有问题。下载了stm32 v3.61的库,也是同样的问题,于是自己修改这个bug。
stm32库函数tim_ccxcmd()和tim_ccxncmd()错误修改: /** * @brief enables or disables the tim capture compare channel x. * @param timx: where x can be 1 to 17 except 6 and 7 to select the tim peripheral. * @param tim_channel: specifies the tim channel * this parameter can be one of the following values: * @arg tim_channel_1: tim channel 1 * @arg tim_channel_2: tim channel 2 * @arg tim_channel_3: tim channel 3 * @arg tim_channel_4: tim channel 4 * @param tim_ccx: specifies the tim channel ccxe bit new state. * this parameter can be: tim_ccx_enable or tim_ccx_disable. * @retval none */ void tim_ccxcmd(tim_typedef* timx, uint16_t tim_channel, uint16_t tim_ccx) { uint16_t tmp = 0; /* check the parameters */ assert_param(is_tim_list8_periph(timx)); assert_param(is_tim_channel(tim_channel)); assert_param(is_tim_ccx(tim_ccx)); tmp = ccer_cce_set << tim_channel; /* reset the ccxe bit */ timx->ccer &= (uint16_t)~ tmp; /* set or reset the ccxe bit */ //timx->ccer |= (uint16_t)(tim_ccx << tim_channel); //原来的库函数错误 //修改为: if(tim_ccx==enable) timx->ccer |= tmp; } /** * @brief enables or disables the tim capture compare channel xn. * @param timx: where x can be 1, 8, 15, 16 or 17 to select the tim peripheral. * @param tim_channel: specifies the tim channel * this parameter can be one of the following values: * @arg tim_channel_1: tim channel 1 * @arg tim_channel_2: tim channel 2 * @arg tim_channel_3: tim channel 3 * @param tim_ccxn: specifies the tim channel ccxne bit new state. * this parameter can be: tim_ccxn_enable or tim_ccxn_disable. * @retval none */ void tim_ccxncmd(tim_typedef* timx, uint16_t tim_channel, uint16_t tim_ccxn) { uint16_t tmp = 0; /* check the parameters */ assert_param(is_tim_list2_periph(timx)); assert_param(is_tim_complementary_channel(tim_channel)); assert_param(is_tim_ccxn(tim_ccxn)); tmp = ccer_ccne_set << tim_channel; /* reset the ccxne bit */ timx->ccer &= (uint16_t) ~tmp; /* set or reset the ccxne bit */ //timx->ccer |= (uint16_t)(tim_ccxn << tim_channel); //原来的库函数错误 //修改为: if(tim_ccxn==enable) timx->ccer |= tmp; }STM32库函数TIM_CCxCmd()和TIM_CCxNC
更新:2015-09-08 08:17 浏览:42次
- 供应商:
- 合肥市福来德电子科技有限公司
- 企业认证
- 所在地
- 肥东县店埠镇公园路
- 联系电话
- 0551-67755896
- 经理
- 韦秀章
- 手机号
- 18256903958
主要经营:无线GPRS远程数据传输,GSM & GPS汽车追踪器,里程计算及防盗设备,无线315/433MHz收发模块,无线抄表,感应器,电源,计算机软硬件,网络通讯,电子监控产品,防盗产品以及工业控制。
合肥市福来德电子科技有限公司成立于2014年11月7日,位于安徽省肥东县,是一家私营企业,员工人数5~10人。主要是研发和销售。经营范围:无线gprs远程数据传输、gsm & gps汽车追踪器、里程计算及防盗设备、无线315/433mhz收发模块、无线抄表、感应器、电源、计算机软硬件、网络通讯、电子监控产品、防盗产品以及工业控制产品的开发、销售;货物及技术出口(法律法规限制或禁止的项目除外)。
合肥市福来德电子科技有限公司
hefei fulaide electronics s ...
我们的其他新闻 更多新闻
- 电动车电源DCPS V1.02015-07-10 12:40
- GSM家庭防盗报警器2015-07-10 12:35
- GPS & GSM汽车防盗器2015-05-12 16:36
- 12V防盗报警器喇叭Alarm012015-04-02 11:37
- GPS有源天线2015-04-02 09:51
- Autocad立体图设计2015-02-17 11:44
- GPS & GSM 汽车防盗报警器2015-02-15 11:04
内容声明:顺企网为第三方交易平台及互联网信息服务提供者,顺企网所展示的信息内容系由合肥市福来德电子科技有限公司经营者发布,其真实性、准确性和合法性均由店铺经营者负责。顺企网提醒您购买前注意谨慎核实,如您对信息有任何疑问的,请在购买前通过电话与商家沟通确认顺企网存在海量企业商铺和供求信息,如您发现店铺内有任何违法/侵权信息,请立即向顺企网举报并提供有效线索。
相关tim_ccxcmdtim_ccxnc新闻