summaryrefslogtreecommitdiff
path: root/src/class/cdc/serial
diff options
context:
space:
mode:
authorhathach <[email protected]>2025-10-16 10:03:10 +0700
committerhathach <[email protected]>2025-10-16 10:03:10 +0700
commite93e47ae0434b53a20d1c62de62f34377bc8b492 (patch)
tree935cfce49a05cd5b68808992535c9b0b20bb5d9c /src/class/cdc/serial
parent79445c2386adefb207a76a70d87578b53c3e7922 (diff)
add tu_div_round_nearest() (only handle positive) to replace DIV_ROUND_CLOSEST() to remove the need of typeof
Diffstat (limited to 'src/class/cdc/serial')
-rw-r--r--src/class/cdc/serial/ftdi_sio.h13
1 files changed, 0 insertions, 13 deletions
diff --git a/src/class/cdc/serial/ftdi_sio.h b/src/class/cdc/serial/ftdi_sio.h
index 8abf74f11..9bd56cef4 100644
--- a/src/class/cdc/serial/ftdi_sio.h
+++ b/src/class/cdc/serial/ftdi_sio.h
@@ -215,17 +215,4 @@ typedef struct ftdi_private {
#define FTDI_NOT_POSSIBLE -1
#define FTDI_REQUESTED -2
-// division and round function overtaken from math.h
-#define DIV_ROUND_CLOSEST(x, divisor)( \
-{ \
- typeof(x) __x = x; \
- typeof(divisor) __d = divisor; \
- (((typeof(x))-1) > 0 || \
- ((typeof(divisor))-1) > 0 || \
- (((__x) > 0) == ((__d) > 0))) ? \
- (((__x) + ((__d) / 2)) / (__d)) : \
- (((__x) - ((__d) / 2)) / (__d)); \
-} \
-)
-
#endif //TUSB_FTDI_SIO_H