diff --git a/stm32l4a6zg-f0x.at1/Core/Inc/at1_defines.h b/stm32l4a6zg-f0x.at1/Core/Inc/at1_defines.h index 9c39621..0523196 100644 --- a/stm32l4a6zg-f0x.at1/Core/Inc/at1_defines.h +++ b/stm32l4a6zg-f0x.at1/Core/Inc/at1_defines.h @@ -26,7 +26,7 @@ extern "C" { #define STR(x) STR_HELPER(x) #endif #define VERSION_MAJOR 0 -#define VERSION_MINOR 5 +#define VERSION_MINOR 6 #ifdef DEBUG #define VERSION_DEBUG ".D" #else diff --git a/stm32l4a6zg-f0x.at1/Core/Inc/ringbuf.h b/stm32l4a6zg-f0x.at1/Core/Inc/ringbuf.h index f8d85c8..ac9f881 100644 --- a/stm32l4a6zg-f0x.at1/Core/Inc/ringbuf.h +++ b/stm32l4a6zg-f0x.at1/Core/Inc/ringbuf.h @@ -8,6 +8,10 @@ #ifndef _INC_RINGBUF_H_ #define _INC_RINGBUF_H_ +/* Defines */ +/* given, was \n, should be \r */ +#define RINGBUF_DELIMITER '\r' + #define RING_STATISTICS_ENABLED 1 #define RINGBUF_MAX_READ_LEN 80 diff --git a/stm32l4a6zg-f0x.at1/Core/Src/ringbuf.c b/stm32l4a6zg-f0x.at1/Core/Src/ringbuf.c index 808c064..506d93b 100644 --- a/stm32l4a6zg-f0x.at1/Core/Src/ringbuf.c +++ b/stm32l4a6zg-f0x.at1/Core/Src/ringbuf.c @@ -135,7 +135,7 @@ int ringbuf_push(struct ringbuf *ring, const uint8_t *data, size_t size) { ring->head += (uint16_t)size; } for (delimiterpos = 0; delimiterpos < size; delimiterpos++) { - if (data[delimiterpos] == '\n' || data[delimiterpos] == 0 ) { + if (data[delimiterpos] == RINGBUF_DELIMITER || data[delimiterpos] == 0 ) { delimiterfound++; ptr = ring->buf + ((head + delimiterpos) % ring->size); *ptr = 0;