8000 UINT16_MAX stdint macro usage · arduino/tinyusb@b5ba121 · GitHub
[go: up one dir, main page]

Skip to content

Commit b5ba121

Browse files
committed
UINT16_MAX stdint macro usage
1 parent bd51afb commit b5ba121

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/class/cdc/cdc_device.c

Lines 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