1
0
mirror of https://github.com/DCC-EX/CommandStation-EX.git synced 2025-02-18 15:06:03 +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(); 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); //DIAG(F("CD postmark client %d"), rememberClient);
ring->mark(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 if ((_pos_read==_pos_write) && !_overflow) return -1; // empty
byte b=readRawByte(); byte b=readRawByte();
if (b!=FLASH_INSERT_MARKER) return b; if (b!=FLASH_INSERT_MARKER) return b;
#ifndef ARDUINO_ARCH_ESP32
// Detected a flash insert // Detected a flash insert
// read address bytes LSB first (size depends on CPU) // read address bytes LSB first (size depends on CPU)
uintptr_t iFlash=0; uintptr_t iFlash=0;
@ -120,6 +120,10 @@ int RingStream::read() {
_flashInsert=reinterpret_cast<char * >( iFlash); _flashInsert=reinterpret_cast<char * >( iFlash);
// and try again... so will read the first byte of the insert. // 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() { byte RingStream::readRawByte() {