修改272gsensor轴向配置 2726/1 2726/head 2727/target/1
authorpenglei <1624952103@qq.com>
Wed, 12 Nov 2025 04:18:14 +0000 (12:18 +0800)
committerpenglei <1624952103@qq.com>
Wed, 12 Nov 2025 04:18:14 +0000 (12:18 +0800)
code/sdk/zhihui/drivers/cywee/dml/cywee_dml.c
code/sdk/zhihui/utils/custom_utils.c

index 0eda65e..e071506 100644 (file)
@@ -2028,7 +2028,11 @@ int cywee_start(void)
     //设置acc gyro 相关参数
     memset(&scl, 0, sizeof(scl));
     scl.iData[0] = 1;
+#ifdef BOARD_FD272
+    scl.iData[7] = 6;  //轴向配置
+#else
     scl.iData[7] = 5;  //轴向配置
+#endif
 #if 0
     scl.iData[3] = 2;
     scl.iData[4] = 1; //1 anytime 2 fifo
index 9face26..63b6202 100644 (file)
@@ -2660,14 +2660,14 @@ errcode_t custom_i2c_init(uint8_t bus_index)
     // {
     result = uapi_i2c_master_init(bus_index, 400000, I2C_SPEED_MODE_FS); /* 400000: 400KHz */
 
-    if (result != ERRCODE_SUCC) {
-        PRINT("cywee i2c init fail! ret=0x%x\n", result);
-        return ERRCODE_FAIL;
-    }
-    else if(result == ERRCODE_I2C_ALREADY_INIT){
+    if(result == ERRCODE_I2C_ALREADY_INIT){
         PRINT("cywee i2c already init ret=0x%x\n", result);
         return ERRCODE_SUCC;
     }
+    else if (result != ERRCODE_SUCC && result != ERRCODE_I2C_ALREADY_INIT) {
+        PRINT("cywee i2c init fail! ret=0x%x\n", result);
+        return ERRCODE_FAIL;
+    }
 
 
     // i2c_installed = 1;