Commit 54c2eb47 authored by 陈伟灿's avatar 陈伟灿

Merge branch 'cwc' into 'master'

【修改内容】修改设置彩灯RGB死机的BUG

See merge request chenweican/k-sdk!25
parents 983bc9ac c012df43
......@@ -304,11 +304,12 @@ static COLOR_RGB s_rgb;
static int kk_zclColorControlMovetohueandsat(EmberNodeId node,unsigned char ep)
{
int h,s,l;
unsigned short h;
unsigned char s,l;
COLOR_HSL hsl;
EmberStatus status = 0;
if(s_RgbCount >= 3){
RGB_to_HSL_base(s_rgb.red, s_rgb.green, s_rgb.blue,h,s,l);
RGB_to_HSL(s_rgb.red, s_rgb.green, s_rgb.blue,&h,&s,&l);
emberAfAppPrintln("[kk_zclColorControlMovetohueandsat]");
......@@ -317,10 +318,11 @@ static int kk_zclColorControlMovetohueandsat(EmberNodeId node,unsigned char ep)
dev->manage.dev.ColorLighting.CloorSetFlag = true;
emberAfAppPrintln("Save l:%d",l);
status = zclColorControlMovetohueandsat(node,ep,h*254,s*254,0,0,0,0);
status = zclColorControlMovetohueandsat(node,ep,h*254/360,s*254/100,0,0,0,0);
status |= zclLevel_MoveToLevel(node,ep,l,0,NULL,NULL);
s_RgbCount = 0;
}
return 0;
return status;
}
int kk_tsl_set_colorlight_RGB_red(jrpc_context * ctx,EmberNodeId node,unsigned char ep,void* data)
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment