ringbuffer and tests

This commit is contained in:
2020-10-28 19:40:08 +01:00
parent 73239f4436
commit b8e676299a
12 changed files with 520 additions and 72 deletions

17
cube/User/Src/logger.c Normal file
View File

@ -0,0 +1,17 @@
#include <main.h>
#include <usart.h>
#include <logger.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
void log(char *msg) {
uint16_t len = strlen(msg);
if (HAL_UART_Transmit_IT(&debugUart, msg, len) != HAL_OK) {
if(RingBuffer_Write(&txBuf, msg, len) != RING_BUFFER_OK)
return 0;
}
return 1;
}