cun
This commit is contained in:
@ -26,6 +26,7 @@
|
||||
#include "./sensor/MMC56.h"
|
||||
#include "./sensor/BMP280.h"
|
||||
#include "./sensor/AK8963.h"
|
||||
#include "./sensor/WF282A.h"
|
||||
#include "asm/rtc.h"
|
||||
#include "system/timer.h"
|
||||
#include "adv_time_stamp_setting.h"
|
||||
@ -167,7 +168,11 @@ void sensor_collect_task(void){
|
||||
if(interval >= 4){
|
||||
interval = 0;
|
||||
SL_data_index = 0;
|
||||
#if BMP280
|
||||
bmp280_read_data(&temperature, &pressure);//每40ms读取一次
|
||||
#else
|
||||
WF_GET_Temperature_Pressure(&temperature, &pressure);
|
||||
#endif
|
||||
for(int i = 0;i<MPU_FIFO_LEN;i++){
|
||||
send_data.sensor_package[i].temperature = (int16_t)(temperature * 1000.0f);
|
||||
send_data.sensor_package[i].pressure = (int32_t)(pressure * 1000.0f);
|
||||
@ -260,14 +265,14 @@ void data_log(uint8_t* data){
|
||||
float pressure = (float)press_raw / 1000.0f;
|
||||
|
||||
// 打印解析后的数据
|
||||
// if(i % 8 == 0){
|
||||
// printf(" ==================ble index: %d\n", *p);
|
||||
// printf("Package[%d]:\n", i);
|
||||
// printf(" ACC(g): x=%.3f, y=%.3f, z=%.3f\n", acc_g[0], acc_g[1], acc_g[2]);
|
||||
// printf(" GYR(dps):x=%.3f, y=%.3f, z=%.3f\n", gyr_dps[0], gyr_dps[1], gyr_dps[2]);
|
||||
// printf(" MAG(Gs): x=%.3f, y=%.3f, z=%.3f\n", mag_gauss[0], mag_gauss[1], mag_gauss[2]);
|
||||
// printf(" TEMP(C): %.3f, PRESS(Pa): %.3f\n", temperature, pressure);
|
||||
// }
|
||||
if(i % 8 == 0){
|
||||
printf(" ==================ble index: %d\n", *p);
|
||||
printf("Package[%d]:\n", i);
|
||||
printf(" ACC(g): x=%.3f, y=%.3f, z=%.3f\n", acc_g[0], acc_g[1], acc_g[2]);
|
||||
printf(" GYR(dps):x=%.3f, y=%.3f, z=%.3f\n", gyr_dps[0], gyr_dps[1], gyr_dps[2]);
|
||||
printf(" MAG(Gs): x=%.3f, y=%.3f, z=%.3f\n", mag_gauss[0], mag_gauss[1], mag_gauss[2]);
|
||||
printf(" TEMP(C): %.3f, PRESS(Pa): %.3f\n", temperature, pressure);
|
||||
}
|
||||
|
||||
}
|
||||
// printf("--- End of Packet ---\n\n");
|
||||
@ -511,7 +516,11 @@ void test_func(void){
|
||||
|
||||
SL_SC7U22_Config();
|
||||
mmc5603nj_init();
|
||||
bmp280_init();
|
||||
#if BMP280
|
||||
BMP280_init();
|
||||
#else
|
||||
WF_Init();
|
||||
#endif
|
||||
os_task_create(BLE_send_fuc,NULL,5,1024,32,"BLE_send_fuc");
|
||||
os_task_create(sensor_collect_task,NULL,5,1024,32,"sensor_collect_task");
|
||||
// create_process(&test_id, "sensor_test",NULL,data_send_task ,3);
|
||||
|
||||
Reference in New Issue
Block a user