Bladeren bron

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

liYony 2 jaren geleden
bovenliggende
commit
150073736e
2 gewijzigde bestanden met toevoegingen van 12 en 2 verwijderingen
  1. 5 1
      inc/ft6236.h
  2. 7 1
      src/ft6236.c

+ 5 - 1
inc/ft6236.h

@@ -11,7 +11,11 @@
 #ifndef _FT6236_H_
 #define _FT6236_H_
 
-#include "touch.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_ft6236_init(const char *name, struct rt_touch_config *cfg,  rt_base_t pin);
 

+ 7 - 1
src/ft6236.c

@@ -10,7 +10,13 @@
 
 #include <rtthread.h>
 #include <rtdevice.h>
-#include "touch.h"
+
+#if defined(RT_VERSION_CHECK) && (RTTHREAD_VERSION >= RT_VERSION_CHECK(4, 1, 1))
+#include <rtdevice.h>
+#else
+#include <rtdevice.h>
+#include <touch.h>
+#endif
 
 #define DBG_TAG "ft6236"
 #define DBG_LVL DBG_LOG