diff options
| author | hathach <[email protected]> | 2019-09-11 00:06:34 +0700 |
|---|---|---|
| committer | GitHub <[email protected]> | 2019-09-11 00:06:34 +0700 |
| commit | f5e58a09adef80a479f0aaa9a92459bfb4bbfd8d (patch) | |
| tree | f78d47e7bbe7935d07601b3284d3b873ceab04d0 /src/common/tusb_common.h | |
| parent | 4fe34c8f9b61ad85ce3bcd54466b03666c4578b8 (diff) | |
| parent | 4f6bedeac9a683ffd11efded8650f1aa95dc2f5d (diff) | |
Merge pull request #123 from pigrew/stm32_fsdev
STM32 FS Device Driver
Diffstat (limited to 'src/common/tusb_common.h')
| -rw-r--r-- | src/common/tusb_common.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/common/tusb_common.h b/src/common/tusb_common.h index 4352505eb..4f0105d13 100644 --- a/src/common/tusb_common.h +++ b/src/common/tusb_common.h @@ -89,7 +89,7 @@ static inline uint32_t tu_u32(uint8_t b1, uint8_t b2, uint8_t b3, uint8_t b4) static inline uint16_t tu_u16(uint8_t high, uint8_t low)
{
- return (((uint16_t) high) << 8) + low;
+ return (uint16_t)((((uint16_t) high) << 8) + low);
}
static inline uint8_t tu_u16_high(uint16_t u16) { return (uint8_t) (((uint16_t) (u16 >> 8)) & 0x00ff); }
@@ -117,7 +117,7 @@ static inline uint32_t tu_align4k (uint32_t value) { return (value & 0xFFFFF000U static inline uint32_t tu_offset4k(uint32_t value) { return (value & 0xFFFUL); }
//------------- Mathematics -------------//
-static inline uint32_t tu_abs(int32_t value) { return (value < 0) ? (-value) : value; }
+static inline uint32_t tu_abs(int32_t value) { return (uint32_t)((value < 0) ? (-value) : value); }
/// inclusive range checking
static inline bool tu_within(uint32_t lower, uint32_t value, uint32_t upper)
|
