Fix warm mode transition after color control
This commit is contained in:
@@ -175,6 +175,7 @@ extern unsigned char receive_data_cnt;
|
||||
extern uint8_t res_data;
|
||||
extern uint8_t choose_mode_falsg;
|
||||
extern uint8_t choose_mode_bh; //模式变化
|
||||
extern uint8_t color_ring_active;
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -39,6 +39,7 @@ uint8_t match_success=0;
|
||||
|
||||
uint8_t choose_mode_falsg=0;
|
||||
uint8_t choose_mode_bh=0; //模式变化
|
||||
uint8_t color_ring_active=0; //色环调色状态,首次按模式键先回到暖光
|
||||
|
||||
void Delay_50us(unsigned int n)
|
||||
{
|
||||
@@ -595,6 +596,17 @@ const uint8_t ARR_temperature[255][2]={
|
||||
void _433_fun(){
|
||||
|
||||
// uart_printf("ggg=%d\r\n",(int)res_data);
|
||||
if(deviceStatus==POWERON && color_ring_active &&
|
||||
(res_data==Mode_add || res_data==Mode_dow || res_data==F_Mode_choose)){
|
||||
color_ring_active=0;
|
||||
choose_mode_bh=0;
|
||||
choose_mode_falsg=0;
|
||||
dev_flag=0;
|
||||
set_click();
|
||||
set_mode();
|
||||
mode_init();
|
||||
return;
|
||||
}
|
||||
if(Key_TypeDef.KEY_STATE_Click==1||KEY_STATE_re==1) return;
|
||||
set_click();
|
||||
|
||||
@@ -759,6 +771,7 @@ void _433_fun(){
|
||||
if (res_data >=16&& res_data <= 255){
|
||||
//为了适配方形 接收到15的码值 要变成236
|
||||
choose_mode_bh=1;
|
||||
color_ring_active=1;
|
||||
if(res_data>=20&&res_data<40){
|
||||
res_data=0;
|
||||
}
|
||||
|
||||
@@ -227,6 +227,7 @@ void scan_uart(uint8_t *arr)
|
||||
break;
|
||||
case 2:
|
||||
if(POWEROFF==deviceStatus)break;
|
||||
color_ring_active=0;
|
||||
choose_mode_bh=0;
|
||||
choose_mode_falsg=user_rx_buf[1]-1;
|
||||
dev_flag=0;
|
||||
@@ -255,6 +256,7 @@ void scan_uart(uint8_t *arr)
|
||||
break;
|
||||
case 6:
|
||||
if(POWEROFF==deviceStatus)break;
|
||||
color_ring_active=1;
|
||||
color_R_buff=user_rx_buf[1];
|
||||
color_G_buff=color_R_buff;
|
||||
color_B_buff=user_rx_buf[2];
|
||||
|
||||
Binary file not shown.
Reference in New Issue
Block a user