sk6812 now works again (at least with 1m LEDs).

This commit is contained in:
Martin Preuss
2025-05-04 03:35:28 +02:00
parent 2ac090cf14
commit e6ea506a74
2 changed files with 12 additions and 17 deletions

View File

@@ -15,9 +15,9 @@
; @clobbers any, -X
SK6812_OnPacketReceived:
adiw xh:xl, 2 ; command
adiw xh:xl, NETMSG_OFFS_CMD ; command
ld r16, X
sbiw xh:xl, 2
sbiw xh:xl, NETMSG_OFFS_CMD
cpi r16, NETMSG_CMD_VALUE_SET
breq SK6812_OnPacketReceived_set
clc ; unexpected msg
@@ -31,16 +31,20 @@ SK6812_OnPacketReceived_set:
clc
ret
SK6812_OnPacketReceived_setRGBW:
rcall SK6812_SetAllColor ; value is in R18-R21 (r16, r17, r23)
push r17
push r24
push r25
rcall SK6812_SetAllColor ; value is in R18-R21 (r16, r17, r23, r24, r25)
pop r25
pop r24
pop r17
rjmp SK6812_OnPacketReceived_sendAck
SK6812_OnPacketReceived_setNumLeds:
sts sk6812NumLeds, r18
SK6812_OnPacketReceived_sendAck:
push xl
push xh
mov r16, r22 ; src address
ldi r23, NETMSG_CMD_VALUE_SET_ACK
clr r17
rcall Main_SendValueResponse
pop xh
pop xl