血压mcu
authorp15692025051 <846603105@qq.com>
Thu, 1 Feb 2024 07:15:02 +0000 (15:15 +0800)
committerp15692025051 <846603105@qq.com>
Thu, 1 Feb 2024 07:15:02 +0000 (15:15 +0800)
1.doc/K18/BLE_Watch/code/proj_main.c
1.doc/K18/BLE_Watch/components/driver/driver_timer.c
1.doc/K18/BLE_Watch/keil/feedback.txt
1.doc/K18/BLE_Watch/keil/uart.c

index b96e233..4a59a47 100644 (file)
@@ -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)         
        {
                
index de912b7..de7818b 100644 (file)
@@ -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");
     }
     //
index b0f2c34..b024b69 100644 (file)
@@ -1,4 +1,4 @@
-;#<FEEDBACK># ARM Linker, 5050106: Last Updated: Fri Jan 26 10:56:02 2024
+;#<FEEDBACK># 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
index a1cb974..7df467c 100644 (file)
@@ -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);