add external libraries and update stm version
[mTask.git] / int / nucleo-f767-blinky / src / interface.h
index b9c223a..23e5b59 100644 (file)
@@ -3,8 +3,19 @@
 
 #include <stdbool.h>
 #include <stdint.h>
+#include <stdio.h>
+#include <string.h>
 
-#ifndef STM32F767xx
+#ifdef STM32F767xx
+#include "stm32f7xx_hal.h"
+#include "gpio.h"
+#include "usart.h"
+#endif
+
+#ifdef STM32F767xx
+extern volatile char uartf;
+extern char buf[128];
+#else
 extern int gargc;
 extern char **gargv;
 #endif
@@ -26,7 +37,10 @@ void setup();
 
 #define read16() 256*read_byte() + read_byte()
 #ifdef STM32F767xx
-#define debug(s, ...) ;
+#define debug(s, ...) {\
+               sprintf(buf, s, ##__VA_ARGS__);\
+               HAL_UART_Transmit(&huart3, (uint8_t*)buf, strlen(buf), 1000);\
+       }
 #define pdie(s) ;
 #define die(s, ...) ;
 #else