cywee_inactivity_mode_change(INACTIVITY_MODE_SEDENTARY_AND_NAP);
}
}
- else if(uapi_dev_runtime_get_sleep_monitoring_status())
- {
- if(uapi_dev_runtime_get_sleep_status())
- {
- uapi_dev_runtime_set_absolute_static_status(1);
- cywee_get_sleep_data(1);
- }
- else
- {
- cywee_inactivity_mode_change(INACTIVITY_MODE_NOTHING);
- cywee_inactivity_mode_change(INACTIVITY_MODE_SLEEPING);
- }
- }
+ // else if(uapi_dev_runtime_get_sleep_monitoring_status())
+ // {
+ // if(uapi_dev_runtime_get_sleep_status())
+ // {
+ // uapi_dev_runtime_set_absolute_static_status(1);
+ // cywee_get_sleep_data(1);
+ // }
+ // else
+ // {
+ // cywee_inactivity_mode_change(INACTIVITY_MODE_NOTHING);
+ // cywee_inactivity_mode_change(INACTIVITY_MODE_SLEEPING);
+ // }
+ // }
wearstatus = 0;
}
#define re_err(x, ...) \
do { \
- PRINT("[ERROR]%s(%d): "x"\r\n", __FUNCTION__, __LINE__, ##__VA_ARGS__); \
+ PRINT("[ERROR]%s(%d): " x "\r\n", __FUNCTION__, __LINE__, ##__VA_ARGS__); \
} while (0)
#define re_warning(x, ...) \
do { \
- PRINT("[WARNING]%s(%d): "x"\r\n", __FUNCTION__, __LINE__, ##__VA_ARGS__); \
+ PRINT("[WARNING]%s(%d): " x "\r\n", __FUNCTION__, __LINE__, ##__VA_ARGS__); \
} while (0)
#elif defined ROTARYENCODER_HX3508
hx3508_get_chip_id(id);
#endif
+}
+
+uint8_t rotary_get_stand_still(void)
+{
+ uint8_t stand_still = 1;
+#ifdef ROTARYENCODER_HX3507
+ stand_still = hx3507_get_stand_still();
+#elif defined ROTARYENCODER_MIXO
+ stand_still = mixo_get_stand_still();
+#elif defined ROTARYENCODER_HX3508
+ stand_still = hx3508_get_stand_still();
+#endif
+ return stand_still;
}
\ No newline at end of file
* @Author: penglei 1624952103@qq.com
* @Date: 2025-07-29 10:06:52
* @LastEditors: penglei 1624952103@qq.com
- * @LastEditTime: 2025-11-12 12:29:12
+ * @LastEditTime: 2026-01-13 18:02:35
* @FilePath: /FD230/code/sdk/zhihui/drivers/rotary_encoder/rotary_encoder_drv.h
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
ext_errno rotary_encoder_module_deinit(void);
ext_errno encoder_info_process(void);
void rotary_get_chip_id(uint16_t *id);
+uint8_t rotary_get_stand_still(void);
#endif
\ No newline at end of file
* @Author: penglei 1624952103@qq.com
* @Date: 2024-08-08 16:33:23
* @LastEditors: penglei 1624952103@qq.com
- * @LastEditTime: 2025-11-28 12:07:56
+ * @LastEditTime: 2026-01-13 18:02:48
* @FilePath: /FD230/code/sdk/drivers/peripheral/vibrator/service/vibrator_service.cpp
* @Description:
*
#include "custom_save_runtime.h"
#include "input_app.h"
+#include "rotary_encoder_drv.h"
+
+
void custom_VibratorFunc_int(int vibratorType)
{
uapi_save_runtime_log(RUNTIME_LOG_MOTOR_START);
}
+static void custom_VibratorFunc_for_encoder(int vibratorType)
+{
+ uapi_save_runtime_log(RUNTIME_LOG_MOTOR_START);
+
+ //忽略系统调用参数,只按照configmodel里保存的值来震动
+ uint8_t vibmod = uapi_dev_runtime_get_vibmod();
+
+ vibrator_cmd_t mail = {1};
+ if(vibratorType == 4)
+ vibmod = 4;
+ else if(vibratorType == 5)
+ vibmod = 5;
+ switch (vibmod)
+ {
+ case 5:
+ mail.cycle_time_ms = 235;
+ mail.duty = 65;
+ mail.duration_time_ms = 100;
+ break;
+ case 4:
+ mail.cycle_time_ms = 235;
+ mail.duty = 65;
+ mail.duration_time_ms = 2000;
+ break;
+ case 3:
+ mail.cycle_time_ms = 235;
+ mail.duty = 50;
+ mail.duration_time_ms = 60;
+ break;
+ case 2:
+ mail.cycle_time_ms = 235;
+ mail.duty = 50;
+ mail.duration_time_ms = 40;
+ break;
+ case 1:
+ mail.cycle_time_ms = 235;
+ mail.duty = 50;
+ mail.duration_time_ms = 20;
+ break;
+ default:
+ break;
+ }
+ // PRINT("cycle_time_ms[%d], duty[%d], duration_time_ms[%d] \n",mail.cycle_time_ms,mail.duty,mail.duration_time_ms);
+ do_vibrator_cmd(mail);
+}
+
+
void custom_VibratorFunc(OHOS::VibratorType vibratorType)
{
switch (vibratorType)
{
case OHOS::VibratorType::VIBRATOR_TYPE_ONE:
- custom_VibratorFunc_int(1);
+ custom_VibratorFunc_for_encoder(1);
break;
case OHOS::VibratorType::VIBRATOR_TYPE_TWO:
- custom_VibratorFunc_int(2);
+ custom_VibratorFunc_for_encoder(2);
break;
case OHOS::VibratorType::VIBRATOR_TYPE_THREE:
- custom_VibratorFunc_int(3);
+ custom_VibratorFunc_for_encoder(3);
break;
}
}
case 0:
g_VibratorFunc( mail.duty , mail.cycle_time_ms, mail.duration_time_ms);
break;
+
case 1:
+
+ if(rotary_get_stand_still())
+ {
+ break;
+ }
+
+ g_VibratorFunc( mail.duty , mail.cycle_time_ms, mail.duration_time_ms);
+ break;
+
+ case 2:
// touch_screen_resume();
break;
}