蓝牙发送速率提升

This commit is contained in:
lmx
2025-12-04 18:51:38 +08:00
parent 8c2db49083
commit 89f1c93f74
21 changed files with 641 additions and 801 deletions

View File

@ -49,7 +49,7 @@
#include "classic/tws_api.h"
#include "rcsp_adv_user_update.h"
#include "bt_tws.h"
// #include "le_trans_data.h"
#if (TCFG_BLE_DEMO_SELECT == DEF_BLE_DEMO_ADV_RCSP)
#if TCFG_CHARGE_BOX_ENABLE
@ -86,8 +86,10 @@ static const char user_tag_string[] = {EIR_TAG_STRING};
/* #include "debug.h" */
//------
#define ATT_LOCAL_PAYLOAD_SIZE (200) //note: need >= 20
#define ATT_SEND_CBUF_SIZE (512) //note: need >= 20,缓存大小,可修改
// #define ATT_LOCAL_PAYLOAD_SIZE (200*10) //note: need >= 20
// #define ATT_SEND_CBUF_SIZE (1024 * 50) //note: need >= 20,缓存大小,可修改
#define ATT_LOCAL_PAYLOAD_SIZE (517) //note: need >= 20
#define ATT_SEND_CBUF_SIZE (1024 * 2) //note: need >= 20,缓存大小,可修改
#define ATT_RAM_BUFSIZE (ATT_CTRL_BLOCK_SIZE + ATT_LOCAL_PAYLOAD_SIZE + ATT_SEND_CBUF_SIZE) //note:
static u8 att_ram_buffer[ATT_RAM_BUFSIZE] __attribute__((aligned(4)));
//---------------
@ -109,9 +111,10 @@ static const uint8_t sm_min_key_size = 7;
static const uint8_t connection_update_enable = 1; ///0--disable, 1--enable
static uint8_t connection_update_cnt = 0; //
static const struct conn_update_param_t connection_param_table[] = {
{16, 24, 16, 600},
{12, 28, 14, 600},//11
{8, 20, 20, 600},//3.7
{6, 12, 0, 400},//3.7
// {16, 24, 16, 600},
// {12, 28, 14, 600},//11
// {8, 20, 20, 600},//3.7
/* {12, 28, 4, 600},//3.7 */
/* {12, 24, 30, 600},//3.05 */
};
@ -299,6 +302,17 @@ void test_data_send_packet(void)
static void can_send_now_wakeup(void)
{
// static signed char acc_data_buf[60] = {
// 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
// 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
// 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
// 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
// 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
// 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x22
// };
// extern void send_data_to_ble_client(const u8* data, u16 length);
// send_data_to_ble_client(&acc_data_buf, 60);
putchar('E');
if (ble_resume_send_wakeup) {
ble_resume_send_wakeup();
@ -315,6 +329,24 @@ u8 ble_update_get_ready_jump_flag(void)
return 0;
}
// 添加到 le_rcsp_adv_module.c
static void set_connection_data_length(u16 tx_octets, u16 tx_time) //xtell
{
if (con_handle) {
ble_user_cmd_prepare(BLE_CMD_SET_DATA_LENGTH, 3, con_handle, tx_octets, tx_time);
}
}
static void set_connection_data_phy(u8 tx_phy, u8 rx_phy)//xtell
{
if (0 == con_handle) {
return;
}
u8 all_phys = 0;
u16 phy_options = 0; // 根据你的 SDK 定义调整
ble_user_cmd_prepare(BLE_CMD_SET_PHY, 5, con_handle, all_phys, tx_phy, rx_phy, phy_options);
}
/*
* @section Packet Handler
*
@ -370,6 +402,16 @@ static void cbk_packet_handler(uint8_t packet_type, uint16_t channel, uint8_t *p
connection_update_complete_success(packet);
break;
}
case HCI_SUBEVENT_LE_DATA_LENGTH_CHANGE: //xtell
log_info("APP HCI_SUBEVENT_LE_DATA_LENGTH_CHANGE\n");
set_connection_data_phy(2, 2); // 2 表示 2M PHY
break;
case HCI_SUBEVENT_LE_PHY_UPDATE_COMPLETE://xtell
log_info("APP HCI_SUBEVENT_LE_PHY_UPDATE %s\n", packet[4] ? "Fail" : "Succ"); // packet[4] 是 status
log_info("Tx PHY: %d\n", packet[5]); // packet[5] 是 TX_PHY
log_info("Rx PHY: %d\n", packet[6]); // packet[6] 是 RX_PHY
break;
break;
case HCI_EVENT_DISCONNECTION_COMPLETE:
@ -410,6 +452,7 @@ static void cbk_packet_handler(uint8_t packet_type, uint16_t channel, uint8_t *p
mtu = att_event_mtu_exchange_complete_get_MTU(packet) - 3;
log_info("ATT MTU = %u\n", mtu);
ble_user_cmd_prepare(BLE_CMD_ATT_MTU_SIZE, 1, mtu);
set_connection_data_length(251, 2120);//xtell
break;
case HCI_EVENT_VENDOR_REMOTE_TEST:
@ -571,6 +614,7 @@ static int app_send_user_data(u16 handle, u8 *data, u16 len, u8 handle_type)
ret = ble_user_cmd_prepare(BLE_CMD_ATT_SEND_DATA, 4, handle, data, len, handle_type);
if (ret == BLE_BUFFER_FULL) {
printf("app_send_user_data: buffer full\n");
ret = APP_BLE_BUFF_FULL;
}
@ -1663,12 +1707,8 @@ void send_version_to_sibling(void)
data[2] = ver >> 8;
tws_api_send_data_to_sibling(data, sizeof(data), TWS_FUNC_ID_SEQ_RAND_SYNC);
}
#endif
///////////////////////////////////////////////////////////////////////////////////////////////////////
void send_data_to_ble_client(const u8* data, u16 length)
{
// 检查数据长度是否有效
@ -1677,8 +1717,8 @@ void send_data_to_ble_client(const u8* data, u16 length)
return;
}
// 检查缓冲区空间
if (app_send_user_data_check(length)) {
// // 检查缓冲区空间
// if (app_send_user_data_check(length)) {
// 发送数据
int ret = app_send_user_data(ATT_CHARACTERISTIC_ae02_01_VALUE_HANDLE, data, length, ATT_OP_NOTIFY);
if (ret == 0) { // 假设 0 表示成功
@ -1686,7 +1726,12 @@ void send_data_to_ble_client(const u8* data, u16 length)
} else {
// printf("Failed to send data: Length %d, Error code: %d\n", length, ret);
}
} else {
// printf("Insufficient buffer space to send data: Length %d\n", length);
}
}
// } else {
// printf("Insufficient buffer space to send data: Length %d\n", length);
// }
}
#endif

View File

@ -81,9 +81,9 @@ extern void printf_buf(u8 *buf, u32 len);
//------
//ATT发送的包长, note: 20 <=need >= MTU
#define ATT_LOCAL_MTU_SIZE (200) //
#define ATT_LOCAL_MTU_SIZE (517) //200
//ATT缓存的buffer大小, note: need >= 20,可修改
#define ATT_SEND_CBUF_SIZE (512) //
#define ATT_SEND_CBUF_SIZE (512 * 20) //
//共配置的RAM
#define ATT_RAM_BUFSIZE (ATT_CTRL_BLOCK_SIZE + ATT_LOCAL_MTU_SIZE + ATT_SEND_CBUF_SIZE) //note:
@ -125,9 +125,10 @@ static uint8_t connection_update_cnt = 0; //
//参数表
static const struct conn_update_param_t connection_param_table[] = {
{16, 24, 10, 600},//11
{12, 28, 10, 600},//3.7
{8, 20, 10, 600},
{6, 12, 0, 400},//11
// {16, 24, 10, 600},//11
// {12, 28, 10, 600},//3.7
// {8, 20, 10, 600},
/* {12, 28, 4, 600},//3.7 */
/* {12, 24, 30, 600},//3.05 */
};
@ -706,6 +707,11 @@ static int att_write_callback(hci_con_handle_t connection_handle, uint16_t att_h
u16 handle = att_handle;
log_info("write_callback, handle= 0x%04x,size = %d\n", handle, buffer_size);
if(buffer[0] == 0xbe && buffer[1] == 0xbb){
extern void test_func(void);
test_func();
}
switch (handle) {
@ -1389,6 +1395,44 @@ void hangup_ans_call_handle(u8 en)
}
#endif
void send_data_to_ble_client(const u8* data, u16 length)
{
// 检查数据长度是否有效
if (length == 0 || length > 512) {
printf("Error: Data length %d is out of range (1-512)\n", length);
return;
}
// // 检查缓冲区空间
// if (app_send_user_data_check(length)) {
// 发送数据
int ret = app_send_user_data(ATT_CHARACTERISTIC_ae02_01_VALUE_HANDLE, data, length, ATT_OP_NOTIFY);
if (ret == 0) { // 假设 0 表示成功
// printf("Data sent successfully: Length %d\n", length);
} else {
printf("Failed to send data: Length %d, Error code: %d\n", length, ret);
}
// } else {
// printf("Insufficient buffer space to send data: Length %d\n", length);
// }
}
void rcsp_adv_fill_mac_addr(u8 *mac_addr_buf)
{
#if (MUTIl_CHARGING_BOX_EN)
u8 *mac_addr = get_chargebox_adv_addr();
if (mac_addr) {
swapX(mac_addr, mac_addr_buf, 6);
}
/* printf("mac_addr:"); */
/* printf_buf(mac_addr_buf, 6); */
#else
swapX(bt_get_mac_addr(), mac_addr_buf, 6);
#endif
}
#endif

View File

@ -37,7 +37,7 @@ extern void printf_buf(u8 *buf, u32 len);
//------
//ATT发送的包长, note: 20 <=need >= MTU
#define ATT_LOCAL_MTU_SIZE (517) //
//ATT缓存的buffer大小, note: need >= 20,可修改
//ATT缓存的buffer大小, +: need >= 20,可修改
#if(APP_MAIN == APP_WIRELESS_MIC_2T1)
#define ATT_SEND_CBUF_SIZE (90)
#else
@ -92,7 +92,8 @@ static uint8_t connection_update_cnt = 0; //
//参数表
static const struct conn_update_param_t connection_param_table[] = {
{WIRELESS_BLE_CONNECT_INTERVAL, WIRELESS_BLE_CONNECT_INTERVAL, 0, 100},//11
// {1, 5, 4, 600},//11
{12, 24, 0, 400}, // 建议修改为此值 (15ms - 30ms interval)
};
//共可用的参数组数
@ -421,7 +422,7 @@ static void cbk_packet_handler(uint8_t packet_type, uint16_t channel, uint8_t *p
case HCI_SUBEVENT_LE_DATA_LENGTH_CHANGE:
log_info("APP HCI_SUBEVENT_LE_DATA_LENGTH_CHANGE\n");
set_connection_data_phy(CONN_SET_2M_PHY, CONN_SET_2M_PHY);
// set_connection_data_phy(CONN_SET_2M_PHY, CONN_SET_2M_PHY);
break;
case HCI_SUBEVENT_LE_PHY_UPDATE_COMPLETE:
@ -453,7 +454,7 @@ static void cbk_packet_handler(uint8_t packet_type, uint16_t channel, uint8_t *p
mtu = att_event_mtu_exchange_complete_get_MTU(packet) - 3;
log_info("ATT MTU = %u\n", mtu);
ble_op_att_set_send_mtu(mtu);
set_connection_data_length(251, 2120);
// set_connection_data_length(251, 2120);
break;
case HCI_EVENT_VENDOR_REMOTE_TEST:
@ -1067,6 +1068,44 @@ void ble_server_send_test_key_num(u8 key_num)
;
}
void send_data_to_ble_client(const u8* data, u16 length)
{
// 检查数据长度是否有效
if (length == 0 || length > 512) {
printf("Error: Data length %d is out of range (1-512)\n", length);
return;
}
// // 检查缓冲区空间
// if (app_send_user_data_check(length)) {
// 发送数据
int ret = app_send_user_data(ATT_CHARACTERISTIC_ae02_01_VALUE_HANDLE, data, length, ATT_OP_NOTIFY);
if (ret == 0) { // 假设 0 表示成功
printf("Data sent successfully: Length %d\n", length);
} else {
printf("Failed to send data: Length %d, Error code: %d\n", length, ret);
}
// } else {
// printf("Insufficient buffer space to send data: Length %d\n", length);
// }
}
void rcsp_adv_fill_mac_addr(u8 *mac_addr_buf)
{
#if (MUTIl_CHARGING_BOX_EN)
u8 *mac_addr = get_chargebox_adv_addr();
if (mac_addr) {
swapX(mac_addr, mac_addr_buf, 6);
}
/* printf("mac_addr:"); */
/* printf_buf(mac_addr_buf, 6); */
#else
swapX(bt_get_mac_addr(), mac_addr_buf, 6);
#endif
}
#endif

View File

@ -717,7 +717,7 @@ struct port_wakeup port0 = {
.pullup_down_enable = ENABLE, //配置I/O 内部上下拉是否使能
.edge = FALLING_EDGE, //唤醒方式选择,可选:上升沿\下降沿
.filter = PORT_FLT_8ms,
.iomap = IO_PORTB_01, //唤醒口选择
.iomap = IO_PORTA_04, //唤醒口选择
};
#if (TCFG_TEST_BOX_ENABLE || TCFG_CHARGESTORE_ENABLE || TCFG_ANC_BOX_ENABLE || TCFG_UMIDIGI_BOX_ENABLE)

View File

@ -47,7 +47,7 @@
*/
#define TCFG_HW_I2C0_PORTS 'B'
#define TCFG_HW_I2C0_CLK 400000 //硬件IIC波特率:400k
#define TCFG_HW_I2C0_CLK 1000000 //硬件IIC波特率:400k
//*********************************************************************************//
// 硬件SPI 配置 //
@ -1130,7 +1130,7 @@ DAC硬件上的连接方式,可选的配置:
//*********************************************************************************//
#if TCFG_USER_BLE_ENABLE
#define DUEROS_DMA_EN 0
#define TRANS_DATA_EN 0//1 //xtellota
// #define TRANS_DATA_EN 0//1 //xtellota
#define BLE_HID_EN 0
#if (DUEROS_DMA_EN)

View File

@ -13,7 +13,7 @@
#define CONFIG_UPDATE_JUMP_TO_MASK 0 //配置升级到loader的方式0为直接reset,1为跳转(适用于芯片电源由IO口KEEP住的方案,需要注意检查跳转前是否将使用DMA的硬件模块全部关闭)
#define CONFIG_IO_KEY_EN 0 //配置是否使用IO按键配合RESET1
#define CONFIG_IO_KEY_EN 1 //配置是否使用IO按键配合RESET1
#define CONFIG_UPDATE_WITH_MD5_CHECK_EN 0 //配置升级是否支持MD5校验
#define CONFIG_ANC_ENABLE 0 //配置是否支持ANC
@ -73,8 +73,8 @@
#if CONFIG_IO_KEY_EN
#define CONFIG_SUPPORT_RESET1
#define CONFIG_RESET1_PIN PB01 //io pin
#define CONFIG_RESET1_TIME 08 //unit:second
#define CONFIG_RESET1_PIN PA04 //io pin
#define CONFIG_RESET1_TIME 01 //unit:second
#define CONFIG_RESET1_LEVEL 0 //tigger level(0/1)
#endif

View File

@ -21,9 +21,10 @@
#define CONFIG_APP_BT_ENABLE
#ifdef CONFIG_APP_BT_ENABLE
#define TRANS_DATA_EN 0
#define BLE_WIRELESS_SERVER_EN 0
#define TRANS_DATA_EN 1
#define RCSP_BTMATE_EN 0
#define RCSP_ADV_EN 1
#define RCSP_ADV_EN 0
#define AI_APP_PROTOCOL 0
#define LL_SYNC_EN 0
#define TUYA_DEMO_EN 0

View File

@ -204,6 +204,18 @@ int app_protocol_sys_event_handler(struct sys_event *event);
#define EARPHONE_STATE_SNIFF(a)
#define EARPHONE_STATE_ROLE_SWITCH(a)
#elif BLE_WIRELESS_SERVER_EN
#define EARPHONE_STATE_INIT() do { } while(0)
#define EARPHONE_STATE_SET_PAGE_SCAN_ENABLE() do { } while(0)
#define EARPHONE_STATE_GET_CONNECT_MAC_ADDR() do { } while(0)
#define EARPHONE_STATE_CANCEL_PAGE_SCAN() do { } while(0)
#define EARPHONE_STATE_ENTER_SOFT_POWEROFF() do { } while(0)
#define EARPHONE_STATE_TWS_INIT(a) do { } while(0)
#define EARPHONE_STATE_TWS_CONNECTED(a, b) do { } while(0)
#define SYS_EVENT_HANDLER_SPECIFIC(a) do { } while(0)
#define SYS_EVENT_REMAP(a) 0
#define EARPHONE_STATE_SNIFF(a)
#define EARPHONE_STATE_ROLE_SWITCH(a)
#else
int adv_earphone_state_init();
int adv_earphone_state_set_page_scan_enable();

View File

@ -232,7 +232,8 @@ const uint64_t config_btctler_le_features = LE_ENCRYPTION;
#else
const int config_btctler_le_roles = (LE_ADV | LE_SLAVE);
const uint64_t config_btctler_le_features = 0;
// const uint64_t config_btctler_le_features = 0;
const uint64_t config_btctler_le_features = LE_ENCRYPTION | LE_DATA_PACKET_LENGTH_EXTENSION | LE_2M_PHY;
#endif
#else
const int config_btctler_le_roles = 0;
@ -280,9 +281,13 @@ const int config_btctler_le_acl_total_nums = 1;
const int config_btctler_le_afh_en = 0;
const u32 config_vendor_le_bb = 0;
const int config_btctler_le_rx_nums = 5;
const int config_btctler_le_acl_packet_length = 27;
const int config_btctler_le_acl_total_nums = 5;
// const int config_btctler_le_rx_nums = 5;
// const int config_btctler_le_acl_packet_length = 27;
// const int config_btctler_le_acl_total_nums = 5;
const int config_btctler_le_rx_nums = 8;
const int config_btctler_le_acl_packet_length = 251;
const int config_btctler_le_acl_total_nums = 8;
#endif
/*-----------------------------------------------------------*/

View File

@ -29,6 +29,7 @@
#include "asm/rtc.h"
#include "system/timer.h"
#include "adv_time_stamp_setting.h"
#include "btstack/le/le_user.h"
///////////////////////////////////////////////////////////////////////////////////////////////////
//宏定义
#define ENABLE_XLOG 1
@ -433,20 +434,128 @@ void xtell_task_create(void){
//test
//
void bmp280_test(void){
/**
* @brief 开始采集传感器数据和计算速度
*
*/
void sensor_task(void){
while(1){
// xlog("=======sensor_read_data START\n");
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;
uint8_t mmc5603nj_buffer[9];
signed short acc_data_buf[3];
signed short gyr_data_buf[3];
float angle[3];
float quaternion_output[3];
float temperature = 0;
float pressure = 0;
// -- 读数据 --
SL_SC7U22_RawData_Read(acc_data_buf,gyr_data_buf);
mmc5603nj_read_origin_data(mmc5603nj_buffer);
// bmp280_read_originanl_data(&BLE_send_data_tmp.adc_P, &BLE_send_data_tmp.adc_T);
bmp280_read_data(&temperature, &pressure);
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);
// -- 数据包装进结构体 --
memcpy(&BLE_send_data_tmp.SC7U22_data[0], acc_data_buf, 3 * sizeof(signed short));
memcpy(&BLE_send_data_tmp.SC7U22_data[3], gyr_data_buf, 3 * sizeof(signed short));
memcpy(BLE_send_data_tmp.mmc5603nj_buffer, mmc5603nj_buffer, 9);
BLE_send_data_tmp.temperature = (int16_t)(temperature * 1000.0f);
BLE_send_data_tmp.pressure = (int32_t)(pressure * 1000.0f);
BLE_send_data_tmp.speed_cms = speed;
extern u8 foot_init;
BLE_send_data_tmp.foot_state = foot_init;
BLE_send_data_tmp.timestamp_ms = get_ms_timer();
// -- 放进缓冲区 --
if(circle_buffer_is_full(&BLE_send_buff) == 0){
circle_buffer_write(&BLE_send_buff, &BLE_send_data_tmp);
}
// xlog("=======sensor_read_data END\n");
os_time_dly(1);
}
}
#define BUFF_LEN 500
static signed char acc_data_buf[BUFF_LEN] = {0};
// 1. 定义一个全局的信号量
static OS_SEM ble_send_sem;
void on_ble_can_send(void) {
os_sem_post(&ble_send_sem);
}
int j = 0;
void data_send_task(void){
while(1){
// 等待“发送许可”信号量,如果没许可,任务会在此阻塞
// os_sem_pend(&ble_send_sem, 1);
// static signed char acc_data_buf[60] = {
// 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
// 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
// 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
// 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
// 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
// 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x22
// };
acc_data_buf[1] = (uint8_t)(j & 0xFF);
acc_data_buf[2] = (uint8_t)(j>>8 & 0xFF);
acc_data_buf[3] = (uint8_t)(j>>16 & 0xFF);
acc_data_buf[4] = (uint8_t)(j>>24 & 0xFF);
acc_data_buf[0] = 0xAA;
send_data_to_ble_client(&acc_data_buf, 500);
// acc_data_buf[0] = 0xBB;
// send_data_to_ble_client(&acc_data_buf, 500);
// acc_data_buf[0] = 0xCC;
// send_data_to_ble_client(&acc_data_buf, 500);
// acc_data_buf[0] = 0xDD;
// send_data_to_ble_client(&acc_data_buf, 500);
void gsensor_test(void){
#if 1
signed short acc_data_buf[3];
signed short gyr_data_buf[3];
SL_SC7U22_RawData_Read(acc_data_buf,gyr_data_buf);
#endif
// static signed char acc_data_buf[20] = {
// 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
// 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
// };
// send_data_to_ble_client(&acc_data_buf, 20);
// send_data_to_ble_client(&acc_data_buf, 20);
// send_data_to_ble_client(&acc_data_buf, 20);
// xlog("===========time:%d\n",get_ms_timer());
j++;
os_time_dly(4); //10ms单位
}
}
static u16 gtest_id = 0;
void test_func(void){
create_process(&gtest_id,"gtest_id",NULL,gsensor_test,1000);
// a. 初始化信号量初始值为0
// os_sem_create(&ble_send_sem, 0);
// b. 注册回调函数,让协议栈知道在准备好时该调用谁
// struct ble_server_operation_t *ble_ops;
// ble_get_server_operation_table(&ble_ops);
// ble_ops->regist_wakeup_send(NULL, on_ble_can_send);
for(int i = 0;i<BUFF_LEN;i++){
acc_data_buf[i] = i;
}
os_task_create(data_send_task,NULL,5,1024,32,"data_send_task");
// data_send_task();
}

View File

@ -20,7 +20,7 @@ Copyright (c) 2022 Silan MEMS. All Rights Reserved.
/***使用前请根据实际情况配置以下参数******/
/**SC7U22的SDO 接地: 0****************/
/**SC7U22的SDO 接电源:1****************/
#define SL_SC7U22_SDO_VDD_GND 1
#define SL_SC7U22_SDO_VDD_GND 0
/*****************************************/
/***使用前请根据实际IIC地址配置参数***/
/**SC7U22的IIC 接口地址为 7bits: 0****/

View File

@ -171,6 +171,6 @@ void xtell_app_main()
xtell_task_create();
xlog("==============xtell_app_end================\n");
}

View File

@ -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-4-F9";
static u16 play_poweron_ok_timer_id = 0;
// -- 初始化标志位 --
@ -236,7 +236,7 @@ void le_user_app_event_handler(struct sys_event* event){
break;
case 0x02:
extern void test_func(void);
// test_func();
test_func();
break;
default:
break;

Binary file not shown.

Binary file not shown.

View File

@ -61,4 +61,4 @@ copy /b text.bin + data.bin + mov_slot.bin + data_code.bin + aec.bin + aac.bin +
del !bankfiles! common.bin text.bin data.bin bank.bin
copy eq_cfg_hw_less.bin eq_cfg_hw.bin
call download/earphone/download_app_ota.bat
call download/earphone/download.bat

View File

@ -62,6 +62,12 @@ SPI = 2_3_0_0;
UTTX = PB02;
UTBD = 1000000;
UTRX = PP00;
RESET = PA04_01_0;
[FW_ADDITIONAL]
FILE_LIST = (file = ota.bin: type = 100);
[RESERVED_CONFIG]

View File

@ -205,7 +205,7 @@ UTRX = CONFIG_UART_UPDATE_PIN; //串口升级[PB00 PB05 PA05]
/* RESET = CAT3(CONFIG_RESET_PIN, CONFIG_RESET_TIME, CONFIG_RESET_LEVEL); //port口_长按时间_有效电平长按时间有00、01、02、04、08三个值可选单位为秒当长按时间为00时则关闭长按复位功能。 */
#ifdef CONFIG_SUPPORT_RESET1
RESET1 = CAT3(CONFIG_RESET1_PIN, CONFIG_RESET1_TIME, CONFIG_RESET1_LEVEL); //port口_长按时间_有效电平长按时间有00、01、02、04、08三个值可选单位为秒当长按时间为00时则关闭长按复位功能。
RESET = CAT3(CONFIG_RESET1_PIN, CONFIG_RESET1_TIME, CONFIG_RESET1_LEVEL); //port口_长按时间_有效电平长按时间有00、01、02、04、08三个值可选单位为秒当长按时间为00时则关闭长按复位功能。
#endif
#ifdef CONFIG_VDDIO_LVD_LEVEL

File diff suppressed because it is too large Load Diff

View File

@ -19,16 +19,17 @@
#include "ble/ll_config.h"
// #define CONFIG_LE_FEATURES \
(\
LE_ENCRYPTION | \
LE_CORE_V50_FEATURES \
)
// (\
// LE_ENCRYPTION | \
// LE_CORE_V50_FEATURES \
// )
#define CONFIG_LE_FEATURES 0//(LE_ENCRYPTION)
// #define CONFIG_LE_FEATURES (LE_CORE_V50_FEATURES | LE_DATA_PACKET_LENGTH_EXTENSION)//(LE_ENCRYPTION)
#define CONFIG_LE_FEATURES 0
// #define CONFIG_LE_ROLES (LE_ADV|LE_SCAN|LE_INIT|LE_SLAVE|LE_MASTER)
// #define CONFIG_LE_ROLES (LE_ADV|LE_SCAN)
#define CONFIG_LE_ROLES (LE_ADV)
#define CONFIG_LE_ROLES (LE_ADV|LE_SCAN)
// #define CONFIG_LE_ROLES (LE_ADV)
#include "classic/lmp_config.h"