修复表盘显示BUG,开机默认关闭陀螺仪 1751/2
authorpenglei <1624952103@qq.com>
Fri, 23 May 2025 07:10:27 +0000 (15:10 +0800)
committerpenglei <1624952103@qq.com>
Fri, 23 May 2025 07:10:27 +0000 (15:10 +0800)
code/sdk/application/brandy/brandy_standard/thread_pri_init.c
code/sdk/application/wearable/fd230/nativeapp/nativeui/main/src/MainModel.cpp
code/sdk/application/wearable/fd230/nativeapp/nativeui/set_dial/include/SetDialModel.h
code/sdk/zhihui/drivers/gyro/service/gyro_hal.h
code/sdk/zhihui/drivers/gyro/service/gyro_service.c
code/sdk/zhihui/utils/custom_save_runtime.c
code/sdk/zhihui/utils/custom_utils.c

index cc5570e..3b0ad1e 100644 (file)
@@ -531,6 +531,7 @@ uapi_pm_remove_sleep_veto(PM_ID_DEBUG);
 #endif \r
  \r
 #ifdef ENABLE_BN02\r
+    custom_i2c_init(I2C_BUS_0);\r
     uapi_bp_service_init();\r
 #endif\r
 \r
index 60d5d03..954a6ab 100644 (file)
@@ -63,7 +63,7 @@ namespace OHOS
         {DIAL_CLOCK_5, "Custom_5", CUSTOM_CLOCK5_DIALPER_PATH, DEFAULT_TASK_PERIOD}, // 表盘 Id 4\r
     };\r
     //默认表盘\r
-    #if U8_TEST_DIAL\r
+    #ifdef BOARD_U8\r
     static const char* DEFAULT_CUSTOM_DIAL_PATH = "/user/dial/res_dial/classic.bin";\r
     #else \r
     static const char* DEFAULT_CUSTOM_DIAL_PATH = "/user/dial/res_dial/obsidianrhythm.bin";\r
index 0caa961..2e73248 100644 (file)
@@ -2,7 +2,7 @@
  * @Author: penglei 1624952103@qq.com
  * @Date: 2025-05-12 10:00:46
  * @LastEditors: penglei 1624952103@qq.com
- * @LastEditTime: 2025-05-12 17:52:36
+ * @LastEditTime: 2025-05-23 14:14:26
  * @FilePath: /sdk615/code/sdk/zhihui/drivers/gyro/service/gyro_hal.h
  * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
  */
@@ -17,6 +17,7 @@ extern "C" {
 
 #include "stdint.h"
 #include "errcode.h"
+#include <stdbool.h>
 
 typedef struct {
     float x;
@@ -30,6 +31,7 @@ void gyro_power_off(void);
 void gyro_check(void);
 gyro_data_t gyro_get_data(void);
 uint8_t gyro_get_chip_id(void);
+bool gyro_check_exist(void);
 
 #ifdef __cplusplus
 #if __cplusplus
index 521391d..a0fa410 100644 (file)
@@ -92,6 +92,8 @@ errcode_t uapi_gyro_service_init(void)
     }
     g_gyro_sensor_exist = true;
 
+    gyro_power_off();
+
     app_task_definition_t taskcfg={0};
     taskcfg.create_queue_handle = create_gyro_queue;
     taskcfg.attr.name="gyro_service";
index 603373e..318bcff 100644 (file)
@@ -78,7 +78,7 @@ errcode_t uapi_save_runtime_log(uint16_t cmd)
 
     if(custom_running_log_state_stat==0 || g_runtime_log_queue_created==0)
     {
-        PRINT("Error task or queue no ready\r\n");
+        // PRINT("Error task or queue no ready\r\n");
         return ERRCODE_FAIL;
     }
     ret = osal_msg_queue_write_copy(g_custom_runtime_log_cmd_queue, (void *)&mail, sizeof(custom_cmd_t), 0);
index 93c4bff..12d076e 100644 (file)
@@ -2554,8 +2554,8 @@ void custom_i2c_reset(uint8_t i2cbus, uint16_t i2c_clock)
 
 errcode_t custom_i2c_init(uint8_t bus_index)
 {
-    if(i2c_installed == 1)
-        return ERRCODE_SUCC;
+    // if(i2c_installed == 1)
+        // return ERRCODE_SUCC;
 
 // #ifdef CONFIG_I2C_SUPPORT_DMA
 // #if CONFIG_I2C_SUPPORT_DMA
@@ -2572,7 +2572,7 @@ errcode_t custom_i2c_init(uint8_t bus_index)
         return ERRCODE_FAIL;
     }
 
-    i2c_installed = 1;
+    // i2c_installed = 1;
     return ERRCODE_SUCC;
     
     // else