zhunk 1 год назад
Родитель
Сommit
c95bd0143f

+ 2 - 9
Application_CBD/.config

@@ -115,10 +115,7 @@ CONFIG_RT_SERIAL_RB_BUFSZ=512
 # CONFIG_RT_USING_CAN is not set
 CONFIG_RT_USING_HWTIMER=y
 # CONFIG_RT_USING_CPUTIME is not set
-CONFIG_RT_USING_I2C=y
-# CONFIG_RT_I2C_DEBUG is not set
-CONFIG_RT_USING_I2C_BITOPS=y
-# CONFIG_RT_I2C_BITOPS_DEBUG is not set
+# CONFIG_RT_USING_I2C is not set
 CONFIG_RT_USING_PIN=y
 CONFIG_RT_USING_ADC=y
 CONFIG_RT_USING_PWM=y
@@ -705,11 +702,7 @@ CONFIG_PKG_SYSWATCH_VER="latest"
 # CONFIG_PKG_USING_QMP6989 is not set
 # CONFIG_PKG_USING_BALANCE is not set
 # CONFIG_PKG_USING_SHT2X is not set
-CONFIG_PKG_USING_SHT3X=y
-CONFIG_PKG_SHT3X_PATH="/packages/peripherals/sensors/sht3x"
-# CONFIG_PKG_USING_SHT3X_V100 is not set
-CONFIG_PKG_USING_SHT3X_LATEST_VERSION=y
-CONFIG_PKG_SHT3X_VER="latest"
+# CONFIG_PKG_USING_SHT3X is not set
 # CONFIG_PKG_USING_SHT4X is not set
 # CONFIG_PKG_USING_AD7746 is not set
 # CONFIG_PKG_USING_ADT74XX is not set

+ 2 - 5
Application_CBD/.config.old

@@ -75,7 +75,7 @@ CONFIG_RT_MAIN_THREAD_PRIORITY=10
 #
 # C++ features
 #
-CONFIG_RT_USING_CPLUSPLUS=y
+# CONFIG_RT_USING_CPLUSPLUS is not set
 # end of C++ features
 
 #
@@ -115,10 +115,7 @@ CONFIG_RT_SERIAL_RB_BUFSZ=512
 # CONFIG_RT_USING_CAN is not set
 CONFIG_RT_USING_HWTIMER=y
 # CONFIG_RT_USING_CPUTIME is not set
-CONFIG_RT_USING_I2C=y
-# CONFIG_RT_I2C_DEBUG is not set
-CONFIG_RT_USING_I2C_BITOPS=y
-# CONFIG_RT_I2C_BITOPS_DEBUG is not set
+# CONFIG_RT_USING_I2C is not set
 CONFIG_RT_USING_PIN=y
 CONFIG_RT_USING_ADC=y
 CONFIG_RT_USING_PWM=y

Разница между файлами не показана из-за своего большого размера
+ 1 - 3
Application_CBD/.cproject


+ 1 - 1
Application_CBD/.settings/language.settings.xml

@@ -5,7 +5,7 @@
 			<provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/>
 			<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
 			<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
-			<provider class="org.eclipse.cdt.managedbuilder.language.settings.providers.GCCBuiltinSpecsDetector" console="false" env-hash="-487577209104409497" id="ilg.gnuarmeclipse.managedbuild.cross.GCCBuiltinSpecsDetector" keep-relative-paths="false" name="CDT ARM Cross GCC Built-in Compiler Settings " parameter="${COMMAND} ${FLAGS} ${cross_toolchain_flags} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
+			<provider class="org.eclipse.cdt.managedbuilder.language.settings.providers.GCCBuiltinSpecsDetector" console="false" env-hash="-491463452368943755" id="ilg.gnuarmeclipse.managedbuild.cross.GCCBuiltinSpecsDetector" keep-relative-paths="false" name="CDT ARM Cross GCC Built-in Compiler Settings " parameter="${COMMAND} ${FLAGS} ${cross_toolchain_flags} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
 				<language-scope id="org.eclipse.cdt.core.gcc"/>
 				<language-scope id="org.eclipse.cdt.core.g++"/>
 			</provider>

+ 0 - 36
Application_CBD/applications/sht30_collect.c

@@ -9,7 +9,6 @@
  */
 #include <rtthread.h>
 #include <board.h>
-#include <sht3x.h>
 #include "sht30_collect.h"
 #include <string.h>
 #include <stdio.h>
@@ -130,45 +129,10 @@ int UART_485_INIT(void)
 /* 入口函数 */
 static void sht30_collect_thread_entry(void *parameter)
 {
-
-    sht3x_device_t  sht3x_device;
     static int checklightnum = 0;
     static int checknightnum = 0;
-    sht3x_device = sht3x_init("i2c1", 0x44);
-    //此处需要短暂的延时,否则会出现连续读取失败的问题
-    rt_thread_mdelay(150);
     while (1)
     {
-        if(sht3x_device)
-        {
-            if(RT_EOK == sht3x_read_singleshot(sht3x_device))
-            {
-                hum_value = sht3x_device->humidity;
-                tem_value = sht3x_device->temperature;
-                if(hum_value!=0)
-                {
-                    rt_sprintf(device_status.humidity,"%d.%d",(int)sht3x_device->humidity, (uint)(sht3x_device->humidity * 10) % 10);
-                    rt_sprintf(device_status.tempture,"%d.%d",(int)sht3x_device->temperature, (uint)(sht3x_device->temperature * 10) % 10);
-                }
-                else {
-                    rt_kprintf("sht3x_read_singleshot eRR:%d",hum_value);
-                }
-            }
-            else {
-                sht3x_softreset(sht3x_device);
-            }
-////          rt_kprintf("sht30 humidity   : %d.%d  ", (int)sht3x_device->humidity, (int)(sht3x_device->humidity * 10) % 10);
-////          rt_kprintf("temperature: %d.%d\n", (int)sht3x_device->temperature, (int)(sht3x_device->temperature * 10) % 10);
-        }
-        else
-        {
-
-            rt_kprintf("read sht3x fail.\r\n");
-            //重新初始化
-            sht3x_deinit(sht3x_device);
-            sht3x_device = sht3x_init("i2c1", 0x44);
-            rt_thread_mdelay(150);
-        }
         if(Read_Light_Voltage()>500)
         {
             checklightnum++;

+ 1 - 1
Application_CBD/drivers/board.h

@@ -49,7 +49,7 @@ extern "C" {
 #define BSP_USING_UART1
 #define BSP_USING_UART2
 #define BSP_USING_UART3
-#define BSP_USING_I2C1
+//#define BSP_USING_I2C1
 #define BSP_USING_UART4
 #define BSP_USING_UART5
 #if defined(BSP_USING_UART1)

+ 0 - 4
Application_CBD/rtconfig.h

@@ -87,8 +87,6 @@
 #define RT_SERIAL_USING_DMA
 #define RT_SERIAL_RB_BUFSZ 512
 #define RT_USING_HWTIMER
-#define RT_USING_I2C
-#define RT_USING_I2C_BITOPS
 #define RT_USING_PIN
 #define RT_USING_ADC
 #define RT_USING_PWM
@@ -277,8 +275,6 @@
 
 /* sensors drivers */
 
-#define PKG_USING_SHT3X
-#define PKG_USING_SHT3X_LATEST_VERSION
 /* end of sensors drivers */
 
 /* touch drivers */