12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- #include "gd32f30x.h"
- #include <stdio.h>
- ///#include "gd32f350r_eval.h"
- #include "systick.h"
- #include "gpio_ctl.h"
- #include "global.h"
- #include "./mcu_sdk/mcu_api.h"
- #include "./mcu_sdk/protocol.h"
- /*******************************************************************************
- Function: ledSetParam()
- Description: 设置led控制参数,onCycle和ledCycle相等,且不为0时,led常亮;
- onCycle和ledCycle相等,且为0时,led常灭;
- Calls:
- Called By:
- Input: onCycle -- LED亮时间,单位10ms,最大值255
- ledCycle -- LED控制周期,单位10ms,最大255
- Output: no
- Return: no
- Others: no
- ********************************************************************************/
- void ledSetParam(u08 onCycle, u08 ledCycle)
- {
- if (onCycle <= ledCycle)
- {
- if (onCycle == ledCycle)
- {
- if (onCycle == 0)
- {
- CLR_LED1();
- CLR_LED2();
- CLR_LED3();
- CLR_LED4();
- }
- else
- {
- SET_LED1();
- SET_LED2();
- SET_LED3();
- SET_LED4();
- }
- }
- }
- }
|