refactoring meterbus

This commit is contained in:
2020-11-24 19:36:47 +01:00
parent bdba2a79cd
commit 14bf178664
5 changed files with 112 additions and 38 deletions

View File

@ -19,18 +19,6 @@ void ringbufferFree(ringbuffer_t *handle) {
handle->bufferWriteIdx = 0;
}
int ringbufferPutOne(ringbuffer_t *handle, uint8_t data) {
int retCode = -1;
if (handle->bufferReadIdx != handle->bufferWriteIdx) {
*(handle->buffer + handle->bufferWriteIdx) = data;
handle->bufferWriteIdx += 1;
if (handle->bufferWriteIdx == handle->bufferSize) {
handle->bufferWriteIdx = 0;
}
retCode = 0;
}
return retCode;
}
int ringbufferPut(ringbuffer_t *handle, uint8_t *data, uint32_t dataLen) {
uint32_t freeSpace = 0;