Bus creation bugfix. Removed debug code.

This commit is contained in:
Blaz Kristan 2021-09-22 19:13:52 +02:00
parent 08925a72c6
commit 0f8d6daf99
2 changed files with 1 additions and 19 deletions

View File

@ -43,7 +43,7 @@ struct BusConfig {
type = busType & 0x7F; // bit 7 may be/is hacked to include RGBW info (1=RGBW, 0=RGB)
count = len; start = pstart; colorOrder = pcolorOrder; reversed = rev; skipAmount = skip;
uint8_t nPins = 1;
if (type == 2 || type == 3) nPins = 4;
if (type >= 10 || type <= 15) nPins = 4;
else if (type > 47) nPins = 2;
else if (type > 40 && type < 46) nPins = NUM_PWM_PINS(type);
for (uint8_t i = 0; i < nPins; i++) pins[i] = ppins[i];

View File

@ -556,18 +556,6 @@ uint8_t sequenceNumber = 0; // this needs to be shared across all outputs
uint8_t realtimeBroadcast(uint8_t type, IPAddress client, uint16_t length, uint8_t *buffer, bool isRGBW) {
if (!interfacesInited) return 1; // network not initialised
DEBUG_PRINT(F("Net client: "));
DEBUG_PRINT(client[0]);
DEBUG_PRINT(".");
DEBUG_PRINT(client[1]);
DEBUG_PRINT(".");
DEBUG_PRINT(client[2]);
DEBUG_PRINT(".");
DEBUG_PRINT(client[3]);
DEBUG_PRINT(" (");
DEBUG_PRINT(length);
DEBUG_PRINTLN(")");
WiFiUDP ddpUdp;
switch (type) {
@ -579,10 +567,6 @@ uint8_t realtimeBroadcast(uint8_t type, IPAddress client, uint16_t length, uint8
if (channelCount % DDP_CHANNELS_PER_PACKET) {
packetCount++;
}
DEBUG_PRINT("Channels: ");
DEBUG_PRINTLN(channelCount);
DEBUG_PRINT("Packets: ");
DEBUG_PRINTLN(packetCount);
// there are 3 channels per RGB pixel
uint16_t channel = 0; // TODO: allow specifying the start channel
@ -593,8 +577,6 @@ uint8_t realtimeBroadcast(uint8_t type, IPAddress client, uint16_t length, uint8
if (sequenceNumber > 15) sequenceNumber = 0;
DEBUG_PRINTLN(F("Opening UDP."));
//return 0;
// the following will reboot ESP if WiFi is not yet connected
int rc = ddpUdp.beginPacket(client, DDP_PORT);
if (rc == 0) {