Another few victims of core3 UDP

This commit is contained in:
Theo Arends 2024-05-29 11:57:29 +02:00
parent f132663dfe
commit 27c35befdf
3 changed files with 8 additions and 1 deletions

View File

@ -208,6 +208,9 @@ void DeviceGroupsStart()
void DeviceGroupsStop() void DeviceGroupsStop()
{ {
device_groups_udp.flush(); device_groups_udp.flush();
#ifdef ESP32
device_groups_udp.clear(); // New with core3. Does what flush() did in core2;
#endif
device_groups_up = false; device_groups_up = false;
} }

View File

@ -245,7 +245,8 @@ void ArtNetLoop(void)
uint8_t packet_buffer[WS2812_ARTNET_UDP_BUFFER_SIZE]; // buffer to hold incoming UDP/SSDP packet uint8_t packet_buffer[WS2812_ARTNET_UDP_BUFFER_SIZE]; // buffer to hold incoming UDP/SSDP packet
packet_len = ArtNetUdp->read(packet_buffer, WS2812_ARTNET_UDP_BUFFER_SIZE); packet_len = ArtNetUdp->read(packet_buffer, WS2812_ARTNET_UDP_BUFFER_SIZE);
ArtNetUdp->flush(); // Finish reading the current packet // ArtNetUdp->flush(); // Finish reading the current packet
ArtNetUdp->clear(); // New with core3. Does what flush() did in core2;
#endif #endif
// AddLog(LOG_LEVEL_DEBUG_MORE, PSTR("UDP: Packet %*_H (%d)"), 32, packet_buffer, packet_len); // AddLog(LOG_LEVEL_DEBUG_MORE, PSTR("UDP: Packet %*_H (%d)"), 32, packet_buffer, packet_len);
if (artnet_conf.on) { if (artnet_conf.on) {

View File

@ -1387,6 +1387,9 @@ int32_t udp_call(char *url, uint32_t port, char *sbuf) {
udp.write((const uint8_t*)sbuf, strlen(sbuf)); udp.write((const uint8_t*)sbuf, strlen(sbuf));
udp.endPacket(); udp.endPacket();
udp.flush(); udp.flush();
#ifdef ESP32
udp.clear(); // New with core3. Does what flush() did in core2;
#endif
udp.stop(); udp.stop();
return 0; return 0;
} }