1
0
mirror of https://github.com/DCC-EX/CommandStation-EX.git synced 2024-11-22 23:56:13 +01:00

bugfix: Wrong condition for ring->commit()

This commit is contained in:
Harald Barth 2022-08-17 00:28:15 +02:00
parent cadb82ab6b
commit d3dbeaa666
3 changed files with 10 additions and 4 deletions

View File

@ -126,7 +126,9 @@ void CommandDistributor::broadcastToClients(clientType type) {
ring->commit();
}
}
if (ring->peekTargetMark() == RingStream::NO_CLIENT) {
// at this point ring is committed (NO_CLIENT) either from
// 4 or 13 lines above.
if (rememberClient != RingStream::NO_CLIENT) {
//DIAG(F("CD postmark client %d"), rememberClient);
ring->mark(rememberClient);
}

View File

@ -1 +1 @@
#define GITHUB_SHA "PORTX-HAL-20220816"
#define GITHUB_SHA "PORTX-HAL-20220817"

View File

@ -107,7 +107,7 @@ int RingStream::read() {
if ((_pos_read==_pos_write) && !_overflow) return -1; // empty
byte b=readRawByte();
if (b!=FLASH_INSERT_MARKER) return b;
#ifndef ARDUINO_ARCH_ESP32
// Detected a flash insert
// read address bytes LSB first (size depends on CPU)
uintptr_t iFlash=0;
@ -119,7 +119,11 @@ int RingStream::read() {
}
_flashInsert=reinterpret_cast<char * >( iFlash);
// and try again... so will read the first byte of the insert.
return read();
return read();
#else
DIAG(F("Detected flash insert marker at pos %d but there should not be one"),_pos_read);
return '\0';
#endif
}
byte RingStream::readRawByte() {