From 00dd3df4fc7bfe9aed62abe5e9d1575c12d8002e Mon Sep 17 00:00:00 2001 From: Pablo Curiel Date: Tue, 13 Sep 2022 02:53:11 +0200 Subject: [PATCH] Update usb.c --- source/core/usb.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/source/core/usb.c b/source/core/usb.c index f8cd8ab..4e472d7 100644 --- a/source/core/usb.c +++ b/source/core/usb.c @@ -206,7 +206,9 @@ static void usbEndSession(void); NX_INLINE void usbPrepareCommandHeader(u32 cmd, u32 cmd_block_size); static bool usbSendCommand(void); +#if LOG_LEVEL <= LOG_LEVEL_ERROR static void usbLogStatusDetail(u32 status); +#endif NX_INLINE bool usbAllocateTransferBuffer(void); NX_INLINE void usbFreeTransferBuffer(void); @@ -449,7 +451,10 @@ bool usbSendFileData(void *data, u64 data_size) goto end; } - if (!(ret = (cmd_status->status == UsbStatusType_Success))) usbLogStatusDetail(cmd_status->status); + ret = (cmd_status->status == UsbStatusType_Success); +#if LOG_LEVEL <= LOG_LEVEL_ERROR + if (!ret) usbLogStatusDetail(cmd_status->status); +#endif } end: @@ -740,11 +745,14 @@ static bool usbSendCommand(void) ret = ((status = cmd_status->status) == UsbStatusType_Success); end: +#if LOG_LEVEL <= LOG_LEVEL_ERROR if (!ret) usbLogStatusDetail(status); +#endif return ret; } +#if LOG_LEVEL <= LOG_LEVEL_INFO static void usbLogStatusDetail(u32 status) { switch(status) @@ -774,6 +782,7 @@ static void usbLogStatusDetail(u32 status) break; } } +#endif NX_INLINE bool usbAllocateTransferBuffer(void) {