logger interrupt

This commit is contained in:
2020-11-10 16:30:26 +01:00
parent fa66527d9c
commit bf5d9b4bae
3 changed files with 22 additions and 0 deletions

View File

@ -35,6 +35,12 @@ void logFree() {
ringbufferFree(&logBuffer);
}
#ifdef LOGGER_INTERRUPT
void mbusCommTxCpltCallback(UART_HandleTypeDef *huart) {
logExec();
}
#endif
int logExec() {
int c = -1;
#ifndef TEST
@ -45,7 +51,11 @@ int logExec() {
#ifndef TEST
// transfer to TX channel
uint8_t cc = (uint8_t) c;
#ifndef LOGGER_INTERRUPT
HAL_UART_Transmit(&debugUart, &cc, 1, HAL_MAX_DELAY);
#else
HAL_UART_Transmit_IT(&debugUart, &cc, 1);
#endif // LOGGER_INTERRUPT
#endif // TEST
}
#ifndef TEST