PS_16_DZ: leave space for trailing 0-byte

This commit is contained in:
Joel Stein 2018-11-27 19:01:06 +01:00
parent 49403243d5
commit f75c4a27ad
1 changed files with 1 additions and 1 deletions

View File

@ -149,7 +149,7 @@ void PS16DZSerialInput(void)
yield();
byte serial_in_byte = PS16DZSerial->read();
if (serial_in_byte != 0x1B){
if (ps16dz_byte_counter >= PS16DZ_BUFFER_SIZE) {
if (ps16dz_byte_counter >= PS16DZ_BUFFER_SIZE - 1) {
memset(ps16dz_rx_buffer, 0, PS16DZ_BUFFER_SIZE);
ps16dz_byte_counter = 0;
}