feat: Add rfid feature and .gitignore file
This commit is contained in:
@ -81,10 +81,10 @@ const struct task_info task_info_table[] = {
|
||||
#if AUDIO_ENC_MPT_SELF_ENABLE
|
||||
{"enc_mpt_self", 3, 0, 512, 128 },
|
||||
#endif/*AUDIO_ENC_MPT_SELF_ENABLE*/
|
||||
// {"update", 1, 0, 256, 0 },
|
||||
// {"tws_ota", 2, 0, 256, 0 },
|
||||
// {"tws_ota_msg", 2, 0, 256, 128 },
|
||||
// {"dw_update", 2, 0, 256, 128 },
|
||||
{"update", 1, 0, 256, 0 },
|
||||
{"tws_ota", 2, 0, 256, 0 },
|
||||
{"tws_ota_msg", 2, 0, 256, 128 },
|
||||
{"dw_update", 2, 0, 256, 128 },
|
||||
{"rcsp_task", 2, 0, 640, 128 },
|
||||
// {"aud_capture", 4, 0, 512, 256 },
|
||||
// {"data_export", 5, 0, 512, 256 },
|
||||
|
||||
@ -87,7 +87,7 @@
|
||||
//*********************************************************************************//
|
||||
// USB 配置 //
|
||||
//*********************************************************************************//
|
||||
#define TCFG_PC_ENABLE 1//DISABLE_THIS_MOUDLE//PC模块使能
|
||||
#define TCFG_PC_ENABLE 0//DISABLE_THIS_MOUDLE//PC模块使能
|
||||
#define TCFG_UDISK_ENABLE 0//ENABLE_THIS_MOUDLE//U盘模块使能
|
||||
#define TCFG_OTG_USB_DEV_EN BIT(0)//USB0 = BIT(0) USB1 = BIT(1)
|
||||
|
||||
@ -729,7 +729,7 @@ DAC硬件上的连接方式,可选的配置:
|
||||
// 充电舱/蓝牙测试盒/ANC测试三者为同级关系,开启任一功能都会初始化PP0通信接口 //
|
||||
//*********************************************************************************//
|
||||
#define TCFG_CHARGESTORE_ENABLE DISABLE_THIS_MOUDLE //是否支持智能充电舱
|
||||
#define TCFG_TEST_BOX_ENABLE ENABLE_THIS_MOUDLE //是否支持蓝牙测试盒 //xtell
|
||||
#define TCFG_TEST_BOX_ENABLE DISABLE_THIS_MOUDLE//ENABLE_THIS_MOUDLE //是否支持蓝牙测试盒 //xtell
|
||||
#define TCFG_ANC_BOX_ENABLE CONFIG_ANC_ENABLE //是否支持ANC测试盒
|
||||
#define TCFG_UMIDIGI_BOX_ENABLE DISABLE_THIS_MOUDLE //是否支持UMIDIGI充电舱 //xtell
|
||||
#if TCFG_UMIDIGI_BOX_ENABLE
|
||||
@ -807,7 +807,7 @@ DAC硬件上的连接方式,可选的配置:
|
||||
// EQ配置 //
|
||||
//*********************************************************************************//
|
||||
//EQ配置,使用在线EQ时,EQ文件和EQ模式无效。有EQ文件时,使能TCFG_USE_EQ_FILE,默认不用EQ模式切换功能
|
||||
#define TCFG_EQ_ENABLE 1 //支持EQ功能,EQ总使能
|
||||
#define TCFG_EQ_ENABLE 0 //支持EQ功能,EQ总使能
|
||||
// #if TCFG_EQ_ENABLE
|
||||
#define TCFG_EQ_ONLINE_ENABLE 0 //支持在线EQ调试,如果使用蓝牙串口调试,需要打开宏 APP_ONLINE_DEBUG,否则,默认使用uart调试(二选一)
|
||||
#define TCFG_BT_MUSIC_EQ_ENABLE 1 //支持蓝牙音乐EQ
|
||||
@ -1010,7 +1010,7 @@ DAC硬件上的连接方式,可选的配置:
|
||||
//*********************************************************************************//
|
||||
#define TCFG_USER_TWS_ENABLE 0 //tws功能使能
|
||||
#define TCFG_USER_BLE_ENABLE 1 //BLE功能使能
|
||||
#define TCFG_BT_SUPPORT_AAC 1 //AAC格式支持
|
||||
#define TCFG_BT_SUPPORT_AAC 0 //AAC格式支持
|
||||
#define TCFG_BT_SUPPORT_LDAC 0 //LDAC格式支持
|
||||
|
||||
#if TCFG_BT_SUPPORT_LDAC
|
||||
@ -1084,7 +1084,7 @@ DAC硬件上的连接方式,可选的配置:
|
||||
// 编解码格式配置(CodecFormat) //
|
||||
//*********************************************************************************//
|
||||
/*解码格式使能*/
|
||||
#define TCFG_DEC_MP3_ENABLE ENABLE
|
||||
#define TCFG_DEC_MP3_ENABLE DISABLE
|
||||
#define TCFG_DEC_WTGV2_ENABLE ENABLE
|
||||
#define TCFG_DEC_G729_ENABLE DISABLE
|
||||
#define TCFG_DEC_WMA_ENABLE DISABLE
|
||||
|
||||
@ -8,8 +8,8 @@
|
||||
|
||||
/* Following Macros Affect Periods Of Both Code Compiling And Post-build */
|
||||
|
||||
#define CONFIG_DOUBLE_BANK_ENABLE 0 //单双备份选择(若打开了改宏,FLASH结构变为双备份结构,适用于接入第三方协议的OTA, PS: JL-OTA同样支持双备份升级, 需要根据实际FLASH大小同时配置CONFIG_FLASH_SIZE)
|
||||
#define CONFIG_APP_OTA_ENABLE 0 //是否支持RCSP升级(JL-OTA)
|
||||
#define CONFIG_DOUBLE_BANK_ENABLE 1 //单双备份选择(若打开了改宏,FLASH结构变为双备份结构,适用于接入第三方协议的OTA, PS: JL-OTA同样支持双备份升级, 需要根据实际FLASH大小同时配置CONFIG_FLASH_SIZE)
|
||||
#define CONFIG_APP_OTA_ENABLE 1 //是否支持RCSP升级(JL-OTA)
|
||||
|
||||
#define CONFIG_UPDATE_JUMP_TO_MASK 0 //配置升级到loader的方式0为直接reset,1为跳转(适用于芯片电源由IO口KEEP住的方案,需要注意检查跳转前是否将使用DMA的硬件模块全部关闭)
|
||||
|
||||
@ -33,7 +33,7 @@
|
||||
/* Following Macros Only For Post Bulid Configuaration */
|
||||
|
||||
#define CONFIG_DB_UPDATE_DATA_GENERATE_EN 0 //是否生成db_data.bin(用于第三方协议接入使用)
|
||||
#define CONFIG_ONLY_GRENERATE_ALIGN_4K_CODE 0 //ufw只生成1份4K对齐的代码
|
||||
#define CONFIG_ONLY_GRENERATE_ALIGN_4K_CODE 1 //ufw只生成1份4K对齐的代码
|
||||
|
||||
//config for supported chip version
|
||||
#ifdef CONFIG_BR30_C_VERSION
|
||||
|
||||
@ -65,8 +65,8 @@
|
||||
#if CONFIG_APP_OTA_ENABLE
|
||||
#define RCSP_UPDATE_EN 1 //是否支持rcsp升级
|
||||
#if CONFIG_DOUBLE_BANK_ENABLE //双备份才能打开同步升级流程
|
||||
#define OTA_TWS_SAME_TIME_ENABLE 1 //是否支持TWS同步升级
|
||||
#define OTA_TWS_SAME_TIME_NEW 1 //使用新的tws ota流程
|
||||
#define OTA_TWS_SAME_TIME_ENABLE 0 //是否支持TWS同步升级
|
||||
#define OTA_TWS_SAME_TIME_NEW 0 //使用新的tws ota流程
|
||||
#else
|
||||
#define OTA_TWS_SAME_TIME_ENABLE 1//0 xtellota //是否支持TWS同步升级
|
||||
#define OTA_TWS_SAME_TIME_NEW 1//0 //使用新的tws ota流程
|
||||
|
||||
@ -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