removed tabs and replace by space

This commit is contained in:
Arthur Suzuki
2025-08-25 22:45:01 +02:00
parent 4b5c3a396d
commit f8ce5980a1

View File

@@ -572,7 +572,7 @@ void handleNotifications()
//if the number of LEDs in your installation doesn't allow that, please include padding bytes at the end of the last packet //if the number of LEDs in your installation doesn't allow that, please include padding bytes at the end of the last packet
byte tpmType = udpIn[1]; byte tpmType = udpIn[1];
if (tpmType == 0xaa) { //TPM2.NET polling, expect answer if (tpmType == 0xaa) { //TPM2.NET polling, expect answer
sendTPM2Ack(); return; sendTPM2Ack(); return;
} }
if (tpmType != 0xda) return; //return if notTPM2.NET data if (tpmType != 0xda) return; //return if notTPM2.NET data
@@ -588,12 +588,12 @@ void handleNotifications()
unsigned id = (tpmPayloadFrameSize/3)*(packetNum-1); //start LED unsigned id = (tpmPayloadFrameSize/3)*(packetNum-1); //start LED
unsigned totalLen = strip.getLengthTotal(); unsigned totalLen = strip.getLengthTotal();
for (size_t i = 6; i < tpmPayloadFrameSize + 4U && id < totalLen; i += 3, id++) { for (size_t i = 6; i < tpmPayloadFrameSize + 4U && id < totalLen; i += 3, id++) {
setRealtimePixel(id, udpIn[i], udpIn[i+1], udpIn[i+2], 0); setRealtimePixel(id, udpIn[i], udpIn[i+1], udpIn[i+2], 0);
} }
if (tpmPacketCount == numPackets) { //reset packet count and show if all packets were received if (tpmPacketCount == numPackets) { //reset packet count and show if all packets were received
tpmPacketCount = 0; tpmPacketCount = 0;
if (useMainSegmentOnly) strip.trigger(); if (useMainSegmentOnly) strip.trigger();
else strip.show(); else strip.show();
} }
return; return;
} }
@@ -605,37 +605,37 @@ void handleNotifications()
if (packetSize < 2) return; if (packetSize < 2) return;
if (udpIn[1] == 0) { if (udpIn[1] == 0) {
realtimeTimeout = 0; // cancel realtime mode immediately realtimeTimeout = 0; // cancel realtime mode immediately
return; return;
} else { } else {
realtimeLock(udpIn[1]*1000 +1, REALTIME_MODE_UDP); realtimeLock(udpIn[1]*1000 +1, REALTIME_MODE_UDP);
} }
if (realtimeOverride) return; if (realtimeOverride) return;
unsigned totalLen = strip.getLengthTotal(); unsigned totalLen = strip.getLengthTotal();
if (udpIn[0] == 1 && packetSize > 5) { //warls if (udpIn[0] == 1 && packetSize > 5) { //warls
for (size_t i = 2; i < packetSize -3; i += 4) { for (size_t i = 2; i < packetSize -3; i += 4) {
setRealtimePixel(udpIn[i], udpIn[i+1], udpIn[i+2], udpIn[i+3], 0); setRealtimePixel(udpIn[i], udpIn[i+1], udpIn[i+2], udpIn[i+3], 0);
} }
} else if (udpIn[0] == 2 && packetSize > 4) { //drgb } else if (udpIn[0] == 2 && packetSize > 4) { //drgb
for (size_t i = 2, id = 0; i < packetSize -2 && id < totalLen; i += 3, id++) for (size_t i = 2, id = 0; i < packetSize -2 && id < totalLen; i += 3, id++)
{ {
setRealtimePixel(id, udpIn[i], udpIn[i+1], udpIn[i+2], 0); setRealtimePixel(id, udpIn[i], udpIn[i+1], udpIn[i+2], 0);
} }
} else if (udpIn[0] == 3 && packetSize > 6) { //drgbw } else if (udpIn[0] == 3 && packetSize > 6) { //drgbw
for (size_t i = 2, id = 0; i < packetSize -3 && id < totalLen; i += 4, id++) { for (size_t i = 2, id = 0; i < packetSize -3 && id < totalLen; i += 4, id++) {
setRealtimePixel(id, udpIn[i], udpIn[i+1], udpIn[i+2], udpIn[i+3]); setRealtimePixel(id, udpIn[i], udpIn[i+1], udpIn[i+2], udpIn[i+3]);
} }
} else if (udpIn[0] == 4 && packetSize > 7) { //dnrgb } else if (udpIn[0] == 4 && packetSize > 7) { //dnrgb
unsigned id = ((udpIn[3] << 0) & 0xFF) + ((udpIn[2] << 8) & 0xFF00); unsigned id = ((udpIn[3] << 0) & 0xFF) + ((udpIn[2] << 8) & 0xFF00);
for (size_t i = 4; i < packetSize -2 && id < totalLen; i += 3, id++) { for (size_t i = 4; i < packetSize -2 && id < totalLen; i += 3, id++) {
setRealtimePixel(id, udpIn[i], udpIn[i+1], udpIn[i+2], 0); setRealtimePixel(id, udpIn[i], udpIn[i+1], udpIn[i+2], 0);
} }
} else if (udpIn[0] == 5 && packetSize > 8) { //dnrgbw } else if (udpIn[0] == 5 && packetSize > 8) { //dnrgbw
unsigned id = ((udpIn[3] << 0) & 0xFF) + ((udpIn[2] << 8) & 0xFF00); unsigned id = ((udpIn[3] << 0) & 0xFF) + ((udpIn[2] << 8) & 0xFF00);
for (size_t i = 4; i < packetSize -2 && id < totalLen; i += 4, id++) { for (size_t i = 4; i < packetSize -2 && id < totalLen; i += 4, id++) {
setRealtimePixel(id, udpIn[i], udpIn[i+1], udpIn[i+2], udpIn[i+3]); setRealtimePixel(id, udpIn[i], udpIn[i+1], udpIn[i+2], udpIn[i+3]);
} }
} }
if (useMainSegmentOnly) strip.trigger(); if (useMainSegmentOnly) strip.trigger();
else strip.show(); else strip.show();