summaryrefslogtreecommitdiff
path: root/src/common
diff options
context:
space:
mode:
authorhathach <[email protected]>2021-06-13 17:19:14 +0700
committerhathach <[email protected]>2021-06-13 17:19:14 +0700
commitf38c460433abc0c557f2035c7205b4f36bcbc677 (patch)
tree92143787bbccf24c4fb08255efb86e7ba83c28bc /src/common
parentbd039c8d37d7df05da992eb8afdcb31f782e1f23 (diff)
fix ep tx with double buffered
Diffstat (limited to 'src/common')
-rw-r--r--src/common/tusb_common.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/common/tusb_common.h b/src/common/tusb_common.h
index fe5bf5f41..8490daad7 100644
--- a/src/common/tusb_common.h
+++ b/src/common/tusb_common.h
@@ -123,7 +123,7 @@ TU_ATTR_ALWAYS_INLINE static inline uint32_t tu_align4k (uint32_t value) { retur
TU_ATTR_ALWAYS_INLINE static inline uint32_t tu_offset4k(uint32_t value) { return (value & 0xFFFUL); }
//------------- Mathematics -------------//
-TU_ATTR_ALWAYS_INLINE static inline uint32_t tu_abs(int32_t value) { return (uint32_t)((value < 0) ? (-value) : value); }
+TU_ATTR_ALWAYS_INLINE static inline uint32_t tu_div_ceil(uint32_t v, uint32_t d) { return (v + d -1)/d; }
/// inclusive range checking TODO remove
TU_ATTR_ALWAYS_INLINE static inline bool tu_within(uint32_t lower, uint32_t value, uint32_t upper)