From 0b05974d6462780030802a2991a9c929059b722a Mon Sep 17 00:00:00 2001 From: lonkaars Date: Fri, 14 Oct 2022 14:11:23 +0200 Subject: add printf macro util.h --- stm32f091/util.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 stm32f091/util.h diff --git a/stm32f091/util.h b/stm32f091/util.h new file mode 100644 index 0000000..8e3258f --- /dev/null +++ b/stm32f091/util.h @@ -0,0 +1,15 @@ +#pragma once + +#include +#include +#include +#include + +#include "setup.h" + +#define ws_usb_printf(fmt, ...) { \ + char temp[255]; \ + sprintf(temp, fmt, ##__VA_ARGS__); \ + HAL_UART_Transmit(&huart2, (uint8_t*) temp, sizeof(char) * strlen(temp), HAL_MAX_DELAY); \ +} + -- cgit v1.2.3