1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889 |
- #include <stdio.h>
- #include <string.h>
- #include <unistd.h>
- #include "algorithm.h"
- #include "cmsis_os2.h"
- #include "ohos_init.h"
- #include "blood.h"
- #define TASK_STACK_SIZE 1024 * 8
- #define TASK_PRIO 25
- uint32_t aun_ir_buffer[500];
- int32_t n_ir_buffer_length;
- uint32_t aun_red_buffer[500];
- int32_t n_sp02;
- int8_t ch_spo2_valid;
- int32_t n_heart_rate;
- int8_t ch_hr_valid;
- uint8_t uch_dummy;
- #define MAX_BRIGHTNESS 255
- static void ExampleTask(void)
- {
-
- uint32_t un_min, un_max, un_prev_data;
- int i;
- int32_t n_brightness;
- float f_temp;
- uint8_t temp_num=0;
- uint8_t temp[6]={0,0,0,0,0,0};
- uint8_t str[100];
- uint8_t dis_hr=0,dis_spo2=0;
- BoardInit();
- maxim_max30102_init();
- printf("\r\n MAX30102 init \r\n");
- for(i = 0;i < 128;i++)
- {
- while(GetInit()==0)
- {
- max30102_read_fifo();
- }
- }
- while(1)
- {
-
- blood_Loop();
- }
- }
- static void ExampleEntry(void)
- {
- osThreadAttr_t attr;
- attr.name = "ExampleTask";
- attr.attr_bits = 0U;
- attr.cb_mem = NULL;
- attr.cb_size = 0U;
- attr.stack_mem = NULL;
- attr.stack_size = TASK_STACK_SIZE;
- attr.priority = TASK_PRIO;
- if (osThreadNew((osThreadFunc_t)ExampleTask, NULL, &attr) == NULL) {
- printf("Failed to create ExampleTask!\n");
- }
- }
- APP_FEATURE_INIT(ExampleEntry);
|