低功耗优化,添加抬腕亮屏功能 78/1 78/head
authorpenglei <1624952103@qq.com>
Thu, 25 Apr 2024 01:57:50 +0000 (09:57 +0800)
committerpenglei <1624952103@qq.com>
Thu, 25 Apr 2024 01:57:50 +0000 (09:57 +0800)
code/sdk/drivers/boards/brandy_evb/board_config/board_evb.h
code/sdk/drivers/peripheral/cywee/service/cywee_service.c
code/sdk/drivers/peripheral/cywee/src/main_dml.c
code/sdk/drivers/peripheral/ppg/hx3695/hx3695.c

index 9a4cdaa..1216792 100755 (executable)
@@ -291,7 +291,7 @@ const hal_gpio_config_t g_gpio_function_config[PIN_MAX_NUMBER] = {
 #ifdef ENABLE_CYWEE
     /**G sensor G_INT1 S_AGPIO_L11 G_INT2 S_AGPIO_L19*/
     //{   S_AGPIO_L11, HAL_GPIO_DIRECTION_INPUT, HAL_GPIO_LEVEL_LOW, GPIO_INTERRUPT_RISING_EDGE, cywee_int1_callback },
-    {   S_AGPIO_L19, HAL_GPIO_DIRECTION_INPUT, NULL, GPIO_INTERRUPT_RISING_EDGE, cywee_int1_callback },
+    {   S_AGPIO_L19, HAL_GPIO_DIRECTION_INPUT, NULL, GPIO_INTERRUPT_DEDGE, cywee_int1_callback },
     // {   S_AGPIO_L19, HAL_GPIO_DIRECTION_INPUT, HAL_GPIO_LEVEL_LOW, 0, NULL },
 #endif   
     /**S_AGPIO_R1 GPO alipay默认resetpin*/
index 27f6eb2..392d501 100644 (file)
@@ -401,6 +401,7 @@ errcode_t uapi_cywee_service_init(void)
 void cywee_int1_callback(pin_t pin, uintptr_t param)
 {
     // PRINT("cywee_int1_callback %d 0x%X\n",pin,param);
+    uapi_gpio_clear_interrupt(pin);
     do_cywee_service_check_msg(CYWEE_SERVICE_CMD_TIMER_CHECK, NULL);
 }
 
index a4325f5..793de1b 100644 (file)
@@ -41,10 +41,6 @@ static uint8_t hrs = 0;
 
 uint8_t hrs_mode_state = 0;
 
-static float s_data[25][3] = {0};
-
-static int i = 0;
-
 void hand_updown_switch(int cmd)
 {
     if(cmd == 1)
@@ -856,7 +852,7 @@ int cywee_main_dml(void)
 
     CWM_Sensor_Enable(IDX_REQUEST_SENSOR);
     // //CWM_OS_dbgPrintf("[DBG] %s %d\n", __func__,__LINE__);
-    
+    CWM_Sensor_Enable(IDX_ALGO_WATCH_HANDUP);
     CWM_Sensor_Enable(IDX_ALGO_ACTIVITY_OUTPUT);
     //CWM_Sensor_Enable(IDX_ALGO_INACTIVITY_OUTPUT);
     //CWM_Sensor_Enable(IDX_ALGO_SEDENTARY);
@@ -892,25 +888,5 @@ int cywee_main_dml(void)
 
 void cywee_int_handler(void)
 {
-    // uint64_t ts_ns =CWM_OS_GetTimeNs();
-    
-    // int ret = CWM_CustomSensorInput_Fifo_Start(CUSTOM_ACC, ts_ns , 40*1e6);
-    // CWM_OS_dbgPrintf("cywee_int_handler ts_seconds %d ,  CWM_CustomSensorInput_Fifo_Start ret 0x%X \r\n",ts_ns,ret);
-    // if (ret == 0 )
-    // {
-    //     for (int i = 0; i < 25; i ++) 
-    //     {
-    //         memset(&csd, 0, sizeof(CustomSensorData));
-    //         csd.sensorType = CUSTOM_ACC;
-    //         csd.fData[0] = s_data[i][0];
-    //         csd.fData[1] = s_data[i][1];
-    //         csd.fData[2] = s_data[i][2];
-    //         CWM_CustomSensorInput(&csd);
-    //     }
-        
-    // }
-    // CWM_CustomSensorInput_Fifo_End(CUSTOM_ACC);
-
-    // ret = CWM_Dml_process();
     CWM_Dml_process();
 }
index 8f69c34..a0b7223 100644 (file)
@@ -337,7 +337,6 @@ void hx3695_5000ms_timer_cfg(bool en)
     }\r
     else\r
     {\r
-      PRINT("555\r\n");\r
         hx3695_wear_mode_timers_stop();\r
     }\r
 \r