set all commands in line with common requirements
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
This commit is contained in:
parent
e402f0629a
commit
ee4d89405d
1 changed files with 31 additions and 7 deletions
|
@ -55,24 +55,48 @@ int prefix(){
|
|||
return 0;
|
||||
}
|
||||
|
||||
int staticColorSeparate(unsigned char brightness, unsigned char red, unsigned char green, unsigned char blue){
|
||||
int staticColorSeparate(int brightness, unsigned char red, unsigned char green, unsigned char blue){
|
||||
|
||||
unsigned char brgt;
|
||||
|
||||
switch (brightness){
|
||||
case 0:
|
||||
brgt = 0x1a;
|
||||
break;
|
||||
case 1:
|
||||
brgt = 0x4d;
|
||||
break;
|
||||
case 2:
|
||||
brgt = 0x80;
|
||||
break;
|
||||
case 3:
|
||||
brgt = 0xb3;
|
||||
break;
|
||||
case 4:
|
||||
brgt = 0xff;
|
||||
break;
|
||||
default:
|
||||
printf("Brightness must be defined in range of 0..4\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (prefix())
|
||||
return 1;
|
||||
|
||||
counter = 0;
|
||||
limit = 7;
|
||||
//cc 22 04 00 00 00 00 00 00 00 00 01 __ 00 __ __ __
|
||||
unsigned char dir1[64] = { 0xcc, 0x22, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, brightness, 0x00, blue, green, red, };
|
||||
unsigned char dir1[64] = { 0xcc, 0x22, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, brgt, 0x00, blue, green, red, };
|
||||
//cc 24 10 00 00 00 00 00 00 00 00 01 __ 00 __ __ __
|
||||
unsigned char dir2[64] = { 0xcc, 0x24, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, brightness, 0x00, blue, green, red, };
|
||||
unsigned char dir2[64] = { 0xcc, 0x24, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, brgt, 0x00, blue, green, red, };
|
||||
//cc 25 20 00 00 00 00 00 00 00 00 01 __ 00 __ __ __
|
||||
unsigned char dir3[64] = { 0xcc, 0x25, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, brightness, 0x00, blue, green, red, };
|
||||
unsigned char dir3[64] = { 0xcc, 0x25, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, brgt, 0x00, blue, green, red, };
|
||||
//cc 26 40 00 00 00 00 00 00 00 00 01 __ 00 __ __ __
|
||||
unsigned char dir4[64] = { 0xcc, 0x26, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, brightness, 0x00, blue, green, red, };
|
||||
unsigned char dir4[64] = { 0xcc, 0x26, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, brgt, 0x00, blue, green, red, };
|
||||
//cc 27 80 00 00 00 00 00 00 00 00 01 __ 00 __ __ __
|
||||
unsigned char dir5[64] = { 0xcc, 0x27, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, brightness, 0x00, blue, green, red, };
|
||||
unsigned char dir5[64] = { 0xcc, 0x27, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, brgt, 0x00, blue, green, red, };
|
||||
//cc 91 00 02 00 00 00 00 00 00 00 01 __ 00 __ __ __
|
||||
unsigned char dir6[64] = { 0xcc, 0x91, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, brightness, 0x00, blue, green, red, };
|
||||
unsigned char dir6[64] = { 0xcc, 0x91, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, brgt, 0x00, blue, green, red, };
|
||||
|
||||
if(64 != writeUsb(dir1))
|
||||
return 1;
|
||||
|
|
Loading…
Reference in a new issue