Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit b5ba121

Browse filesBrowse files
committed
UINT16_MAX stdint macro usage
1 parent bd51afb commit b5ba121
Copy full SHA for b5ba121

File tree

1 file changed

+2
-2
lines changed
Filter options

1 file changed

+2
-2
lines changed

‎src/class/cdc/cdc_device.c

Copy file name to clipboardExpand all lines: src/class/cdc/cdc_device.c
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ uint32_t tud_cdc_n_available(uint8_t itf)
150150
uint32_t tud_cdc_n_read(uint8_t itf, void* buffer, uint32_t bufsize)
151151
{
152152
cdcd_interface_t* p_cdc = &_cdcd_itf[itf];
153-
uint32_t num_read = tu_fifo_read_n(&p_cdc->rx_ff, buffer, (uint16_t) TU_MIN(bufsize, 65535));
153+
uint32_t num_read = tu_fifo_read_n(&p_cdc->rx_ff, buffer, (uint16_t) TU_MIN(bufsize, UINT16_MAX));
154154
_prep_out_transaction(p_cdc);
155155
return num_read;
156156
}
@@ -173,7 +173,7 @@ void tud_cdc_n_read_flush (uint8_t itf)
173173
uint32_t tud_cdc_n_write(uint8_t itf, void const* buffer, uint32_t bufsize)
174174
{
175175
cdcd_interface_t* p_cdc = &_cdcd_itf[itf];
176-
uint16_t ret = tu_fifo_write_n(&p_cdc->tx_ff, buffer, (uint16_t) TU_MIN(bufsize, 65535));
176+
uint16_t ret = tu_fifo_write_n(&p_cdc->tx_ff, buffer, (uint16_t) TU_MIN(bufsize, UINT16_MAX));
177177

178178
// flush if queue more than packet size
179179
// may need to suppress -Wunreachable-code since most of the time CFG_TUD_CDC_TX_BUFSIZE < BULK_PACKET_SIZE

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.