From: CCC <2393524978@qq.com> Date: Mon, 17 Apr 2023 09:58:35 +0000 (+0800) Subject: error X-Git-Url: http://git.snicker.com.cn/?a=commitdiff_plain;h=940e622ee174a830d1a3dfbc63c0841cc6116619;p=mirrors%2FASR3603_Z5.git error --- diff --git a/2.sdk/gui/lv_watch/lv_apps/health_measure/health_measure.c b/2.sdk/gui/lv_watch/lv_apps/health_measure/health_measure.c index 141b1e22..c59ba7e6 100644 --- a/2.sdk/gui/lv_watch/lv_apps/health_measure/health_measure.c +++ b/2.sdk/gui/lv_watch/lv_apps/health_measure/health_measure.c @@ -146,6 +146,10 @@ bool mmi_health_measure_blood_data_process(uint16_t * blood_high_value, uint16_t t_high_value = 120 + rand() % 100; t_low_value = 60 + rand() % 50; +#else + mmi_hsensor_blood_value_get(&t_high_value, &t_low_value); +#endif + if(180 < t_high_value) t_high_value = 180; else if(120 > t_high_value) @@ -155,11 +159,7 @@ bool mmi_health_measure_blood_data_process(uint16_t * blood_high_value, uint16_t t_low_value = 120; else if(60 > t_low_value) t_low_value = 60; - -#else - mmi_hsensor_blood_value_get(&t_high_value, &t_low_value); -#endif - + * blood_high_value = t_high_value; * blood_low_value = t_low_value; @@ -173,15 +173,16 @@ bool mmi_health_measure_spo2_data_process(uint16_t * spo2_value) #ifdef __HEALTH_MEASURE_FAKE_DATA__ srand(Hal_Timer_Get_Counter()); t_value = 95 + rand() % 6; - if(100 < t_value) - t_value = 100; - else if(95 > t_value) - t_value = 95; #else mmi_hsensor_spo2_value_get(&t_value); #endif + if(100 < t_value) + t_value = 100; + else if(95 > t_value) + t_value = 95; + * spo2_value = t_value; return true; diff --git a/2.sdk/gui/lv_watch/lv_apps/health_measure/health_measure.h b/2.sdk/gui/lv_watch/lv_apps/health_measure/health_measure.h index 47fc56d2..5893826d 100644 --- a/2.sdk/gui/lv_watch/lv_apps/health_measure/health_measure.h +++ b/2.sdk/gui/lv_watch/lv_apps/health_measure/health_measure.h @@ -28,7 +28,7 @@ extern "C" { #define HEALTH_MEASURE_DEBUG_PRINTF(fmt, ...) #endif -#define __HEALTH_MEASURE_FAKE_DATA__ +//#define __HEALTH_MEASURE_FAKE_DATA__ #define MMI_HEALTH_MEASURE_HEART_DURATION (44 * 1000) // ms diff --git a/2.sdk/gui/lv_watch/mmi_location/mmi_location.c b/2.sdk/gui/lv_watch/mmi_location/mmi_location.c index 53802412..ca306544 100644 --- a/2.sdk/gui/lv_watch/mmi_location/mmi_location.c +++ b/2.sdk/gui/lv_watch/mmi_location/mmi_location.c @@ -6,9 +6,10 @@ #ifdef __MMI_ZHSX_SUPPORT__ #if USE_GPS -#include "../../../../product/craneg_modem/hal/gps_device/inc/gpsnmeaapi.h" +//#include "../../../../product/craneg_modem/hal/gps_device/inc/gpsnmeaapi.h" +#include "../../../product/craneg_modem/hal/gps_device/inc/gpsnmeaapi.h" #endif -#include "../../modem/mmi_modem_tcp/wifi_scan_task.h" +#include "../modem/mmi_modem_tcp/wifi_scan_task.h" static uint8_t s_watch_location_state = 0; // 0-init; 1-locating @@ -192,6 +193,30 @@ void mmi_watch_location_wifi_stop(void) wifi_scan_destroy(); } +static uint8_t HexStr2Int(char *str_hex, uint8_t str_hex_len) +{ + uint8_t int_value = 0; + uint8_t i = 0, t_value = 0; + char t_char = 0; + + if(NULL == str_hex || 0 == str_hex_len) + return 0; + + for(i = 0; i < str_hex_len; i++) + { + t_char = str_hex[i]; + if('a' <= t_char && 'z' >= t_char) + { + t_char = t_char - 'a' + 'A'; + } + + t_value = ('A' <= t_char) ? (t_char - 'A' + 10) : (t_char - '0'); + int_value = int_value * 16 + t_value; + } + + return int_value; +} + void mmi_watch_location_wifi_scan_cb(WIFI_SCAN_ID_DEF msgid, WifiInfoT *wifi_info) { //if(WIFI_SCAN_MSG_COMPLETE == msgid) @@ -204,7 +229,13 @@ void mmi_watch_location_wifi_scan_cb(WIFI_SCAN_ID_DEF msgid, WifiInfoT *wifi_inf uint8_t i = 0; for(i = 0; i < s_watch_location_data.wifi_data.count; i++) { - _lv_memcpy(&(s_watch_location_data.wifi_data.item[i]), wifi_info->WifiHotspot[i], sizeof(app_adp_wifi_ap_item)); + s_watch_location_data.wifi_data.item[i].rssi = wifi_info->WifiHotspot[i].Rssi; + + uint8_t j = 0; + for(j = 0; j < APP_ADP_WIFI_MAC_LEN; j++) + { + s_watch_location_data.wifi_data.item[i].mac[j] = HexStr2Int(wifi_info->WifiHotspot[i].MacAddr[j * 2], 2); + } } } else