bikelight.c 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585
  1. /**
  2. * @file Bikelight.c
  3. * @author
  4. * @brief light of ebike
  5. * @version 0.1
  6. * @date 2023-06-20
  7. *
  8. * @copyright Copyright (c) 2021
  9. *
  10. */
  11. #define BIKELIGHT_
  12. /************************************************************************
  13. Beginning of File, do not put anything above here except notes
  14. Compiler Directives:
  15. *************************************************************************/
  16. #include "syspar.h"
  17. #include "typedefine.h"
  18. #include "mathtool.h"
  19. #include "bikelight.h"
  20. #include "hwsetup.h"
  21. #include "power.h"
  22. #include "CodePara.h"
  23. #include "adc.h"
  24. #include "UserGpio_Config.h"
  25. #include "ti_msp_dl_config.h"
  26. #include "bikebrake.h"
  27. //----------------------------
  28. BIKELEDCHECK_STR BikeLedCheck_F;//前灯参数
  29. //BIKELEDCHECK_STR BikeLedCheck_B;//尾灯参数
  30. //BIKELEDCHECK_STR BikeLedCheck_L;//左灯参数
  31. //BIKELEDCHECK_STR BikeLedCheck_R;//右灯参数
  32. BIKELEDCHECK_STR BikeLedCheck_DC_1; //DC12V端口参数
  33. BIKELEDCHECK_STR BikeLedCheck_DC_2; //DC12V端口参数
  34. //LED_PWM_STR BikePwmChoice;
  35. void LED_EnableDeal(BIKELEDCHECK_STR *p,UWORD switchAction,LED_PWM_STR mode );
  36. void LedMode_One(BIKELEDCHECK_STR *BikeLedSel);//模式1 开灯低亮,刹车高亮
  37. void LedMode_Two(BIKELEDCHECK_STR *BikeLedSel);//模式2 开灯高亮,刹车闪烁
  38. void LedMode_Three(BIKELEDCHECK_STR *BikeLedSel);//模式3 刹车高亮
  39. void LedMode_Four(BIKELEDCHECK_STR *BikeLedSel);//模式4 刹车闪烁
  40. void LedMode_Five(BIKELEDCHECK_STR *BikeLedSel);//模式5 开机亮
  41. void LedMode_Six(BIKELEDCHECK_STR *BikeLedSel);//模式6 超速闪烁报警 国标车
  42. void LedMode_Seven(BIKELEDCHECK_STR *BikeLedSel);//模式7 开机低亮,刹车高亮
  43. void LedMode_Eight(BIKELEDCHECK_STR *BikeLedSel);//模式8 开灯亮,关灯灭
  44. // 函数指针类型定义
  45. typedef void (*FunctionPointer)(BIKELEDCHECK_STR *BikeLedSel);
  46. // 函数指针数组
  47. FunctionPointer ledfunctions[16] = {LedMode_One,LedMode_One, LedMode_Two, LedMode_Three, LedMode_Four,LedMode_Five,LedMode_Six,LedMode_Seven,LedMode_Eight,
  48. LedMode_Eight,LedMode_Eight,LedMode_Eight,LedMode_Eight,LedMode_Eight,LedMode_Eight,LedMode_Eight};
  49. /***************************************************************
  50. Function: LedMode_One
  51. Description: //模式1 开灯低亮,刹车高亮
  52. Call by: 1ms
  53. Input Variables:
  54. Output/Return Variables: N/A
  55. Subroutine Call: N/A;
  56. Reference: N/A
  57. ****************************************************************/
  58. void LedMode_One(BIKELEDCHECK_STR *BikeLedSel)
  59. {
  60. if((BikeBrake_blGetstate()==TRUE)&&(cp_stBikeRunInfoPara.uwLightSwitch==0))//尾灯低亮,刹车高亮
  61. {
  62. if(BikeLedSel->uwLeddelaycnt>0)
  63. {
  64. BikeLedSel->uwLeddelaycnt--;
  65. BikeLedSel->blBike_LedSta=FALSE;
  66. }
  67. else
  68. {
  69. BikeLedSel->blBike_LedSta=TRUE;
  70. }
  71. }
  72. else
  73. {
  74. if(cp_stBikeRunInfoPara.uwLightSwitch!=0)
  75. {
  76. BikeLedSel->uwLedAddcnt++;
  77. if(BikeLedSel->uwLedAddcnt > BikeLedAddCycle)
  78. {
  79. BikeLedSel->uwLedAddcnt=0;
  80. }
  81. if(BikeLedSel->uwLedAddcnt<BikeLedAddDuty)
  82. {
  83. BikeLedSel->blBike_LedSta=TRUE;
  84. if(BikeBrake_blGetstate()==TRUE)
  85. {
  86. BikeLedSel->uwLedAddcnt=0;
  87. }
  88. }
  89. else
  90. {
  91. BikeLedSel->blBike_LedSta=FALSE;
  92. }
  93. }
  94. else
  95. {
  96. BikeLedSel->blBike_LedSta=FALSE;
  97. BikeLedSel->uwLedAddcnt=0;
  98. }
  99. BikeLedSel->uwLeddelaycnt=10;
  100. }
  101. }
  102. /***************************************************************
  103. Function: LedMode_Two
  104. Description: //模式2 开灯高亮,刹车闪烁
  105. Call by: 1ms
  106. Input Variables:
  107. Output/Return Variables: N/A
  108. Subroutine Call: N/A;
  109. Reference: N/A
  110. ****************************************************************/
  111. void LedMode_Two(BIKELEDCHECK_STR *BikeLedSel)
  112. {
  113. if(BikeBrake_blGetstate()==TRUE) //尾灯高亮,刹车闪烁
  114. {
  115. BikeLedSel->uwLedAddcnt++;
  116. if(BikeLedSel->uwLedAddcnt > BikeLedFlickerCycle)
  117. {
  118. BikeLedSel->uwLedAddcnt=0;
  119. }
  120. if(BikeLedSel->uwLedAddcnt<BikeLedFlickerDuty)
  121. {
  122. BikeLedSel->blBike_LedSta=TRUE;
  123. }
  124. else
  125. {
  126. BikeLedSel->blBike_LedSta=FALSE;
  127. }
  128. }
  129. else
  130. {
  131. if(cp_stBikeRunInfoPara.uwLightSwitch!=0)
  132. {
  133. BikeLedSel->blBike_LedSta=TRUE;
  134. }
  135. else
  136. {
  137. BikeLedSel->blBike_LedSta=FALSE;
  138. }
  139. BikeLedSel->uwLedAddcnt=0;
  140. }
  141. }
  142. /***************************************************************
  143. Function: LedMode_Three
  144. Description: 模式3 刹车高亮
  145. Call by: 1ms
  146. Input Variables:
  147. Output/Return Variables: N/A
  148. Subroutine Call: N/A;
  149. Reference: N/A
  150. ****************************************************************/
  151. void LedMode_Three(BIKELEDCHECK_STR *BikeLedSel)
  152. {
  153. if(BikeBrake_blGetstate()==TRUE) //刹车高亮
  154. {
  155. //BikeLedSel->blBike_LedSta=TRUE;
  156. if(BikeLedSel->uwLeddelaycnt>0)
  157. {
  158. BikeLedSel->uwLeddelaycnt--;
  159. BikeLedSel->blBike_LedSta=FALSE;
  160. }
  161. else
  162. {
  163. BikeLedSel->blBike_LedSta=TRUE;
  164. }
  165. }
  166. else
  167. {
  168. BikeLedSel->uwLeddelaycnt=20;
  169. BikeLedSel->blBike_LedSta=FALSE;
  170. }
  171. }
  172. /***************************************************************
  173. Function: LedMode_Four
  174. Description: 模式4 刹车闪烁
  175. Call by: 1ms
  176. Input Variables:
  177. Output/Return Variables: N/A
  178. Subroutine Call: N/A;
  179. Reference: N/A
  180. ****************************************************************/
  181. void LedMode_Four(BIKELEDCHECK_STR *BikeLedSel)
  182. {
  183. if(BikeBrake_blGetstate()==TRUE) //刹车闪烁
  184. {
  185. BikeLedSel->uwLedAddcnt++;
  186. if(BikeLedSel->uwLedAddcnt > BikeLedFlickerCycle)
  187. {
  188. BikeLedSel->uwLedAddcnt=0;
  189. }
  190. if(BikeLedSel->uwLedAddcnt<BikeLedFlickerDuty)
  191. {
  192. BikeLedSel->blBike_LedSta=TRUE;
  193. }
  194. else
  195. {
  196. BikeLedSel->blBike_LedSta=FALSE;
  197. }
  198. }
  199. else
  200. {
  201. BikeLedSel->blBike_LedSta=FALSE;
  202. }
  203. }
  204. /***************************************************************
  205. Function: LedMode_Five
  206. Description: 模式5 开机亮
  207. Call by: 1ms
  208. Input Variables:
  209. Output/Return Variables: N/A
  210. Subroutine Call: N/A;
  211. Reference: N/A
  212. ****************************************************************/
  213. void LedMode_Five(BIKELEDCHECK_STR *BikeLedSel)
  214. {
  215. BikeLedSel->blBike_LedSta=TRUE; //开机常亮
  216. }
  217. /***************************************************************
  218. Function: LedMode_Six
  219. Description: 模式6 超速闪烁报警 国标车
  220. Call by: 1ms
  221. Input Variables:
  222. Output/Return Variables: N/A
  223. Subroutine Call: N/A;
  224. Reference: N/A
  225. ****************************************************************/
  226. void LedMode_Six (BIKELEDCHECK_STR *BikeLedSel)
  227. {
  228. if(cp_stBikeRunInfoPara.BikeSpeedKmH>=BikeLedOverSpeedMax) //超速报警
  229. {
  230. BikeLedSel->uwLedAddcnt++;
  231. if(BikeLedSel->uwLedAddcnt > BikeLedOverSpedCycle)
  232. {
  233. BikeLedSel->uwLedAddcnt=0;
  234. }
  235. if(BikeLedSel->uwLedAddcnt<BikeLedOverSpedDuty)
  236. {
  237. BikeLedSel->blBike_LedSta=TRUE;
  238. }
  239. else
  240. {
  241. BikeLedSel->blBike_LedSta=FALSE;
  242. }
  243. }
  244. else if(cp_stBikeRunInfoPara.BikeSpeedKmH<=BikeLedOverSpeedMin)
  245. {
  246. BikeLedSel->blBike_LedSta=FALSE;
  247. BikeLedSel->uwLedAddcnt=0;
  248. }
  249. }
  250. /***************************************************************
  251. Function: LedMode_Seven
  252. Description: 模式7 开机低亮,刹车高亮
  253. Call by: 1ms
  254. Input Variables:
  255. Output/Return Variables: N/A
  256. Subroutine Call: N/A;
  257. Reference: N/A
  258. ****************************************************************/
  259. void LedMode_Seven(BIKELEDCHECK_STR *BikeLedSel)
  260. {
  261. // if(BikeBrake_blGetstate()==TRUE)
  262. // {
  263. // BikeLedSel->blBike_LedSta=TRUE;
  264. // }
  265. // else
  266. // {
  267. // BikeLedSel->uwLedAddcnt++;
  268. // if(BikeLedSel->uwLedAddcnt > BikeLedAddCycle)
  269. // {
  270. // BikeLedSel->uwLedAddcnt=0;
  271. // }
  272. // if(BikeLedSel->uwLedAddcnt<BikeLedAddDuty)
  273. // {
  274. // BikeLedSel->blBike_LedSta=TRUE;
  275. // }
  276. // else
  277. // {
  278. // BikeLedSel->blBike_LedSta=FALSE;
  279. // }
  280. //
  281. // }
  282. BikeLedSel->uwLedAddcnt++;
  283. if(BikeLedSel->uwLedAddcnt > BikeLedAddCycle)
  284. {
  285. BikeLedSel->uwLedAddcnt=0;
  286. }
  287. if(BikeLedSel->uwLedAddcnt<BikeLedAddDuty)
  288. {
  289. BikeLedSel->blBike_LedSta=TRUE;
  290. if(BikeBrake_blGetstate()==TRUE)
  291. {
  292. BikeLedSel->uwLedAddcnt=0;
  293. }
  294. }
  295. else
  296. {
  297. BikeLedSel->blBike_LedSta=FALSE;
  298. }
  299. }
  300. /***************************************************************
  301. Function: LedMode_Eight
  302. Description: 模式8 开灯亮,关灯灭
  303. Call by: 1ms
  304. Input Variables:
  305. Output/Return Variables: N/A
  306. Subroutine Call: N/A;
  307. Reference: N/A
  308. ****************************************************************/
  309. void LedMode_Eight(BIKELEDCHECK_STR *BikeLedSel)
  310. {
  311. if (cp_stBikeRunInfoPara.uwLightSwitch == 1)//仪表开灯亮,仪表关灯灭
  312. {
  313. BikeLedSel->blBike_LedSta=TRUE;
  314. }
  315. else
  316. {
  317. BikeLedSel->blBike_LedSta=FALSE;
  318. }
  319. }
  320. /***************************************************************
  321. Function: bikelight_voBikeLightInit;
  322. Description: bike light control initialization
  323. Call by: FSM_voInit
  324. Input Variables: N/A
  325. Output/Return Variables: N/A
  326. Subroutine Call: N/A;
  327. Reference: N/A
  328. ****************************************************************/
  329. void bikelight_voBikeLightInit(BIKELEDCHECK_STR *LedPoit)
  330. {
  331. LedPoit->uwBike_LedOffErrCnt=0;
  332. LedPoit->uwBike_OpenPreTime=0;
  333. LedPoit->uwBike_OpenLedEn=0;
  334. LedPoit->uwBikeLight_PWM=0;
  335. LedPoit->uwBike_LedCheckLowTime=0;
  336. LedPoit->uwLedAddcnt=0;
  337. LedPoit->uwBike_keyLedLowSta=0;
  338. LedPoit->uwBike_keyLedHighSta=0;
  339. LedPoit->blBike_LedSta=FALSE;
  340. LedPoit->uwBikeLight_PWM=0;
  341. LedPoit->blBike_LedCurErr=0;
  342. }
  343. /***************************************************************
  344. Function: bikelight_voBikeLightCoef;
  345. Description: 滤波时间/阈值电压设定参数更新 ,参数输入端
  346. uwBike_LedMode:
  347. 0x01:模式1,连接尾灯,开灯时低亮,刹车时高亮
  348. 0x02:模式2,连接尾灯,开灯时高亮,刹车时闪烁
  349. 0x03:模式3,连接刹车灯,刹车时高亮
  350. 0x04:模式4,连接刹车灯,刹车时闪烁
  351. 0x05:模式5,开机常亮
  352. 0x06:模式6,连接蜂鸣器,超速报警
  353. 0x07:模式7,开机低亮,刹车高亮
  354. 0x08:模式8,仅开灯高亮,关灯灭
  355. uwBike_LedFun 模式功能选择
  356. 0-PWM电池电压有保护,
  357. 1-前后灯分别控PWM6/12V无保护,
  358. 2-DCDC输出
  359. Call by:初始化,接收数据更新
  360. Input Variables: N/A
  361. Output/Return Variables: N/A
  362. Subroutine Call: N/A;
  363. Reference: N/A
  364. ****************************************************************/
  365. void bikelight_voBikeLightCoef(UWORD volt)
  366. {
  367. //DC1灯参数
  368. BikeLedCheck_DC_1.uwBike_LedVolt =volt & 0x0f;//电压
  369. BikeLedCheck_DC_1.uwBike_LedMode=8; //模式
  370. //DC2灯参数
  371. BikeLedCheck_DC_2.uwBike_LedVolt =(volt & 0x0f00)>>8; //电压
  372. BikeLedCheck_DC_2.uwBike_LedMode = (volt & 0xf000)>>12;//模式
  373. BikeLedCheck_DC_2.uwBike_LedFun=2;
  374. //BAT灯模式
  375. BikeLedCheck_F.uwBike_LedMode=5;
  376. BikeLedCheck_F.uwBike_LedFun=0;
  377. //DC1灯电压设置
  378. if( BikeLedCheck_DC_1.uwBike_LedVolt == 12) //拉低短路
  379. {
  380. IO_LED1_6or12V_Choise_H(); //12V使能
  381. }
  382. else //高阻
  383. {
  384. IO_LED1_6or12V_Choise_L();//6V输出使能
  385. }
  386. //DC2灯电压设置
  387. if( BikeLedCheck_DC_2.uwBike_LedVolt == 12) //拉低短路
  388. {
  389. IO_LED2_6or12V_Choise_H(); //12V使能
  390. }
  391. else //高阻
  392. {
  393. IO_LED2_6or12V_Choise_L();//6V输出使能
  394. }
  395. }
  396. /***************************************************************
  397. Function: bikelight_voBikeLightControl;
  398. Description: bike light control initialization
  399. Call by: 1ms
  400. Input Variables: switchAction-开灯情况,Brate_Sta-刹车状态, uwBike_LedMode-尾灯模式
  401. Output/Return Variables: N/A
  402. Subroutine Call: N/A;
  403. Reference: N/A
  404. ****************************************************************/
  405. void bikelight_voBikeLightControl(UWORD switchAction, BOOL Brate_Sta )
  406. {
  407. if( power_stPowStateOut.blPowerStartupFlg == FALSE)
  408. {
  409. BikeLedCheck_F.blBike_LedSta=FALSE;
  410. DL_TimerG_setCaptureCompareValue(PWM_F_INST, 0, GPIO_PWM_F_C1_IDX);//max=2304
  411. }
  412. else
  413. {
  414. //DC1灯控制
  415. ledfunctions[BikeLedCheck_DC_1.uwBike_LedMode](&BikeLedCheck_DC_1);
  416. if( BikeLedCheck_DC_1.blBike_LedSta==TRUE)
  417. {
  418. IO_LED1_6or12V_EN_H();
  419. }
  420. else
  421. {
  422. IO_LED1_6or12V_EN_L();
  423. }
  424. //DC2灯控制
  425. ledfunctions[BikeLedCheck_DC_2.uwBike_LedMode](&BikeLedCheck_DC_2);
  426. if( BikeLedCheck_DC_2.blBike_LedSta==TRUE)
  427. {
  428. IO_LED2_6or12V_EN_H();
  429. }
  430. else
  431. {
  432. IO_LED2_6or12V_EN_L();
  433. }
  434. //BAT灯控制
  435. #if 1
  436. ledfunctions[BikeLedCheck_F.uwBike_LedMode](&BikeLedCheck_F);
  437. if (BikeLedCheck_F.blBike_LedSta == TRUE)
  438. {
  439. DL_TimerG_startCounter(PWM_F_INST);
  440. BikeLedCheck_F.uwBikeLight_PWM = 1500;
  441. DL_TimerG_setCaptureCompareValue(PWM_F_INST, BikeLedCheck_F.uwBikeLight_PWM, GPIO_PWM_F_C1_IDX);
  442. }
  443. else
  444. {
  445. BikeLedCheck_F.uwBikeLight_PWM = 0;
  446. DL_TimerG_setCaptureCompareValue(PWM_F_INST, BikeLedCheck_F.uwBikeLight_PWM, GPIO_PWM_F_C1_IDX);
  447. DL_TimerG_stopCounter(PWM_F_INST);
  448. }
  449. #elif(BIKELEDOPEN_F_ENABLE != 0)
  450. ledfunctions[BikeLedCheck_F.uwBike_LedMode](&BikeLedCheck_F);
  451. if (BikeLedCheck_F.blBike_LedSta == TRUE)
  452. {
  453. if(BikeLedCheck_F.uwBike_keyLedHighSta == 0)
  454. {
  455. BikeLedCheck_F.uwBike_keyLedHighSta = 1;
  456. BikeLedCheck_F.uwBike_OpenLedEn = 0; //开灯瞬间处理标志
  457. BikeLedCheck_F.uwBike_LedOffErrCnt = 0; //10秒一检测计时
  458. BikeLedCheck_F.uwBike_OpenPreTime = 0; //开灯瞬间5ms内处理计数
  459. BikeLedCheck_F.uwBike_LedCheckLowTime = 0; //检测过流IO出现低电平次数
  460. BikeLedCheck_F.blBike_ForwardLedStart = TRUE; //前灯允许开灯启动,总开关
  461. BikeLedCheck_F.blBike_LedCurErr = FALSE;
  462. DL_TimerG_startCounter(PWM_F_INST);
  463. }
  464. if((BikeLedCheck_F.uwBike_OpenLedEn == 0) &&(BikeLedCheck_F.blBike_ForwardLedStart == TRUE)) //开灯检测,过流后每隔10秒检测1次
  465. {
  466. LED_EnableDeal(&BikeLedCheck_F, 1 ,F_PWM_byte);
  467. }
  468. BikeLedCheck_F.uwBike_keyLedLowSta = 1;
  469. }
  470. else
  471. {
  472. BikeLedCheck_F.uwBike_keyLedHighSta = 0;
  473. if(BikeLedCheck_F.uwBike_keyLedLowSta != 0)
  474. {
  475. BikeLedCheck_F.uwBike_keyLedLowSta = 0;
  476. BikeLedCheck_F.uwBikeLight_PWM = 0;
  477. DL_TimerG_setCaptureCompareValue(PWM_F_INST, BikeLedCheck_F.uwBikeLight_PWM, GPIO_PWM_F_C1_IDX);//max=2304
  478. }
  479. }
  480. #endif
  481. //BAT灯检测
  482. if((BikeLedCheck_F.blBike_LedCurErr == TRUE ) && (BikeLedCheck_F.blBike_LedSta == TRUE)) //过流标志,前灯恢复检测
  483. {
  484. BikeLedCheck_F.uwBike_LedOffErrCnt++;
  485. if(BikeLedCheck_F.uwBike_LedOffErrCnt > 2000) //1000ms
  486. {
  487. BikeLedCheck_F.uwBike_keyLedHighSta = 0;
  488. BikeLedCheck_F.uwBike_LedOffErrCnt = 0;
  489. BikeLedCheck_F.blBike_LedCurErr = FALSE;
  490. BikeLedCheck_F.blBike_ForwardLedStart = TRUE;//前灯允许开灯启动,总开关
  491. }
  492. }
  493. else
  494. {
  495. BikeLedCheck_F.uwBike_LedOffErrCnt=0;
  496. }
  497. }
  498. }
  499. void LED_EnableDeal(BIKELEDCHECK_STR *p,UWORD switchAction,LED_PWM_STR mode )
  500. {
  501. if(switchAction != 0)
  502. {
  503. if(p->uwBike_OpenPreTime < 2000)
  504. p->uwBike_OpenPreTime++;
  505. if(p->uwBike_OpenPreTime <= 2)
  506. {
  507. if(mode == F_PWM_byte)
  508. {
  509. p->uwBikeLight_PWM = LIGHT_FIRSTPWM;
  510. }
  511. else
  512. {
  513. p->uwBikeLight_PWM = LIGHTBLR_FIRSTPWM;
  514. }
  515. }
  516. else if(p->uwBike_OpenPreTime <= 3)
  517. {
  518. if((p->uwBike_OpenLedEn == 0)&&(p->blBike_LedCurErr == TRUE))
  519. {
  520. p->uwBikeLight_PWM = LIGHT_SECTPWM ;
  521. }
  522. else
  523. {
  524. p->uwBikeLight_PWM = 0;
  525. }
  526. }
  527. if((p->uwBike_OpenPreTime > 2) && (p->uwBikeLight_PWM != 0))
  528. {
  529. p->blBike_LedCurErr = FALSE;
  530. p->uwBike_OpenLedEn = 1;
  531. }
  532. if(p->uwBike_OpenLedEn != 0)
  533. {
  534. p->uwBikeLight_PWM = LIGHT_MAXPWM;
  535. }
  536. }
  537. else
  538. {
  539. p->uwBikeLight_PWM = 0;
  540. }
  541. if(mode == F_PWM_byte)
  542. {
  543. DL_TimerG_setCaptureCompareValue(PWM_F_INST, p->uwBikeLight_PWM, GPIO_PWM_F_C1_IDX);//max=2304
  544. }
  545. }
  546. /*************************************************************************
  547. Local Functions (N/A)
  548. *************************************************************************/
  549. /*************************************************************************
  550. End of this File (EOF)!
  551. Do not put anything after this part!
  552. *************************************************************************/