#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
#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