gengxin
author@CHENG <2393524978@qq.com>
Thu, 18 Jan 2024 09:22:13 +0000 (17:22 +0800)
committer@CHENG <2393524978@qq.com>
Thu, 18 Jan 2024 09:22:13 +0000 (17:22 +0800)
2.sdk/sdk/gui/lv_watch/lv_apps/custom_function/heng_ai_tcms.c [new file with mode: 0644]
2.sdk/sdk/gui/lv_watch/lv_apps/custom_function/heng_ai_tcms.h [new file with mode: 0644]

diff --git a/2.sdk/sdk/gui/lv_watch/lv_apps/custom_function/heng_ai_tcms.c b/2.sdk/sdk/gui/lv_watch/lv_apps/custom_function/heng_ai_tcms.c
new file mode 100644 (file)
index 0000000..1043838
--- /dev/null
@@ -0,0 +1,54 @@
+
+
+
+#include "lv_watch.h"
+
+// traditional Chinese medical science
+#ifdef __MMI_CUSTOM_HENGAI_TCMS__
+
+
+static uint8_t s_hengai_tcms_counter = 0;
+static uint8_t s_hengai_tcms_check_flag = 0;
+
+void mmi_hengai_tcms_mission_check(void)
+{
+       if(0 == s_hengai_tcms_check_flag)
+               return;
+       
+       s_hengai_tcms_counter++;
+       HENGAI_TCMS_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: counter=%d\n", __FUNCTION__, __LINE__, s_hengai_tcms_counter);
+       if(HENGAI_TCMS_COUNTER_MAX <= s_hengai_tcms_counter)
+       {
+               uint8_t data_num = 0;
+               HENGAI_TCMS_DATA_T * data_ptr = NULL;
+               uint32_t data_len = (HENGAI_TCMS_COUNTER_MAX + 1) * sizeof(HENGAI_TCMS_DATA_T);
+
+               data_ptr = lv_mem_alloc(data_len);
+               if(NULL == data_ptr)
+                       return;
+               _lv_memset_00(data_ptr, data_len);
+
+               data_num = fr8012haq_YYL_data_get(data_ptr);
+               HENGAI_TCMS_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: array num=%d\n", __FUNCTION__, __LINE__, data_num);
+               if(0 != data_num)
+               {
+                       mmi_protocol_fzd_action_hengai_tcms_data(data_ptr, data_num * sizeof(HENGAI_TCMS_DATA_T));
+               }
+               lv_mem_free(data_ptr);
+
+               s_hengai_tcms_counter = 0;
+       }
+}
+
+void mmi_hengai_tcms_action(void)
+{
+       HENGAI_TCMS_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__);
+
+       mmi_hsensor_yyl_measure_start();
+       s_hengai_tcms_check_flag = 1;
+}
+
+
+
+#endif
+
diff --git a/2.sdk/sdk/gui/lv_watch/lv_apps/custom_function/heng_ai_tcms.h b/2.sdk/sdk/gui/lv_watch/lv_apps/custom_function/heng_ai_tcms.h
new file mode 100644 (file)
index 0000000..585c7f2
--- /dev/null
@@ -0,0 +1,59 @@
+
+
+
+#ifndef __HENG_AI_TCMS_H__
+#define __HENG_AI_TCMS_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifdef LV_CONF_INCLUDE_SIMPLE
+#include "lvgl.h"
+#include "lv_ex_conf.h"
+#else
+#include "../../../lvgl/lvgl.h"
+#include "../../../lv_ex_conf.h"
+#endif
+
+// traditional Chinese medical science
+#ifdef __MMI_CUSTOM_HENGAI_TCMS__
+
+#define __HENGAI_TCMS_DEBUG__
+#ifdef __HENGAI_TCMS_DEBUG__
+#define HENGAI_TCMS_DEBUG_PRINTF(fmt, ...)     printf(fmt, ##__VA_ARGS__)
+#else
+#define HENGAI_TCMS_DEBUG_PRINTF(fmt, ...)
+#endif
+
+
+#define HENGAI_TCMS_COUNTER_MAX        3 // (30)
+
+// yylPFE_OutputData
+typedef struct
+{
+    uint32_t         timestamp;  
+    uint32_t         areaUP;
+    uint16_t         areaUPBase;
+    uint16_t         areaUPHeight;
+    uint32_t         areaDOWN;
+    uint16_t         areaDOWNBase;
+    uint16_t         areaDOWNHeight;
+    uint16_t         RRI;
+    uint16_t         motion;
+}HENGAI_TCMS_DATA_T;
+
+
+void mmi_hengai_tcms_mission_check(void);
+
+void mmi_hengai_tcms_action(void);
+
+
+#endif
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#endif
+