feat: Add rfid feature and .gitignore file
This commit is contained in:
@ -531,7 +531,7 @@ void skiing_tracker_update(skiing_tracker_t *tracker, float *acc_g, float *gyr_d
|
||||
|
||||
|
||||
|
||||
#if 0
|
||||
#if 1
|
||||
float linear_acc_device[3];
|
||||
float linear_acc_world[3];
|
||||
float tmp_world_acc[3];
|
||||
@ -547,7 +547,7 @@ void skiing_tracker_update(skiing_tracker_t *tracker, float *acc_g, float *gyr_d
|
||||
tmp_world_acc[2] * tmp_world_acc[2]);
|
||||
|
||||
static int count = 0;
|
||||
if(count > 10){
|
||||
if(count > 100){
|
||||
xlog("===original(g): x %.2f, y %.2f, z %.2f===\n",acc_g[0],acc_g[1],acc_g[2]);
|
||||
xlog("===world(m/s^2) no g: x %.2f, y %.2f, z %.2f, all %.2f===\n",tmp_world_acc[0],tmp_world_acc[1],tmp_world_acc[2],all_world_mag); //去掉重力加速度
|
||||
xlog("===gyr(dps) : x %.2f, y %.2f, z %.2f===\n",gyr_dps[0],gyr_dps[1],gyr_dps[2]); //angle
|
||||
|
||||
@ -6,6 +6,8 @@
|
||||
#include "tone_player.h"
|
||||
#include "ui_manage.h"
|
||||
#include "gpio.h"
|
||||
#include <math.h>
|
||||
#include <string.h>
|
||||
#include "app_main.h"
|
||||
#include "asm/charge.h"
|
||||
#include "update.h"
|
||||
@ -24,6 +26,8 @@
|
||||
#include "./sensor/MMC56.h"
|
||||
#include "./sensor/BMP280.h"
|
||||
#include "./sensor/AK8963.h"
|
||||
#include "asm/rtc.h"
|
||||
#include "system/timer.h"
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
//宏定义
|
||||
#define ENABLE_XLOG 1
|
||||
@ -64,6 +68,9 @@ typedef struct {
|
||||
// -- 气压计 --
|
||||
int adc_P;
|
||||
int adc_T;
|
||||
// -- 左/右腿 --
|
||||
uint8_t foot; //1:左脚;2:右脚
|
||||
|
||||
} BLE_send_data_t;
|
||||
|
||||
static int count = 0;
|
||||
@ -166,6 +173,7 @@ void start_collect_fuc(void){
|
||||
|
||||
// xlog("=======sensor_read_data END\n");
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@ -290,7 +298,7 @@ void BLE_send_fuc(void){
|
||||
}
|
||||
}
|
||||
|
||||
static u8 bmp280_test_id = 0;
|
||||
|
||||
void xtell_task_create(void){
|
||||
|
||||
#if TCFG_GSENOR_USER_IIC_TYPE
|
||||
@ -311,15 +319,9 @@ void xtell_task_create(void){
|
||||
|
||||
circle_buffer_init(&BLE_send_buff, BLE_send_data, SENSOR_DATA_BUFFER_SIZE, sizeof(BLE_send_data_t));
|
||||
|
||||
bmp280_init();
|
||||
extern void bmp280_test(void);
|
||||
xlog("barometer start measeure\n");
|
||||
// create_process(&bmp280_test_id,"bmp280_test",NULL, bmp280_test, 100);
|
||||
float Temp = 0;
|
||||
float Press = 0;
|
||||
xlog("test_func\n");
|
||||
bmp280_read_data(&Temp, &Press);
|
||||
xlog("Temp:%.2f, Press:%.2f\n",Temp,Press);
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -330,4 +332,40 @@ void xtell_task_create(void){
|
||||
|
||||
void bmp280_test(void){
|
||||
|
||||
}
|
||||
|
||||
void gsensor_test(void){
|
||||
// static signed short combined_raw_data[6];
|
||||
// static int initialized = 0;
|
||||
// static int calibration_done = 0;
|
||||
// char status = 0;
|
||||
// BLE_send_data_t BLE_send_data_tmp;
|
||||
// signed short acc_data_buf[3];
|
||||
// signed short gyr_data_buf[3];
|
||||
// float angle[3];
|
||||
// float quaternion_output[3];
|
||||
|
||||
// // -- 读数据 --
|
||||
// SL_SC7U22_RawData_Read(acc_data_buf,gyr_data_buf);
|
||||
|
||||
// memcpy(&combined_raw_data[0], acc_data_buf, 3 * sizeof(signed short));
|
||||
// memcpy(&combined_raw_data[3], gyr_data_buf, 3 * sizeof(signed short));
|
||||
|
||||
// // -- 四元数 --
|
||||
// status = Q_SL_SC7U22_Angle_Output(0, combined_raw_data, angle,NULL, 0, quaternion_output);
|
||||
|
||||
// // -- 速度计算 --
|
||||
// memcpy(acc_data_buf, &combined_raw_data[0], 3 * sizeof(signed short));
|
||||
// memcpy(gyr_data_buf, &combined_raw_data[3], 3 * sizeof(signed short));
|
||||
// uint16_t speed = sensor_processing_task(acc_data_buf,gyr_data_buf,angle, quaternion_output);
|
||||
|
||||
#if 1
|
||||
if(count >= 5){
|
||||
xlog("==============time============\n");
|
||||
u32 current_ms = sys_timer_get_ms();
|
||||
xlog("====== current system time: %u ms\n", current_ms);
|
||||
count = 0;
|
||||
}
|
||||
count++;
|
||||
#endif
|
||||
}
|
||||
@ -1504,6 +1504,8 @@ unsigned char Q_SL_SC7U22_Angle_Output(unsigned char calibration_en, signed shor
|
||||
SL_SC7U22_Error_cnt2 = 0;
|
||||
SL_SC7U22_Error_cnt = 0;
|
||||
for (sl_i = 0; sl_i < 6; sl_i++) Sum_Avg_Accgyro[sl_i] = Sum_Avg_Accgyro[sl_i] / 50;
|
||||
|
||||
|
||||
Error_Accgyro[0] = 0 - Sum_Avg_Accgyro[0];
|
||||
Error_Accgyro[1] = 0 - Sum_Avg_Accgyro[1];
|
||||
#if ACC_RANGE==2
|
||||
@ -1518,6 +1520,8 @@ unsigned char Q_SL_SC7U22_Angle_Output(unsigned char calibration_en, signed shor
|
||||
Error_Accgyro[3] = 0 - Sum_Avg_Accgyro[3];
|
||||
Error_Accgyro[4] = 0 - Sum_Avg_Accgyro[4];
|
||||
Error_Accgyro[5] = 0 - Sum_Avg_Accgyro[5];
|
||||
|
||||
|
||||
// xlog("AVG_Recode AX:%d,AY:%d,AZ:%d,GX:%d,GY:%d,GZ:%d\r\n", Sum_Avg_Accgyro[0], Sum_Avg_Accgyro[1], Sum_Avg_Accgyro[2], Sum_Avg_Accgyro[3], Sum_Avg_Accgyro[4], Sum_Avg_Accgyro[5]);
|
||||
// xlog("Error_Recode AX:%d,AY:%d,AZ:%d,GX:%d,GY:%d,GZ:%d\r\n", Error_Accgyro[0], Error_Accgyro[1], Error_Accgyro[2], Error_Accgyro[3], Error_Accgyro[4], Error_Accgyro[5]);
|
||||
}
|
||||
|
||||
@ -83,7 +83,7 @@ extern u8 init_ok;
|
||||
extern u8 sniff_out;
|
||||
unsigned char xtell_bl_state=0; //存放经典蓝牙的连接状态,0断开,1是连接
|
||||
u8 bt_newname =0;
|
||||
unsigned char xt_ble_new_name[9] = "CM-22222";
|
||||
unsigned char xt_ble_new_name[9] = "CM-33333";
|
||||
static u16 play_poweron_ok_timer_id = 0;
|
||||
|
||||
// -- 初始化标志位 --
|
||||
@ -94,6 +94,7 @@ u8 BMP280_init = 0x30; //气压计初始化
|
||||
u16 SC7U22_calibration_id;
|
||||
u16 start_collect_fuc_id;
|
||||
u16 BLE_send_fuc_id;
|
||||
u16 gsensor_test_id = 0;
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
extern int bt_hci_event_handler(struct bt_event *bt);
|
||||
@ -213,6 +214,10 @@ void le_user_app_event_handler(struct sys_event* event){
|
||||
if (event->u.app.buffer[0] == 0xBE && event->u.app.buffer[1] == 0xBB) {
|
||||
if(event->u.app.buffer[2] == 0x01){ //后面的数据长度 1
|
||||
switch (event->u.app.buffer[3]){
|
||||
case 0x01:
|
||||
extern void gsensor_test(void);
|
||||
create_process(&gsensor_test_id,"gsensor_test",NULL,gsensor_test,1000);
|
||||
break;
|
||||
case 0xff: //测试
|
||||
u8 device_buff[10];
|
||||
u8 founds = 0;
|
||||
|
||||
Reference in New Issue
Block a user