修改开关抬腕亮屏 55/1 55/head 56/target/1 57/target/1
authorpenglei <1624952103@qq.com>
Fri, 19 Apr 2024 12:20:18 +0000 (20:20 +0800)
committerpenglei <1624952103@qq.com>
Fri, 19 Apr 2024 12:20:18 +0000 (20:20 +0800)
code/sdk/drivers/peripheral/cywee/Inc/cywee_service.h
code/sdk/drivers/peripheral/cywee/service/cywee_service.c
code/sdk/drivers/peripheral/utils/custom_utils.c
code/sdk/drivers/peripheral/utils/custom_utils.h

index 0260d84..d8cb511 100644 (file)
@@ -63,6 +63,9 @@ extern "C" {
 #define CYWEE_SERVICE_CMD_NAP_MODE 0x23
 #define CYWEE_SERVICE_CMD_SLEEPING_MODE 0x24
 
+#define CYWEE_SERVICE_CMD_OPEN_HAND_UPDOWN 0x25
+#define CYWEE_SERVICE_CMD_CLOSE_HAND_UPDOWN 0x26
+
 errcode_t uapi_cywee_service_init(void);
 void uapi_cywee_service_deinit(void);
 
index a546e16..e7c4ce3 100644 (file)
@@ -349,6 +349,15 @@ static void cywee_service_check_task(void const *arg)
         {
             cyw_inactivity_mode_change(INACTIVITY_MODE_SLEEPING);
         }
+        else if (mail.cmd == CYWEE_SERVICE_CMD_OPEN_HAND_UPDOWN)
+        {
+            hand_updown_switch(1);
+        }
+        else if (mail.cmd == CYWEE_SERVICE_CMD_CLOSE_HAND_UPDOWN)
+        {
+            hand_updown_switch(0);
+        }
+
     }
 }
 #define CYWEE_APP_BOARD_MSG_COUNT 50
index 126d847..0532320 100644 (file)
@@ -36,7 +36,7 @@
 #include "time.h"
 
 #include "custom_utils.h"
-#include "cywee_hal.h"
+#include "cywee_service.h"
 
 errcode_t uapi_create_osThread_custom(app_task_definition_t *task_cfg)
 {
@@ -911,34 +911,15 @@ void vibrator_cyclicity(uint16_t duty , uint16_t cycle_time_ms,uint16_t duration
     g_VibratorFunc(duty,cycle_time_ms,duration_time_ms);
 }
 
-void uapi_set_vibrator_level(int level)
-{
-    uint16_t duty =20;
-    uint16_t cycle_time_ms = 200;
-    uint16_t duration_time_ms = 0;
-    switch(level)
-    {
-        case 1:
-            duration_time_ms = 200;
-            break;
-        case 2:
-            duration_time_ms = 500;
-            break;
-        case 3:
-            duration_time_ms = 1000;
-            break;
-        default:
-            break;
-    }
-    g_VibratorFunc(duty,cycle_time_ms,duration_time_ms);
-}
 
 void uapi_take_to_wake(int cmd)
 {
-    hand_updown_switch(cmd);
+    if(cmd == 1)
+        do_cywee_service_check_msg(CYWEE_SERVICE_CMD_OPEN_HAND_UPDOWN,NULL);
+    else 
+        do_cywee_service_check_msg(CYWEE_SERVICE_CMD_CLOSE_HAND_UPDOWN,NULL);
 }
 
-
 #include "lcd_common.h"
 
 void lcd_getid(uint32_t *id)
index e1433e3..7e5bd12 100644 (file)
@@ -79,7 +79,6 @@ errcode_t uapi_get_buildversion(uint8_t *para, uint32_t para_len);
 void uapi_take_to_wake(int cmd);
 
 //开关马达
-void uapi_set_vibrator_level(int level);
 void vibrator_cyclicity(uint16_t duty , uint16_t cycle_time_ms,uint16_t duration_time_ms);
 
 //获取lcd id