GH3018驱动修改
authorp15692025051 <846603105@qq.com>
Thu, 20 Apr 2023 03:25:25 +0000 (11:25 +0800)
committerp15692025051 <846603105@qq.com>
Thu, 20 Apr 2023 03:25:25 +0000 (11:25 +0800)
2.sdk/gui/lv_drivers/indev/gh3018.c

index 80055f4..da05618 100644 (file)
@@ -94,8 +94,14 @@ static void DelayInUs(unsigned int us)
 
 static void gh3018_start(void)
 {
-    gh3018_en_gpio_enable(true);
     Timer0_Switch(1);
+    hal_gh30x_int_init();
+    gh3018_en_gpio_enable(false);
+    DelayInUs(10*1000);
+    gh3018_en_gpio_enable(true);
+    DelayInUs(50*1000);
+    int ret = gh30x_module_init();
+    printf("gh3018_start:ret:%d",ret);
     
     gh30x_module_start_without_adt(measure_mode);
 }
@@ -121,7 +127,8 @@ void gh3018_init(void)
         sensor_drv.sensor_process_data = hal_gh30x_int_handler;
         sensor_drv_register(GH3018_ID,&sensor_drv);
     }
-    gh30x_module_init();
+    gh3018_create_hisr();
+    hal_gh30x_int_init();
     Timer0_Switch(0);
 }
 
@@ -151,10 +158,10 @@ static bool is_measuring_flag = false;
 void gh3018_measure_hr_start(void)
 {
     sys_pm_wakeup_no_lcd();
-
+    printf("gh3018_measure_hr_start!!!!!!!!");
     Timer0_Switch(1);
     measure_mode = RUN_MODE_ADT_HB_DET;
-    hal_gh30x_int_init();
+    
     sensor_task_send_message(GH3018_ID,SENSOR_MSG_START);
 }
 
@@ -398,7 +405,7 @@ void hal_gh30x_int_init(void)
     printf("GH3018 ID : 0x%02x\n",get_gh3018_id());
     
     
-    gh3018_create_hisr();
+    
     gpio_set_direction(gh3018_info.irq_pin, GPIO_IN);
     gpio_register_int_handler(gh3018_info.irq_pin, gh3018_isr_callback);
     gpio_enable_edge_detect(gh3018_info.irq_pin, EDGE_FLAG_RISE);