screen_context_t *sc = power_display_get_screen_context();
sc->screen_off_time_interval = screen_off_time;
}
-
+extern errcode_t hal_custom_resume_touch(void);
static uint32_t action_display_lcd_on()
{
last_screen_on_timestamp = get_display_timestamp();
#endif
if ((g_pms_lcd_on_first_flag == false) && (g_pms_dpu_ready == false)) {
// touch_screen_resume();// open touch/
- if (touch_resume_in_cmd_queue() != 0)
- post_func_to_graphic(touch_screen_resume); // open touch 太耗时,放到GraphicService里延迟执行,加快亮屏速度。
+ ret = hal_custom_resume_touch(); // 更高优先级处理touch
+ if ( ret != 0)
+ {
+ POWER_DISPLAY_PRINT_ERR(0, "hal_custom_resume_touch error ret=%x , resume touch in graphic thread\r\n", ret);
+ touch_screen_resume();// post_func_to_graphic(touch_screen_resume); // open touch 太耗时,放到GraphicService里延迟执行,加快亮屏速度。
+ }
rotary_encoder_resume();
}
#ifdef CONFIG_CLDO1PD_SUPPORT
/*
* @Author: penglei 1624952103@qq.com
* @Date: 2024-08-08 16:33:23
- * @LastEditors: penglei 1624952103@qq.com
- * @LastEditTime: 2024-09-28 20:17:37
+ * @LastEditors: SnickerSun snickersun@163.com
+ * @LastEditTime: 2024-10-09 12:08:23
* @FilePath: /FD230/code/sdk/drivers/peripheral/vibrator/service/vibrator_service.cpp
* @Description:
*
-void do_vibrator_cmd(vibrator_cmd_t cmd)
+errcode_t do_vibrator_cmd(vibrator_cmd_t cmd)
{
int ret;
vibrator_cmd_t mail = {0};
+ mail.cmd_type = cmd.cmd_type;
mail.cycle_time_ms = cmd.cycle_time_ms;
mail.duty = cmd.duty;
mail.duration_time_ms = cmd.duration_time_ms;
sizeof(vibrator_cmd_t), 0);
if (ret != OSAL_SUCCESS) {
PRINT("Error vibrator Check MSG 0x%02X send failed! err=0x%x! \r\n",cmd, ret);
+ return ret;
}
+ return ERRCODE_SUCC;
}
-
+extern void touch_screen_resume(void);
static void vibrator_service_check_task(void *arg)
{
unused(arg);
continue;
}
- g_VibratorFunc( mail.duty , mail.cycle_time_ms, mail.duration_time_ms);
-
+ switch(mail.cmd_type)
+ {
+ case 0:
+ g_VibratorFunc( mail.duty , mail.cycle_time_ms, mail.duration_time_ms);
+ break;
+ case 1:
+ touch_screen_resume();
+ break;
+ }
+
}
}
void create_vib_queue(void)
app_task_definition_t taskcfg={0};
taskcfg.create_queue_handle = create_vib_queue;
taskcfg.attr.name="vib_service";
- taskcfg.attr.priority = TASK_PRIORITY_TRANSMIT;
+ taskcfg.attr.priority = TASK_PRIORITY_SDK;
taskcfg.attr.stack_size = APP_BOARD_TASK_SIZE;
taskcfg.func = vibrator_service_check_task;
taskcfg.use_mem = USE_EXTEND_MEM;
typedef struct {
+ uint32_t cmd_type;
uint32_t duty; //占空比
uint32_t cycle_time_ms; //频率
uint32_t duration_time_ms;//震动时间
/**
* 测试指令 参数cmd 选项: VIB_CMD_MSG_ONE VIB_CMD_MSG_TWO VIB_CMD_MSG_THREE
*/
-extern void do_vibrator_cmd(vibrator_cmd_t cmd);
+extern errcode_t do_vibrator_cmd(vibrator_cmd_t cmd);
// UI 界面震动一次接口
void ui_api_vibrate_once_func(void);
#include "vibrator.h"
// #define VIB_DEBUG
-
#ifdef VIB_USE_PWM
#define VIBRATOR_GPIOPPIN S_AGPIO_R2
// #define VIBRATORPIN_MODE HAL_PIO_FUNC_PWMP1_M2
pwm_start(duty,cycle_time_ms);
- LOS_Msleep(duration_time_ms);
-
+ // LOS_Msleep(duration_time_ms);
+ LOS_Mdelay(duration_time_ms);
+
pwm_stop();
vibrating = 0;
hal_custom_VibratorFunc(duty,cycle,duration);
return ERRCODE_SUCC;
}
+extern errcode_t hal_custom_resume_touch(void);
+static uint32_t resume_touch(uint8_t *para, uint32_t paraLen, char *strCommonCmd)
+{
+ PRINT("VIBRATORTEST ATCMD Custom_resume_touch \n");
+ hal_custom_resume_touch();
+ return ERRCODE_SUCC;
+}
static const at_cmd_table_t g_vibrator_cmd[] = {
{ (char *)"AT^VIBRATORTEST", vibrator_do_test, (char *)"1" },
+ { (char *)"AT^RESUMETOUCH", resume_touch, (char *)"1" },
+
};
at_cmd_table_t *get_vibrator_cmd_table(uint32_t *cmd_count)
#include "vibrator_hal.h"
#include "vibrator_service.h"
#include "debug_print.h"
-void hal_custom_VibratorFunc(uint16_t duty , uint16_t cycle_time_ms,uint16_t duration_time_ms)
+errcode_t hal_custom_VibratorFunc(uint16_t duty , uint16_t cycle_time_ms,uint16_t duration_time_ms)
{
vibrator_cmd_t cmd = {0};
cmd.cycle_time_ms = cycle_time_ms;
cmd.duration_time_ms = duration_time_ms;
cmd.duty = duty;
- do_vibrator_cmd(cmd);
-
+ return do_vibrator_cmd(cmd);
-}
\ No newline at end of file
+}
+
+errcode_t hal_custom_resume_touch(void)
+{
+ vibrator_cmd_t cmd = {0};
+
+ PRINT("hal_custom_resume_touch\r\n");
+ cmd.cmd_type = 1;
+ return do_vibrator_cmd(cmd);
+}
#endif /* __cplusplus */
#endif /* __cplusplus */
-void hal_custom_VibratorFunc(uint16_t duty , uint16_t cycle_time_ms,uint16_t duration_time_ms);
+errcode_t hal_custom_VibratorFunc(uint16_t duty , uint16_t cycle_time_ms,uint16_t duration_time_ms);
#ifdef __cplusplus
#if __cplusplus
}