aboutsummaryrefslogtreecommitdiff
path: root/stm32f091/util.h
diff options
context:
space:
mode:
Diffstat (limited to 'stm32f091/util.h')
-rw-r--r--stm32f091/util.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/stm32f091/util.h b/stm32f091/util.h
new file mode 100644
index 0000000..92f093f
--- /dev/null
+++ b/stm32f091/util.h
@@ -0,0 +1,16 @@
+#pragma once
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <stm32f0xx_hal.h>
+#include <string.h>
+
+#include "setup.h"
+#include "../shared/util.h"
+
+#define ws_usb_printf(fmt, ...) { \
+ char temp[255]; \
+ snprintf(temp, 255, fmt, ##__VA_ARGS__); \
+ HAL_UART_Transmit(&huart2, (uint8_t*) temp, sizeof(char) * strlen(temp), HAL_MAX_DELAY); \
+}
+