Browse Source

[touch] 适配v4.1.1及以上版本

liYony 2 years ago
parent
commit
e6366b7535
2 changed files with 11 additions and 1 deletions
  1. 4 0
      inc/ft6206.h
  2. 7 1
      src/ft6206.c

+ 4 - 0
inc/ft6206.h

@@ -11,7 +11,11 @@
 #ifndef _FT6206_H_
 #define _FT6206_H_
 
+#if defined(RT_VERSION_CHECK) && (RTTHREAD_VERSION >= RT_VERSION_CHECK(4, 1, 1))
+#include <rtdevice.h>
+#else
 #include <touch.h>
+#endif
 
 int rt_hw_ft6206_init(const char *name, struct rt_touch_config *cfg);
 

+ 7 - 1
src/ft6206.c

@@ -9,8 +9,14 @@
  */
 
 #include <rtthread.h>
+
+#if defined(RT_VERSION_CHECK) && (RTTHREAD_VERSION >= RT_VERSION_CHECK(4, 1, 1))
+#include <rtdevice.h>
+#else
 #include <rtdevice.h>
-#include "touch.h"
+#include <touch.h>
+#endif
+
 #include <string.h>
 
 #define DBG_TAG "ft6206"