Hide MIDI/UART warnings when verbose = off

This commit is contained in:
Dale Whinham committed 2021-08-11 18:18:31 +01:00
1 parent 4e0d7d06e5
commit ebfed6f135
3 files changed
+20 -14

No files matched your search

+4
View File
@@ -11,6 +11,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Ability to swap the MT-32 stereo channels in order to work around bugs in games that are not aware of the MT-32's reversed panpot value interpretation (new configuration file option and custom SysEx message).
### Changed
- MIDI and UART related warnings are now hidden unless verbose mode is enabled in the configuration file. This is a preventative measure against false bug reports stemming from buggy games/user equipment, and to improve aesthetics (real synthesizers tend to silently ignore harmless stray MIDI bytes).
## [0.10.1] - 2021-08-01
### Changed
+5 -4
View File
@@ -14,11 +14,12 @@
# -----------------------------------------------------------------------------
[system]
# Enable or disable verbose startup output.
# Enable or disable verbose startup and error output.
#
# When enabled, outputs more information to the LCD when starting up.
# This may hide the boot logo on smaller graphical displays; has no effect on
# character displays.
# When enabled, outputs more information to the LCD when starting up, and when
# MIDI/UART errors are detected.
#
# This also may hide the boot logo on smaller graphical displays.
#
# Values: on, off*
verbose = off
+11 -10
View File
@@ -656,7 +656,8 @@ void CMT32Pi::OnSysExMessage(const u8* pData, size_t nSize)
void CMT32Pi::OnUnexpectedStatus()
{
CMIDIParser::OnUnexpectedStatus();
LCDLog(TLCDLogType::Error, "Unexp. MIDI status!");
if (m_pConfig->SystemVerbose)
LCDLog(TLCDLogType::Warning, "Unexp. MIDI status!");
}
void CMT32Pi::OnSysExOverflow()
@@ -890,30 +891,30 @@ size_t CMT32Pi::ReceiveSerialMIDI(u8* pOutData, size_t nSize)
return 0;
// Error
if (nResult < 0)
if (nResult < 0 && m_pConfig->SystemVerbose)
{
const char* errorString;
const char* pErrorString;
switch (nResult)
{
case -SERIAL_ERROR_BREAK:
errorString = "UART break error!";
pErrorString = "UART break error!";
break;
case -SERIAL_ERROR_OVERRUN:
errorString = "UART overrun error!";
pErrorString = "UART overrun error!";
break;
case -SERIAL_ERROR_FRAMING:
errorString = "UART framing error!";
pErrorString = "UART framing error!";
break;
default:
errorString = "Unknown UART error!";
pErrorString = "Unknown UART error!";
break;
}
m_pLogger->Write(MT32PiName, LogWarning, errorString);
LCDLog(TLCDLogType::Error, errorString);
m_pLogger->Write(MT32PiName, LogWarning, pErrorString);
LCDLog(TLCDLogType::Warning, pErrorString);
return 0;
}
@@ -923,7 +924,7 @@ size_t CMT32Pi::ReceiveSerialMIDI(u8* pOutData, size_t nSize)
int nSendResult = m_pSerial->Write(pOutData, nResult);
if (nSendResult != nResult)
{
m_pLogger->Write(MT32PiName, LogWarning, "received %d bytes, but only sent %d bytes", nResult, nSendResult);
m_pLogger->Write(MT32PiName, LogError, "received %d bytes, but only sent %d bytes", nResult, nSendResult);
LCDLog(TLCDLogType::Error, "UART TX error!");
}
}