From 2f1022df0395badf03fc7cb20c82ee770b5b2c1d Mon Sep 17 00:00:00 2001 From: Javier Date: Mon, 31 Jan 2022 02:43:27 +0100 Subject: make Mpu401 less noisy about incorrect data port access --- Mpu401.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'Mpu401.cpp') diff --git a/Mpu401.cpp b/Mpu401.cpp index 8e2badc..eaced84 100644 --- a/Mpu401.cpp +++ b/Mpu401.cpp @@ -153,7 +153,7 @@ static uint8_t mpuReadData(PPDMDEVINS pDevIns) return pThis->uInput; } - if (pThis->fModeUart) { + if (pThis->fModeUart && pThis->midi.readAvail() >= 1) { uint8_t data; ssize_t read = pThis->midi.read(&data, 1); if (read == 1) { @@ -162,7 +162,7 @@ static uint8_t mpuReadData(PPDMDEVINS pDevIns) } } - LogWarnFunc(("Trying to read, but no data to read\n")); + Log3Func(("Trying to read, but no data to read\n")); return MPU_RESPONSE_ACK; } @@ -177,7 +177,7 @@ static void mpuWriteData(PPDMDEVINS pDevIns, uint8_t data) Log5Func(("midi_out data=0x%x\n", data)); } } else { - LogWarnFunc(("Ignoring data, not in UART mode\n")); + Log3Func(("Ignoring data, not in UART mode\n")); } } -- cgit v1.2.3