From: p15692025051 <846603105@qq.com> Date: Thu, 1 Feb 2024 07:15:02 +0000 (+0800) Subject: 血压mcu X-Git-Url: http://git.snicker.com.cn/?a=commitdiff_plain;h=aa451760276d36d89e7f7868502efadb0dc31bde;p=mirrors%2FASR3603_Z5.git 血压mcu --- diff --git a/1.doc/K18/BLE_Watch/code/proj_main.c b/1.doc/K18/BLE_Watch/code/proj_main.c index b96e233c..4a59a477 100644 --- a/1.doc/K18/BLE_Watch/code/proj_main.c +++ b/1.doc/K18/BLE_Watch/code/proj_main.c @@ -74,7 +74,7 @@ void user_custom_parameters(void) __jump_table.addr.addr[2] = 0x78; __jump_table.addr.addr[3] = 0x56; __jump_table.addr.addr[4] = 0x34; - __jump_table.addr.addr[5] = 0x12; + __jump_table.addr.addr[5] = 0xc0; __jump_table.system_clk = SYSTEM_SYS_CLK_48M; } @@ -249,13 +249,29 @@ void save_sys_config(void) } - +os_timer_t m_task_main_5ms_timer;// +void main_data_treating(void *arg) +{ + uart0_receive();//串口0接收数据处理 + /////////////////////血压测量///////////////////////////// + BP_test(); + // /////////////////////心率测量///////////////////////////// + HRS_test(); + // /////////////////////心率变异性测量///////////////////////////// + // HRV_test(); + // /////////////////////血氧测量///////////////////////////// + SPO2_test(); + // /////////////////////中医测量///////////////////////////// + // YYL_test(); + // //////////////////////情绪测量////////////////////////////////// + // EMO_test(); +} ///////main函数///////////////////////////////////////////////// void user_entry_after_ble_init(void) { co_printf("\r\n\r\n--------init_sys_config--------\r\n\r\n"); - system_set_tx_power(RF_TX_POWER_POS_10dBm); //设置发射功率为10DB + //system_set_tx_power(RF_TX_POWER_POS_10dBm); //设置发射功率为10DB system_sleep_disable(); //关睡眠 simple_peripheral_init(); //HR_EN = PA0 //心率使能, @@ -302,6 +318,8 @@ void user_entry_after_ble_init(void) timer_init(TIMER0,10000,TIMER_PERIODIC);//10ms timer_run(TIMER0); NVIC_EnableIRQ(TIMER0_IRQn); + // os_timer_init(&m_task_main_5ms_timer, main_data_treating, NULL); + // os_timer_start(&m_task_main_5ms_timer, 500, true); while(1) { diff --git a/1.doc/K18/BLE_Watch/components/driver/driver_timer.c b/1.doc/K18/BLE_Watch/components/driver/driver_timer.c index de912b7e..de7818bb 100644 --- a/1.doc/K18/BLE_Watch/components/driver/driver_timer.c +++ b/1.doc/K18/BLE_Watch/components/driver/driver_timer.c @@ -314,6 +314,7 @@ uint8_t timer_init(uint32_t timer_addr, uint32_t count_us, uint8_t run_mode) } unsigned int timer0_count = 0; extern unsigned int timestamp_d; //秒的时间戳,需要配合RTC使用 +extern unsigned int uart0_timer;//判断主机是否在线的超时时间计数 __attribute__((weak)) __attribute__((section("ram_code"))) void timer0_isr_ram(void) { timer_clear_interrupt(TIMER0); @@ -322,6 +323,7 @@ __attribute__((weak)) __attribute__((section("ram_code"))) void timer0_isr_ram(v { timer0_count=0; timestamp_d++; + uart0_timer++; //co_printf("timer0_isr_ram:0\r\n"); } // diff --git a/1.doc/K18/BLE_Watch/keil/feedback.txt b/1.doc/K18/BLE_Watch/keil/feedback.txt index b0f2c347..b024b691 100644 --- a/1.doc/K18/BLE_Watch/keil/feedback.txt +++ b/1.doc/K18/BLE_Watch/keil/feedback.txt @@ -1,4 +1,4 @@ -;## ARM Linker, 5050106: Last Updated: Fri Jan 26 10:56:02 2024 +;## ARM Linker, 5050106: Last Updated: Thu Feb 01 14:56:04 2024 ;VERSION 0.2 ;FILE acpower_add_doublefre.o acPower_add_doublefre_init <= USED 0 @@ -306,6 +306,8 @@ l2cc_dbg_pdu_unpack <= USED 0 ;FILE l2cm.o ;FILE lib_hr.o amplitudevalue <= USED 0 +bubble <= USED 0 +change_sampling_rate_simplified <= USED 0 compute_bp_feature <= USED 0 convolution <= USED 0 corrcoef <= USED 0 @@ -318,21 +320,32 @@ get_emotion_pi <= USED 0 get_hr <= USED 0 get_pi <= USED 0 get_sleep_time <= USED 0 +ha_ismoving <= USED 0 +ha_iswarable <= USED 0 heart_rate <= USED 0 +init_algorithm <= USED 0 init_sleep_data <= USED 0 init_sleep_time <= USED 0 +insertsort <= USED 0 is_good_ppg <= USED 0 is_kpt <= USED 0 isperiodic <= USED 0 isppgsignal <= USED 0 load_bp_model <= USED 0 load_gen_info <= USED 0 +max_simplified <= USED 0 +mean <= USED 0 +meanfilter <= USED 0 +medianfilter <= USED 0 merge_sample_feature <= USED 0 moving_value <= USED 0 periodic_value <= USED 0 periodicvalue <= USED 0 +ppg_correction <= USED 0 +ppg_fearure_extractor_simplified <= USED 0 ppg_hrv_midvalue <= USED 0 ppg_keypoints_extractor_simplified <= USED 0 +ppg_midvalue <= USED 0 quicksort <= USED 0 version_get_number <= USED 0 version_get_string <= USED 0 @@ -890,6 +903,9 @@ __asm___11_proj_main_c_571a19f4____REVSH <= USED 0 __asm___11_proj_main_c_571a19f4____RRX <= USED 0 ;FILE rwble_hl.o ;FILE sensor_drive.o +EMO_test <= USED 0 +HRV_test <= USED 0 +YYL_test <= USED 0 __asm___14_sensor_drive_c_eae9c459____REV16 <= USED 0 __asm___14_sensor_drive_c_eae9c459____REVSH <= USED 0 __asm___14_sensor_drive_c_eae9c459____RRX <= USED 0 @@ -972,12 +988,14 @@ system_power_off <= USED 0 system_prevent_sleep_clear <= USED 0 system_prevent_sleep_set <= USED 0 system_set_rf_power <= USED 0 +system_set_tx_power <= USED 0 system_sleep_enable <= USED 0 val_to_str <= USED 0 ;FILE uart.o __asm___6_uart_c_02229386____REV16 <= USED 0 __asm___6_uart_c_02229386____REVSH <= USED 0 __asm___6_uart_c_02229386____RRX <= USED 0 +get_timestamp <= USED 0 uart0_send <= USED 0 ;FILE user_bond_manage.o ble_bond_addr_check_result <= USED 0 @@ -1002,5 +1020,7 @@ vc9202_usr_stop_sampling <= USED 0 ;FILE vcsportmotionalgo.o version_info_sportmotion <= USED 0 ;FILE yyl_pfev01.o +YYL_Init_PFE <= USED 0 +YYL_Output_PFE <= USED 0 YYL_Output_PFE_Array_Clear <= USED 0 YYL_PFE_Get_Current_Version <= USED 0 diff --git a/1.doc/K18/BLE_Watch/keil/uart.c b/1.doc/K18/BLE_Watch/keil/uart.c index a1cb9746..7df467c9 100644 --- a/1.doc/K18/BLE_Watch/keil/uart.c +++ b/1.doc/K18/BLE_Watch/keil/uart.c @@ -116,13 +116,30 @@ __attribute__((section("ram_code"))) void uart0_isr_ram(void) } } - +unsigned int uart0_timer = 0; void uart0_receive(void) { - + if(uart0_timer > 100)//100秒没数据,关闭测试 + { + uart0_timer = 0; + send_bp_data_flag=0;//发送血压数据标致位 + send_hrs_data_flag=0;//发送心率数据标标致位 + send_hrv_data_flag=0;//发送心率变异性标致位 + send_spo2_data_flag=0;//发送血氧数值标致位 + send_temp_data_flag=0;//发送温度标致位 + send_gs_data_flag=0;//发送gsensor数据标致位 + send_sleep_data_flag=0;//发送sleep数据标致位 + send_step_data_flag=0;//发送step数据标致位 + send_wear_data_flag=0;//发送wear数据标致位 + co_printf("\nHost no response!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n"); + } if(uart0_flag == 0) + { + return ; - + } + + uart0_timer = 0;//有串口数据,说明主机在线 if(uart0_data_len >0) co_printf("uart_read:%s\n",uart0_rivce_data); //co_printf("uart0_receive:%s\n",uart0_rivce_data);