From: SnickerSun Date: Wed, 19 Jun 2024 10:22:31 +0000 (+0800) Subject: 优化vib震动参数 X-Git-Tag: release_V1.2.70_20241020_135402~981^2 X-Git-Url: http://git.snicker.com.cn/css/static/gitweb.css?a=commitdiff_plain;h=56982b65326b34d09d69feaa3a00fc74495b8ab3;p=mirrors%2FFD230.git 优化vib震动参数 --- diff --git a/code/sdk/drivers/peripheral/vibrator/service/vibrator_service.cpp b/code/sdk/drivers/peripheral/vibrator/service/vibrator_service.cpp index ab5645a2a..1b3d9ad14 100644 --- a/code/sdk/drivers/peripheral/vibrator/service/vibrator_service.cpp +++ b/code/sdk/drivers/peripheral/vibrator/service/vibrator_service.cpp @@ -48,32 +48,6 @@ static bool g_batter_service_initialled = false; #include "vibrator_hal.h" #include "vibrator.h" #include "custom_utils.h" -void custom_VibratorFunc(OHOS::VibratorType vibratorType) -{ - - vibrator_cmd_t mail = {0}; - switch (vibratorType) - { - case OHOS::VibratorType::VIBRATOR_TYPE_ONE: - mail.cycle_time_ms=200; - mail.duty = 20; - mail.duration_time_ms = 100; - break; - case OHOS::VibratorType::VIBRATOR_TYPE_TWO: - mail.cycle_time_ms=200; - mail.duty = 20; - mail.duration_time_ms = 200; - break; - case OHOS::VibratorType::VIBRATOR_TYPE_THREE: - mail.cycle_time_ms=200; - mail.duty = 20; - mail.duration_time_ms = 500; - break; - } - - do_vibrator_cmd(mail); - -} void custom_VibratorFunc_int(int vibratorType) { @@ -101,6 +75,26 @@ void custom_VibratorFunc_int(int vibratorType) do_vibrator_cmd(mail); } + + +void custom_VibratorFunc(OHOS::VibratorType vibratorType) +{ + + vibrator_cmd_t mail = {0}; + switch (vibratorType) + { + case OHOS::VibratorType::VIBRATOR_TYPE_ONE: + custom_VibratorFunc_int(1); + break; + case OHOS::VibratorType::VIBRATOR_TYPE_TWO: + custom_VibratorFunc_int(2); + break; + case OHOS::VibratorType::VIBRATOR_TYPE_THREE: + custom_VibratorFunc_int(3); + break; + } +} + #define MAG_CHECK_MS 20 static unsigned long g_app_queue;