From 882394dee2649b35a5ebea441b796877f623d6aa Mon Sep 17 00:00:00 2001
From: recallmenot <edmund.raile@proton.me>
Date: Wed, 28 Jun 2023 11:27:44 +0200
Subject: [PATCH] GPIO example funconfig changes

---
 examples/GPIO/GPIO.c      | 5 +----
 examples/GPIO/Makefile    | 3 ---
 examples/GPIO/funconfig.h | 7 +++++++
 3 files changed, 8 insertions(+), 7 deletions(-)
 create mode 100644 examples/GPIO/funconfig.h

diff --git a/examples/GPIO/GPIO.c b/examples/GPIO/GPIO.c
index 1922e09..c8682e1 100644
--- a/examples/GPIO/GPIO.c
+++ b/examples/GPIO/GPIO.c
@@ -13,9 +13,6 @@
 #endif
 
 
-#define SYSTEM_CORE_CLOCK 48000000
-#define APB_CLOCK SYSTEM_CORE_CLOCK
-
 #include "ch32v003fun.h"
 
 #include "ch32v003_GPIO_branchless.h"
@@ -25,7 +22,7 @@
 
 
 int main() {
-	SystemInit48HSI();
+	SystemInit();
 
 #if DEMO_GPIO_blink == 1
 	GPIO_port_enable(GPIO_port_C);
diff --git a/examples/GPIO/Makefile b/examples/GPIO/Makefile
index 7e60f81..63ac24f 100644
--- a/examples/GPIO/Makefile
+++ b/examples/GPIO/Makefile
@@ -2,9 +2,6 @@ all : flash
 
 TARGET:=GPIO
 
-CFLAGS+=-DTINYVECTOR
-CFLAGS+=-DSTDOUT_UART
-
 include ../../ch32v003fun/ch32v003fun.mk
 
 flash : cv_flash
diff --git a/examples/GPIO/funconfig.h b/examples/GPIO/funconfig.h
new file mode 100644
index 0000000..820e1f0
--- /dev/null
+++ b/examples/GPIO/funconfig.h
@@ -0,0 +1,7 @@
+#ifndef _FUNCONFIG_H
+#define _FUNCONFIG_H
+
+#define FUNCONF_TINYVECTOR 1
+#define CH32V003           1
+
+#endif
-- 
GitLab