fix:修复调光时间BUG
解决调光时间一样的情况下,调光亮与调光灭的实际调光时间不一致问题
This commit is contained in:
51
pwm_control.h
Normal file
51
pwm_control.h
Normal file
@@ -0,0 +1,51 @@
|
||||
#ifndef PWM_CONTROL_H
|
||||
#define PWM_CONTROL_H
|
||||
|
||||
#include "STC8xxxx.h"
|
||||
|
||||
#define PWM_MAX_VALUE 1250ul
|
||||
#define initial_Val 1251ul
|
||||
/*
|
||||
#define LED_DRV_CH1 P07
|
||||
#define LED_DRV_CH2 P06
|
||||
#define LED_DRV_CH3 P05
|
||||
#define LED_DRV_CH4 P04
|
||||
#define LED_DRV_CH5 P03
|
||||
#define LED_DRV_CH6 P02
|
||||
#define LED_DRV_CH7 P01
|
||||
#define LED_DRV_CH8 P00
|
||||
#define LED_DRV_CH9 P23
|
||||
#define LED_DRV_CH10 P22
|
||||
#define LED_DRV_CH11 P21
|
||||
#define LED_DRV_CH12 P20
|
||||
*/
|
||||
#define LED_DRV_12V_EN P10
|
||||
|
||||
typedef struct
|
||||
{
|
||||
u16 currpwm[12];
|
||||
u16 thenvalue[12];
|
||||
float doublecurrpwm[12];
|
||||
u16 wanttopwm[12];
|
||||
u16 currvalue[12]; //<2F><>ǰ<EFBFBD>ٷֱ<D9B7>ֵ
|
||||
u16 changetime[12];
|
||||
u16 wanttovalue[12];
|
||||
float every_change_10ms[12];
|
||||
// u16 wanttopwmflash[12];
|
||||
u8 key_value;
|
||||
}xdata S_PWM;
|
||||
|
||||
extern S_PWM s_pwm;
|
||||
|
||||
void Close_Light(u8 pin);
|
||||
void Open_Light(u8 pin);
|
||||
void PWM_write(u8 i, u16 pwm);
|
||||
void deal_command1(void);
|
||||
void deal_command2(void);
|
||||
void show_light(void);
|
||||
void checkpwm(void);
|
||||
|
||||
void GPIO_config(void);
|
||||
void pwm_config(void);
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user