Apply suggestions from code review

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
Ha Thach
2025-11-07 16:31:17 +07:00
committed by GitHub
parent 9fac6dd49d
commit 5d351828cb
3 changed files with 3 additions and 3 deletions

View File

@ -62,7 +62,7 @@ TU_VERIFY_STATIC(sizeof(tud_cdc_configure_t) == 1, "size is not correct");
#define TUD_CDC_CONFIGURE_DEFAULT() { \
.rx_persistent = false, \
.tx_persistent = false, \
.tx_overwritabe_if_not_connected = false, \
.tx_overwritabe_if_not_connected = true, \
}
// Configure CDC driver behavior

View File

@ -114,7 +114,7 @@ TU_ATTR_ALWAYS_INLINE static inline bool send_csw(mscd_interface_t* p_msc) {
uint8_t rhport = p_msc->rhport;
p_msc->csw.data_residue = p_msc->cbw.total_bytes - p_msc->xferred_len;
p_msc->stage = MSC_STAGE_STATUS_SENT;
memcpy(_mscd_epbuf.buf, (uint8_t*) &p_msc->csw, sizeof(msc_csw_t)); //-V1086
memcpy(_mscd_epbuf.buf, &p_msc->csw, sizeof(msc_csw_t)); //-V1086
return usbd_edpt_xfer(rhport, p_msc->ep_in , _mscd_epbuf.buf, sizeof(msc_csw_t));
}

View File

@ -76,7 +76,7 @@ TU_ATTR_ALWAYS_INLINE static inline void tu_print_buf(uint8_t const* buf, uint32
#define TU_LOG_FAILED() (void) tu_printf("%s: %d: Failed\r\n", __PRETTY_FUNCTION__, __LINE__)
// Log Level 1: Error
#define TU_LOG1 (void) tu_printf
#define TU_LOG1(...) (void) tu_printf(__VA_ARGS__)
#define TU_LOG1_MEM tu_print_mem
#define TU_LOG1_BUF(_x, _n) tu_print_buf((uint8_t const*)(_x), _n)
#define TU_LOG1_INT(_x) (void) tu_printf(#_x " = %ld\r\n", (unsigned long) (_x) )