~aleteoryx/muditaos

ab28f1021eb3a2b594681aebac239ba905e5cb36 — Marek Niepieklo 5 years ago bc4d32c
[EGD-5664] Fix excessive logging in USB-CDC

Remove excessive logging in USB-CDC, which slows down transfer
M module-bsp/board/linux/usb_cdc/usb_cdc.cpp => module-bsp/board/linux/usb_cdc/usb_cdc.cpp +21 -3
@@ 1,4 1,4 @@
// Copyright (c) 2017-2020, Mudita Sp. z.o.o. All rights reserved.
// Copyright (c) 2017-2021, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#include "bsp/usb/usb.hpp"


@@ 7,6 7,25 @@
#include <fstream>
#include <string>

#ifndef DEUBG_USB
#undef LOG_PRINTF
#undef LOG_TRACE
#undef LOG_DEBUG
#undef LOG_INFO
#undef LOG_WARN
#undef LOG_ERROR
#undef LOG_FATAL
#undef LOG_CUSTOM

#define LOG_PRINTF(...)
#define LOG_TRACE(...)
#define LOG_DEBUG(...)
#define LOG_INFO(...)
#define LOG_WARN(...)
#define LOG_ERROR(...)
#define LOG_FATAL(...)
#define LOG_CUSTOM(loggerLevel, ...)
#endif
namespace bsp
{
    int fd;


@@ 39,8 58,7 @@ namespace bsp

                ssize_t length = read(fd, &inputData[0], SERIAL_BUFFER_LEN);
                if (length > 0) {
                    LOG_DEBUG(
                        "[ServiceDesktop:BSP_Driver] Received: %d signs: [%s]", static_cast<int>(length), inputData);
                    LOG_DEBUG("[ServiceDesktop:BSP_Driver] Received: %d signs", static_cast<int>(length));
#if USBCDC_ECHO_ENABLED
                    bool usbCdcEchoEnabledPrev = usbCdcEchoEnabled;


M module-bsp/board/rt1051/bsp/usb => module-bsp/board/rt1051/bsp/usb +1 -1
@@ 1,1 1,1 @@
Subproject commit 88b775af153a7020ea998245d2b4fcd4fc16217a
Subproject commit b9c54f6e7bbbcb83b164af02267b31e8f78701ea

M module-services/service-desktop/WorkerDesktop.cpp => module-services/service-desktop/WorkerDesktop.cpp +1 -2
@@ 1,4 1,4 @@
// Copyright (c) 2017-2020, Mudita Sp. z.o.o. All rights reserved.
// Copyright (c) 2017-2021, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#include "service-desktop/ServiceDesktop.hpp"


@@ 74,7 74,6 @@ bool WorkerDesktop::handleMessage(uint32_t queueID)
            return false;
        }

        LOG_DEBUG("handeMessage sending %d bytes using usbCDCSend", static_cast<unsigned int>(sendMsg->length()));
        bsp::usbCDCSend(sendMsg);
        delete sendMsg;
    }