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中断数据
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;
+ }
+
}
+
}
}
void GH3018_irq_cb(void)
{
GH3018_irq_flag = 1;
+ Helios_ExtInt_Enable(g_GH3018->irq);
}
/*
**函数名:GH3018_Init
Helios_ThreadAttr ThreadAttr = {
.name = "GH3018",
.stack_size = 1024*10,
- .priority = 100,
+ .priority = 300,
.entry = sensor_thread_entry,
.argv = NULL
};