From b9bc54b77e4668a19e26bf7dc193ee869d2d03e7 Mon Sep 17 00:00:00 2001 From: penglei <1624952103@qq.com> Date: Fri, 23 May 2025 15:10:27 +0800 Subject: [PATCH] =?utf8?q?=E4=BF=AE=E5=A4=8D=E8=A1=A8=E7=9B=98=E6=98=BE?= =?utf8?q?=E7=A4=BABUG=EF=BC=8C=E5=BC=80=E6=9C=BA=E9=BB=98=E8=AE=A4?= =?utf8?q?=E5=85=B3=E9=97=AD=E9=99=80=E8=9E=BA=E4=BB=AA?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../application/brandy/brandy_standard/thread_pri_init.c | 1 + .../fd230/nativeapp/nativeui/main/src/MainModel.cpp | 2 +- .../nativeapp/nativeui/set_dial/include/SetDialModel.h | 2 +- code/sdk/zhihui/drivers/gyro/service/gyro_hal.h | 4 +++- code/sdk/zhihui/drivers/gyro/service/gyro_service.c | 2 ++ code/sdk/zhihui/utils/custom_save_runtime.c | 2 +- code/sdk/zhihui/utils/custom_utils.c | 6 +++--- 7 files changed, 12 insertions(+), 7 deletions(-) diff --git a/code/sdk/application/brandy/brandy_standard/thread_pri_init.c b/code/sdk/application/brandy/brandy_standard/thread_pri_init.c index cc5570e4b..3b0ad1e8e 100644 --- a/code/sdk/application/brandy/brandy_standard/thread_pri_init.c +++ b/code/sdk/application/brandy/brandy_standard/thread_pri_init.c @@ -531,6 +531,7 @@ uapi_pm_remove_sleep_veto(PM_ID_DEBUG); #endif #ifdef ENABLE_BN02 + custom_i2c_init(I2C_BUS_0); uapi_bp_service_init(); #endif diff --git a/code/sdk/application/wearable/fd230/nativeapp/nativeui/main/src/MainModel.cpp b/code/sdk/application/wearable/fd230/nativeapp/nativeui/main/src/MainModel.cpp index 60d5d03c4..954a6abc1 100644 --- a/code/sdk/application/wearable/fd230/nativeapp/nativeui/main/src/MainModel.cpp +++ b/code/sdk/application/wearable/fd230/nativeapp/nativeui/main/src/MainModel.cpp @@ -63,7 +63,7 @@ namespace OHOS {DIAL_CLOCK_5, "Custom_5", CUSTOM_CLOCK5_DIALPER_PATH, DEFAULT_TASK_PERIOD}, // 表盘 Id 4 }; //默认表盘 - #if U8_TEST_DIAL + #ifdef BOARD_U8 static const char* DEFAULT_CUSTOM_DIAL_PATH = "/user/dial/res_dial/classic.bin"; #else static const char* DEFAULT_CUSTOM_DIAL_PATH = "/user/dial/res_dial/obsidianrhythm.bin"; diff --git a/code/sdk/application/wearable/fd230/nativeapp/nativeui/set_dial/include/SetDialModel.h b/code/sdk/application/wearable/fd230/nativeapp/nativeui/set_dial/include/SetDialModel.h index 22db9cc18..b71efc9ce 100644 --- a/code/sdk/application/wearable/fd230/nativeapp/nativeui/set_dial/include/SetDialModel.h +++ b/code/sdk/application/wearable/fd230/nativeapp/nativeui/set_dial/include/SetDialModel.h @@ -3,7 +3,7 @@ #define SET_DIAL_MODEL_H #include "AppViewIDs.h" #include "SetDialInfo.h" -#define U8_TEST_DIAL 1 + namespace OHOS { // 表盘类型 diff --git a/code/sdk/zhihui/drivers/gyro/service/gyro_hal.h b/code/sdk/zhihui/drivers/gyro/service/gyro_hal.h index 0caa9615e..2e732483f 100644 --- a/code/sdk/zhihui/drivers/gyro/service/gyro_hal.h +++ b/code/sdk/zhihui/drivers/gyro/service/gyro_hal.h @@ -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 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 diff --git a/code/sdk/zhihui/drivers/gyro/service/gyro_service.c b/code/sdk/zhihui/drivers/gyro/service/gyro_service.c index 521391dc0..a0fa4109f 100644 --- a/code/sdk/zhihui/drivers/gyro/service/gyro_service.c +++ b/code/sdk/zhihui/drivers/gyro/service/gyro_service.c @@ -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"; diff --git a/code/sdk/zhihui/utils/custom_save_runtime.c b/code/sdk/zhihui/utils/custom_save_runtime.c index 603373e67..318bcff01 100644 --- a/code/sdk/zhihui/utils/custom_save_runtime.c +++ b/code/sdk/zhihui/utils/custom_save_runtime.c @@ -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); diff --git a/code/sdk/zhihui/utils/custom_utils.c b/code/sdk/zhihui/utils/custom_utils.c index 93c4bffb2..12d076e26 100644 --- a/code/sdk/zhihui/utils/custom_utils.c +++ b/code/sdk/zhihui/utils/custom_utils.c @@ -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 -- 2.17.1