mirror of
https://github.com/DCC-EX/CommandStation-EX.git
synced 2025-07-28 09:53:45 +02:00
move WiFiESP::loop() to core 1
This commit is contained in:
@@ -47,7 +47,6 @@
|
||||
#ifdef CD_HANDLE_RING
|
||||
// wifi or ethernet ring streams with multiple client types
|
||||
RingStream * CommandDistributor::ring=0;
|
||||
// byte CommandDistributor::ringClient=NO_CLIENT;
|
||||
CommandDistributor::clientType CommandDistributor::clients[8]={
|
||||
NONE_TYPE,NONE_TYPE,NONE_TYPE,NONE_TYPE,NONE_TYPE,NONE_TYPE,NONE_TYPE,NONE_TYPE};
|
||||
|
||||
@@ -57,7 +56,6 @@ void CommandDistributor::parse(byte clientId,byte * buffer, RingStream * stream
|
||||
if (Diag::WIFI && Diag::CMD)
|
||||
DIAG(F("Parse C=%d T=%d B=%s"),clientId, clients[clientId], buffer);
|
||||
ring=stream;
|
||||
// ringClient=stream->peekTargetMark();
|
||||
|
||||
// First check if the client is not known
|
||||
// yet and in that case determinine type
|
||||
@@ -78,7 +76,6 @@ void CommandDistributor::parse(byte clientId,byte * buffer, RingStream * stream
|
||||
else if (clients[clientId] == WITHROTTLE_TYPE)
|
||||
WiThrottle::getThrottle(clientId)->parse(ring, buffer);
|
||||
|
||||
// ringClient=NO_CLIENT;
|
||||
}
|
||||
|
||||
void CommandDistributor::forget(byte clientId) {
|
||||
@@ -100,24 +97,24 @@ void CommandDistributor::broadcastToClients(clientType type) {
|
||||
// before merging broadcasts in the ring, then reinstate it in case
|
||||
// the process continues to output to its client.
|
||||
if (ring) {
|
||||
if ((rememberClient = ring->peekTargetMark()) != NO_CLIENT) {
|
||||
DIAG(F("CD precommit client %d"), rememberClient);
|
||||
ring->commit();
|
||||
}
|
||||
/* loop through ring clients */
|
||||
for (byte clientId=0; clientId<sizeof(clients); clientId++) {
|
||||
if (clients[clientId]==type) {
|
||||
DIAG(F("CD mark client %d"), clientId);
|
||||
ring->mark(clientId);
|
||||
ring->print(broadcastBufferWriter->getString());
|
||||
DIAG(F("CD commit client %d"), clientId);
|
||||
if ((rememberClient = ring->peekTargetMark()) != RingStream::NO_CLIENT) {
|
||||
//DIAG(F("CD precommit client %d"), rememberClient);
|
||||
ring->commit();
|
||||
}
|
||||
}
|
||||
if (ring->peekTargetMark()!=NO_CLIENT) {
|
||||
DIAG(F("CD postmark client %d"), rememberClient);
|
||||
ring->mark(rememberClient);
|
||||
}
|
||||
/* loop through ring clients */
|
||||
for (byte clientId=0; clientId<sizeof(clients); clientId++) {
|
||||
if (clients[clientId]==type) {
|
||||
//DIAG(F("CD mark client %d"), clientId);
|
||||
ring->mark(clientId);
|
||||
ring->print(broadcastBufferWriter->getString());
|
||||
//DIAG(F("CD commit client %d"), clientId);
|
||||
ring->commit();
|
||||
}
|
||||
}
|
||||
if (ring->peekTargetMark()!=RingStream::NO_CLIENT) {
|
||||
//DIAG(F("CD postmark client %d"), rememberClient);
|
||||
ring->mark(rememberClient);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
Reference in New Issue
Block a user