From: p15692025051 <846603105@qq.com> Date: Mon, 17 Apr 2023 01:27:36 +0000 (+0800) Subject: GH3018灯亮起延时问题处理 X-Git-Url: http://git.snicker.com.cn/css/static/gitweb.css?a=commitdiff_plain;h=d365403e598bb6a16034dc864b6755821f442bb2;p=mirrors%2FASR1603_G5.git GH3018灯亮起延时问题处理 --- diff --git a/2.sdk/Helios_SDK/services/microPython/ports/quectel/core/source/modHsensor_GH3018.c b/2.sdk/Helios_SDK/services/microPython/ports/quectel/core/source/modHsensor_GH3018.c index 0883f76c..98ddaabc 100644 --- a/2.sdk/Helios_SDK/services/microPython/ports/quectel/core/source/modHsensor_GH3018.c +++ b/2.sdk/Helios_SDK/services/microPython/ports/quectel/core/source/modHsensor_GH3018.c @@ -147,9 +147,10 @@ int SC7A20_init(void); extern signed char SL_SC7A20_PEDO_KCAL_WRIST_SLEEP_SWAY_L_ALGO(void); extern unsigned char Gsensor_init_flag ; extern void hal_gh30x_int_handler(void); + void sensor_thread_entry(void * argv) { - + static int sc7a20_timer = 0; while(1) { if(is_gh3018 == 1 && is_open_gh3018 == 1)//处理Hsensor中断数据 @@ -162,17 +163,22 @@ void sensor_thread_entry(void * argv) if(GH3018_irq_flag) { hal_gh30x_int_handler(); - Helios_ExtInt_Enable(g_GH3018->irq); GH3018_irq_flag = 0; } - - Helios_msleep(10); + Helios_msleep(1); }else { - Helios_msleep(1000); - SL_SC7A20_PEDO_KCAL_WRIST_SLEEP_SWAY_L_ALGO(); + sc7a20_timer++; + Helios_msleep(1); + if(sc7a20_timer>1000) + { + SL_SC7A20_PEDO_KCAL_WRIST_SLEEP_SWAY_L_ALGO(); + sc7a20_timer = 0; + } + } + } } @@ -183,6 +189,7 @@ void sensor_timerout_cb(void) void GH3018_irq_cb(void) { GH3018_irq_flag = 1; + Helios_ExtInt_Enable(g_GH3018->irq); } /* **函数名:GH3018_Init @@ -244,7 +251,7 @@ mp_obj_t mp_GH3018_init(mp_obj_t self_in) Helios_ThreadAttr ThreadAttr = { .name = "GH3018", .stack_size = 1024*10, - .priority = 100, + .priority = 300, .entry = sensor_thread_entry, .argv = NULL };