diff options
| author | hathach <[email protected]> | 2025-11-03 10:46:09 +0700 |
|---|---|---|
| committer | hathach <[email protected]> | 2025-11-03 10:46:09 +0700 |
| commit | bda7efb1b3d482b7add2535a4a72f51a0dea5c08 (patch) | |
| tree | 6fe059dfa614e1b4b567906dda830adc4ab34e15 /src/common/tusb_common.h | |
| parent | a6c16d147593732028ed89292805e0e6a972e4b5 (diff) | |
fix #2942, include stdio if CFG_TUSB_DEBUG > 0 and CFG_TUSB_DEBUG_PRINTF is not defined
Diffstat (limited to 'src/common/tusb_common.h')
| -rw-r--r-- | src/common/tusb_common.h | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/common/tusb_common.h b/src/common/tusb_common.h index 6aa7e0bfc..6d7adc3a1 100644 --- a/src/common/tusb_common.h +++ b/src/common/tusb_common.h @@ -77,7 +77,6 @@ #include <inttypes.h> #include <stddef.h> #include <string.h> -#include <stdio.h> // Tinyusb Common Headers #include "tusb_option.h" @@ -126,7 +125,7 @@ TU_ATTR_ALWAYS_INLINE static inline int tu_memset_s(void *dest, size_t destsz, i return -1; } - memset(dest, ch, count); + (void) memset(dest, ch, count); return 0; } @@ -146,7 +145,7 @@ TU_ATTR_ALWAYS_INLINE static inline int tu_memcpy_s(void *dest, size_t destsz, c return -1; } - memcpy(dest, src, count); + (void) memcpy(dest, src, count); return 0; } @@ -231,7 +230,9 @@ TU_ATTR_ALWAYS_INLINE static inline uint32_t tu_round_up(uint32_t v, uint32_t f) // TODO use clz TODO remove TU_ATTR_ALWAYS_INLINE static inline uint8_t tu_log2(uint32_t value) { uint8_t result = 0; - while (value >>= 1) { result++; } + while ((value >>= 1) != 0) { + result++; + } return result; } |
