File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
hardware/arduino/cores/arduino Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -65,7 +65,7 @@ struct ring_buffer
65
65
66
66
inline void store_char (unsigned char c, ring_buffer *rx_buffer)
67
67
{
68
- int i = (rx_buffer->head + 1 ) % RX_BUFFER_SIZE;
68
+ int i = (unsigned int )( rx_buffer->head + 1 ) % RX_BUFFER_SIZE;
69
69
70
70
// if we should be storing the received character into the location
71
71
// just before the tail (meaning that the head would advance to the
@@ -231,7 +231,7 @@ void HardwareSerial::end()
231
231
232
232
int HardwareSerial::available (void )
233
233
{
234
- return (RX_BUFFER_SIZE + _rx_buffer->head - _rx_buffer->tail ) % RX_BUFFER_SIZE;
234
+ return (unsigned int )( RX_BUFFER_SIZE + _rx_buffer->head - _rx_buffer->tail ) % RX_BUFFER_SIZE;
235
235
}
236
236
237
237
int HardwareSerial::peek (void )
@@ -250,7 +250,7 @@ int HardwareSerial::read(void)
250
250
return -1 ;
251
251
} else {
252
252
unsigned char c = _rx_buffer->buffer [_rx_buffer->tail ];
253
- _rx_buffer->tail = (_rx_buffer->tail + 1 ) % RX_BUFFER_SIZE;
253
+ _rx_buffer->tail = (unsigned int )( _rx_buffer->tail + 1 ) % RX_BUFFER_SIZE;
254
254
return c;
255
255
}
256
256
}
You can’t perform that action at this time.
0 commit comments