diff options
| author | Tangyuxin <[email protected]> | 2022-09-20 22:31:11 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2022-09-20 10:31:11 -0400 |
| commit | a4829b1c004015cca489679cc335b6089aa9da31 (patch) | |
| tree | 3e346e76bb1c77b5b189ca28b053daeaea5154e9 /components/drivers/serial | |
| parent | 746d7a01bdb29c692b696780f938f11253ae1103 (diff) | |
[fix] Fix simulator compilation warnings (#6438)
* [fix] Fix simulator compilation warnings
* Update bsp/simulator/rtconfig_project.h
Co-authored-by: Man, Jianting (Meco) <[email protected]>
Diffstat (limited to 'components/drivers/serial')
| -rw-r--r-- | components/drivers/serial/serial.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/components/drivers/serial/serial.c b/components/drivers/serial/serial.c index 00d6671f37..25f06fa401 100644 --- a/components/drivers/serial/serial.c +++ b/components/drivers/serial/serial.c @@ -424,7 +424,7 @@ static void rt_dma_recv_update_get_index(struct rt_serial_device *serial, rt_siz if (rx_fifo->is_full && len != 0) rx_fifo->is_full = RT_FALSE; - rx_fifo->get_index += len; + rx_fifo->get_index += (rt_uint16_t)len; if (rx_fifo->get_index >= serial->config.bufsz) { rx_fifo->get_index %= serial->config.bufsz; @@ -445,7 +445,7 @@ static void rt_dma_recv_update_put_index(struct rt_serial_device *serial, rt_siz if (rx_fifo->get_index <= rx_fifo->put_index) { - rx_fifo->put_index += len; + rx_fifo->put_index += (rt_uint16_t)len; /* beyond the fifo end */ if (rx_fifo->put_index >= serial->config.bufsz) { @@ -459,7 +459,7 @@ static void rt_dma_recv_update_put_index(struct rt_serial_device *serial, rt_siz } else { - rx_fifo->put_index += len; + rx_fifo->put_index += (rt_uint16_t)len; if (rx_fifo->put_index >= rx_fifo->get_index) { /* beyond the fifo end */ |
