Skip to content

Commit

Permalink
only if 0xff
Browse files Browse the repository at this point in the history
  • Loading branch information
jurkovic-nikola committed Nov 9, 2024
1 parent 46e4066 commit 12f880f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/devices/k65plusW/k65plusW.go
Original file line number Diff line number Diff line change
Expand Up @@ -912,9 +912,11 @@ func (d *Device) writeColor(data []byte) {
binary.LittleEndian.PutUint16(buffer[0:2], uint16(len(data)))
copy(buffer[headerWriteSize:headerWriteSize+len(dataTypeSetColor)], dataTypeSetColor)
copy(buffer[headerWriteSize+len(dataTypeSetColor):], data)

// Split packet into chunks
chunks := common.ProcessMultiChunkPacket(buffer, maxBufferSizePerRequest)
for i, chunk := range chunks {
fmt.Println(fmt.Sprintf("% 2x", chunk))
if i == 0 {
// Initial packet is using cmdWriteColor
_, err := d.transfer(cmdWriteColor, chunk, byte(cmdKeyboard))
Expand Down Expand Up @@ -1037,7 +1039,7 @@ func (d *Device) controlDialListener() {
} else {
brightness += 100
}
} else {
} else if value == 255 {
if brightness <= 0 {
brightness = 0
} else {
Expand Down

0 comments on commit 12f880f

Please sign in to comment.