mirror of
https://github.com/dwhinham/mt32-pi.git
synced 2026-10-26 22:11:05 +00:00
Fix broken UART error handling logic
This commit is contained in:
1 parent
fc98e0a198
commit
773838e8fb
2 files changed
+25
-17
No files matched your search
@@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
|
||||
## [Unreleased]
|
||||
|
||||
### Fixed
|
||||
|
||||
- Broken UART error handling since v0.10.2 which would result in erratic, false MIDI activity under some circumstances. Many thanks to WiteWulf and Alex Mitchell for the report!
|
||||
|
||||
## [0.10.2] - 2021-08-11
|
||||
|
||||
### Added
|
||||
|
||||
+21
-17
@@ -893,30 +893,34 @@ size_t CMT32Pi::ReceiveSerialMIDI(u8* pOutData, size_t nSize)
|
||||
return 0;
|
||||
|
||||
// Error
|
||||
if (nResult < 0 && m_pConfig->SystemVerbose)
|
||||
if (nResult < 0)
|
||||
{
|
||||
const char* pErrorString;
|
||||
switch (nResult)
|
||||
if (m_pConfig->SystemVerbose)
|
||||
{
|
||||
case -SERIAL_ERROR_BREAK:
|
||||
pErrorString = "UART break error!";
|
||||
break;
|
||||
const char* pErrorString;
|
||||
switch (nResult)
|
||||
{
|
||||
case -SERIAL_ERROR_BREAK:
|
||||
pErrorString = "UART break error!";
|
||||
break;
|
||||
|
||||
case -SERIAL_ERROR_OVERRUN:
|
||||
pErrorString = "UART overrun error!";
|
||||
break;
|
||||
case -SERIAL_ERROR_OVERRUN:
|
||||
pErrorString = "UART overrun error!";
|
||||
break;
|
||||
|
||||
case -SERIAL_ERROR_FRAMING:
|
||||
pErrorString = "UART framing error!";
|
||||
break;
|
||||
case -SERIAL_ERROR_FRAMING:
|
||||
pErrorString = "UART framing error!";
|
||||
break;
|
||||
|
||||
default:
|
||||
pErrorString = "Unknown UART error!";
|
||||
break;
|
||||
default:
|
||||
pErrorString = "Unknown UART error!";
|
||||
break;
|
||||
}
|
||||
|
||||
m_pLogger->Write(MT32PiName, LogWarning, pErrorString);
|
||||
LCDLog(TLCDLogType::Warning, pErrorString);
|
||||
}
|
||||
|
||||
m_pLogger->Write(MT32PiName, LogWarning, pErrorString);
|
||||
LCDLog(TLCDLogType::Warning, pErrorString);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user