Fixes for ESP8266

This commit is contained in:
Troy
2024-11-07 13:48:17 -05:00
parent e9ce495d83
commit 7bf3f4aee0
2 changed files with 9 additions and 2 deletions

View File

@@ -474,8 +474,11 @@ BusNetwork::BusNetwork(BusConfig &bc, const ColorOrderMap &com) : Bus(bc.type, b
break;
}
_UDPchannels = _rgbw ? 4 : 3;
#ifdef ESP32
_data = (byte*) heap_caps_calloc_prefer((bc.count * _UDPchannels)+15, sizeof(byte), 3, MALLOC_CAP_DEFAULT, MALLOC_CAP_SPIRAM);
#else
_data = (byte*) calloc((bc.count * _UDPchannels)+15, sizeof(byte));
#endif
if (_data == nullptr) return;
_len = bc.count;
_colorOrder = bc.colorOrder;