From aea7b2db43b3fcc37b39e38b361fe262eab3983a Mon Sep 17 00:00:00 2001
From: Rahix <rahix@rahix.de>
Date: Fri, 5 Jul 2019 20:24:16 +0200
Subject: [PATCH] feat(pycardium): Add DEBUG_printf

DEBUG_printf is used by MicroPython to print debug information if
MICROPY_DEBUG_VERBOSE is set to (1).

Signed-off-by: Rahix <rahix@rahix.de>
---
 pycardium/mphalport.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/pycardium/mphalport.c b/pycardium/mphalport.c
index 38d778e4..9852fd85 100644
--- a/pycardium/mphalport.c
+++ b/pycardium/mphalport.c
@@ -1,4 +1,6 @@
 #include <stdint.h>
+#include <stdarg.h>
+#include <stdio.h>
 
 #include "py/lexer.h"
 #include "py/mpconfig.h"
@@ -29,6 +31,16 @@ void mp_hal_stdout_tx_strn(const char* str, mp_uint_t len)
 	epic_uart_write_str(str, len);
 }
 
+/* Used by MicroPython for debug output */
+int DEBUG_printf(const char *fmt, ...)
+{
+	va_list args;
+	va_start(args, fmt);
+	int ret = vprintf(fmt, args);
+	va_end(args);
+	return ret;
+}
+
 bool do_interrupt = false;
 
 /* Timer Interrupt used for control char notification */
-- 
GitLab