新增电脑通过USB发送产品code,然后dongle根据新的code重新发起广播的功能
This commit is contained in:
Vendored
+2
-1
@@ -1,6 +1,7 @@
|
|||||||
{
|
{
|
||||||
"files.associations": {
|
"files.associations": {
|
||||||
"debug.h": "c",
|
"debug.h": "c",
|
||||||
"includes.h": "c"
|
"includes.h": "c",
|
||||||
|
"cdc.h": "c"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1138,6 +1138,10 @@
|
|||||||
<Unit filename="apps/usr_le_code/usr_le_adv.c">
|
<Unit filename="apps/usr_le_code/usr_le_adv.c">
|
||||||
<Option compilerVar="CC" />
|
<Option compilerVar="CC" />
|
||||||
</Unit>
|
</Unit>
|
||||||
|
<Unit filename="apps/usr_le_code/usr_usb_jb.c">
|
||||||
|
<Option compilerVar="CC" />
|
||||||
|
</Unit>
|
||||||
|
<Unit filename="apps/usr_le_code/usr_usb_jb.h" />
|
||||||
<Unit filename="apps/usr_le_code/usr_le_recieve.c">
|
<Unit filename="apps/usr_le_code/usr_le_recieve.c">
|
||||||
<Option compilerVar="CC" />
|
<Option compilerVar="CC" />
|
||||||
</Unit>
|
</Unit>
|
||||||
|
|||||||
+23
-12
@@ -131752,7 +131752,7 @@
|
|||||||
1706666735 d:\jianbao\project\À¶ÑÀת½Ó°å-¶ºÃ¨°ô\sdk\include_lib\system\power_manage.h
|
1706666735 d:\jianbao\project\À¶ÑÀת½Ó°å-¶ºÃ¨°ô\sdk\include_lib\system\power_manage.h
|
||||||
"generic/typedef.h"
|
"generic/typedef.h"
|
||||||
|
|
||||||
1759042081 d:\jianbao\project\À¶ÑÀת½Ó°å-¶ºÃ¨°ô\sdk\include_lib\system\syscfg_id.h
|
1784878367 d:\jianbao\project\À¶ÑÀת½Ó°å-¶ºÃ¨°ô\sdk\include_lib\system\syscfg_id.h
|
||||||
"typedef.h"
|
"typedef.h"
|
||||||
|
|
||||||
1706666736 d:\jianbao\project\À¶ÑÀת½Ó°å-¶ºÃ¨°ô\sdk\include_lib\system\bank_switch.h
|
1706666736 d:\jianbao\project\À¶ÑÀת½Ó°å-¶ºÃ¨°ô\sdk\include_lib\system\bank_switch.h
|
||||||
@@ -133120,7 +133120,7 @@
|
|||||||
"cpu.h"
|
"cpu.h"
|
||||||
"asm/debug.h"
|
"asm/debug.h"
|
||||||
|
|
||||||
1784799608 source:d:\jianbao\project\À¶ÑÀת½Ó°å-¶ºÃ¨°ô\sdk\apps\common\device\usb\device\task_pc.c
|
1784878306 source:d:\jianbao\project\À¶ÑÀת½Ó°å-¶ºÃ¨°ô\sdk\apps\common\device\usb\device\task_pc.c
|
||||||
"system/app_core.h"
|
"system/app_core.h"
|
||||||
"system/includes.h"
|
"system/includes.h"
|
||||||
"server/server_core.h"
|
"server/server_core.h"
|
||||||
@@ -133136,6 +133136,7 @@
|
|||||||
"usb/device/hid.h"
|
"usb/device/hid.h"
|
||||||
"usb/device/msd.h"
|
"usb/device/msd.h"
|
||||||
"usb/device/cdc.h"
|
"usb/device/cdc.h"
|
||||||
|
"usr_usb_jb.h"
|
||||||
"dev_multiplex_api.h"
|
"dev_multiplex_api.h"
|
||||||
"apple_dock/iAP.h"
|
"apple_dock/iAP.h"
|
||||||
"cfg_tool.h"
|
"cfg_tool.h"
|
||||||
@@ -134229,7 +134230,7 @@
|
|||||||
"rcsp_adv_bluetooth.h"
|
"rcsp_adv_bluetooth.h"
|
||||||
"bt_tws.h"
|
"bt_tws.h"
|
||||||
|
|
||||||
1762413555 source:d:\jianbao\project\À¶ÑÀת½Ó°å-¶ºÃ¨°ô\sdk\apps\common\third_party_profile\jieli\jl_rcsp\bt_trans_data\le_rcsp_adv_module.c
|
1784867308 source:d:\jianbao\project\À¶ÑÀת½Ó°å-¶ºÃ¨°ô\sdk\apps\common\third_party_profile\jieli\jl_rcsp\bt_trans_data\le_rcsp_adv_module.c
|
||||||
"system/app_core.h"
|
"system/app_core.h"
|
||||||
"system/includes.h"
|
"system/includes.h"
|
||||||
"app_config.h"
|
"app_config.h"
|
||||||
@@ -134918,7 +134919,7 @@
|
|||||||
"bt_tws.h"
|
"bt_tws.h"
|
||||||
"icsd_adt_app.h"
|
"icsd_adt_app.h"
|
||||||
|
|
||||||
1784865606 source:d:\jianbao\project\À¶ÑÀת½Ó°å-¶ºÃ¨°ô\sdk\apps\earphone\app_main.c
|
1784878086 source:d:\jianbao\project\À¶ÑÀת½Ó°å-¶ºÃ¨°ô\sdk\apps\earphone\app_main.c
|
||||||
"system/includes.h"
|
"system/includes.h"
|
||||||
"btstack/btstack_task.h"
|
"btstack/btstack_task.h"
|
||||||
"app_config.h"
|
"app_config.h"
|
||||||
@@ -135037,7 +135038,7 @@
|
|||||||
"bt_tws.h"
|
"bt_tws.h"
|
||||||
"debug.h"
|
"debug.h"
|
||||||
|
|
||||||
1784865576 source:d:\jianbao\project\À¶ÑÀת½Ó°å-¶ºÃ¨°ô\sdk\apps\earphone\board\br28\board_jl701n_demo.c
|
1784866379 source:d:\jianbao\project\À¶ÑÀת½Ó°å-¶ºÃ¨°ô\sdk\apps\earphone\board\br28\board_jl701n_demo.c
|
||||||
"app_config.h"
|
"app_config.h"
|
||||||
"app_main.h"
|
"app_main.h"
|
||||||
"system/includes.h"
|
"system/includes.h"
|
||||||
@@ -136061,7 +136062,7 @@
|
|||||||
<math.h>
|
<math.h>
|
||||||
"mjson.h"
|
"mjson.h"
|
||||||
|
|
||||||
1784865368 source:d:\jianbao\project\À¶ÑÀת½Ó°å-¶ºÃ¨°ô\sdk\apps\usr_le_code\usr_le_adv.c
|
1784878066 source:d:\jianbao\project\À¶ÑÀת½Ó°å-¶ºÃ¨°ô\sdk\apps\usr_le_code\usr_le_adv.c
|
||||||
"system/includes.h"
|
"system/includes.h"
|
||||||
"app_config.h"
|
"app_config.h"
|
||||||
"app_main.h"
|
"app_main.h"
|
||||||
@@ -136070,9 +136071,10 @@
|
|||||||
"vm.h"
|
"vm.h"
|
||||||
"bleproto.h"
|
"bleproto.h"
|
||||||
"bleproto_api.h"
|
"bleproto_api.h"
|
||||||
|
"usr_usb_jb.h"
|
||||||
"debug.h"
|
"debug.h"
|
||||||
|
|
||||||
1784865445 source:d:\jianbao\project\À¶ÑÀת½Ó°å-¶ºÃ¨°ô\sdk\apps\usr_le_code\usr_le_recieve.c
|
1784867441 source:d:\jianbao\project\À¶ÑÀת½Ó°å-¶ºÃ¨°ô\sdk\apps\usr_le_code\usr_le_recieve.c
|
||||||
"app_config.h"
|
"app_config.h"
|
||||||
"asm/pwm_led.h"
|
"asm/pwm_led.h"
|
||||||
"tone_player.h"
|
"tone_player.h"
|
||||||
@@ -136860,13 +136862,12 @@
|
|||||||
<stdlib.h>
|
<stdlib.h>
|
||||||
"cpu.h"
|
"cpu.h"
|
||||||
|
|
||||||
1784865607 source:d:\jianbao\project\À¶ÑÀת½Ó°å-¶ºÃ¨°ô\sdk\cpu\br28\mcpwm.c
|
1784866089 source:d:\jianbao\project\À¶ÑÀת½Ó°å-¶ºÃ¨°ô\sdk\cpu\br28\mcpwm.c
|
||||||
"asm/mcpwm.h"
|
"asm/mcpwm.h"
|
||||||
"asm/clock.h"
|
"asm/clock.h"
|
||||||
"asm/gpio.h"
|
"asm/gpio.h"
|
||||||
"app_main.h"
|
|
||||||
|
|
||||||
1706666737 d:\jianbao\project\À¶ÑÀת½Ó°å-¶ºÃ¨°ô\sdk\include_lib\driver\cpu\br28\asm\mcpwm.h
|
1784866108 d:\jianbao\project\À¶ÑÀת½Ó°å-¶ºÃ¨°ô\sdk\include_lib\driver\cpu\br28\asm\mcpwm.h
|
||||||
"typedef.h"
|
"typedef.h"
|
||||||
|
|
||||||
1706666731 source:d:\jianbao\project\À¶ÑÀת½Ó°å-¶ºÃ¨°ô\sdk\cpu\br28\mic_dut_process.c
|
1706666731 source:d:\jianbao\project\À¶ÑÀת½Ó°å-¶ºÃ¨°ô\sdk\cpu\br28\mic_dut_process.c
|
||||||
@@ -136910,11 +136911,10 @@
|
|||||||
"includes.h"
|
"includes.h"
|
||||||
"asm/clock_hw.h"
|
"asm/clock_hw.h"
|
||||||
|
|
||||||
1760431969 source:d:\jianbao\project\À¶ÑÀת½Ó°å-¶ºÃ¨°ô\sdk\cpu\br28\power\power_port.c
|
1784866038 source:d:\jianbao\project\À¶ÑÀת½Ó°å-¶ºÃ¨°ô\sdk\cpu\br28\power\power_port.c
|
||||||
"asm/power_interface.h"
|
"asm/power_interface.h"
|
||||||
"app_config.h"
|
"app_config.h"
|
||||||
"includes.h"
|
"includes.h"
|
||||||
"app_main.h"
|
|
||||||
|
|
||||||
1706666733 source:d:\jianbao\project\À¶ÑÀת½Ó°å-¶ºÃ¨°ô\sdk\cpu\br28\power\power_trim.c
|
1706666733 source:d:\jianbao\project\À¶ÑÀת½Ó°å-¶ºÃ¨°ô\sdk\cpu\br28\power\power_trim.c
|
||||||
"asm/power_interface.h"
|
"asm/power_interface.h"
|
||||||
@@ -137190,3 +137190,14 @@
|
|||||||
"app_config.h"
|
"app_config.h"
|
||||||
"timer.h"
|
"timer.h"
|
||||||
|
|
||||||
|
1784880583 d:\jianbao\project\À¶ÑÀת½Ó°å-¶ºÃ¨°ô\sdk\apps\usr_le_code\usr_usb_jb.h
|
||||||
|
<stdint.h>
|
||||||
|
|
||||||
|
1784882217 source:d:\jianbao\project\À¶ÑÀת½Ó°å-¶ºÃ¨°ô\sdk\apps\usr_le_code\usr_usb_jb.c
|
||||||
|
"system/includes.h"
|
||||||
|
"app_config.h"
|
||||||
|
"vm.h"
|
||||||
|
"usr_usb_jb.h"
|
||||||
|
"debug.h"
|
||||||
|
"usb/device/cdc.h"
|
||||||
|
|
||||||
|
|||||||
+1103
-1133
File diff suppressed because it is too large
Load Diff
@@ -34,6 +34,7 @@
|
|||||||
|
|
||||||
#if TCFG_USB_SLAVE_CDC_ENABLE
|
#if TCFG_USB_SLAVE_CDC_ENABLE
|
||||||
#include "usb/device/cdc.h"
|
#include "usb/device/cdc.h"
|
||||||
|
#include "usr_usb_jb.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if (TCFG_USB_DM_MULTIPLEX_WITH_SD_DAT0)
|
#if (TCFG_USB_DM_MULTIPLEX_WITH_SD_DAT0)
|
||||||
@@ -186,6 +187,13 @@ static void usb_cdc_wakeup(struct usb_device_t *usb_device)
|
|||||||
log_debug("cdc rx hook");
|
log_debug("cdc rx hook");
|
||||||
rlen = cdc_read_data(usb_id, buf, 64);
|
rlen = cdc_read_data(usb_id, buf, 64);
|
||||||
|
|
||||||
|
/* 见宝协议:产品码配置帧 55 AA ... */
|
||||||
|
if (rlen > 0) {
|
||||||
|
printf("cdc rx %u\n", rlen);
|
||||||
|
put_buf(buf, rlen);
|
||||||
|
usr_usb_jb_feed(buf, rlen);
|
||||||
|
}
|
||||||
|
|
||||||
/* put_buf(buf, rlen);//固件三部测试使用 */
|
/* put_buf(buf, rlen);//固件三部测试使用 */
|
||||||
/* cdc_write_data(usb_id, buf, rlen);//固件三部测试使用 */
|
/* cdc_write_data(usb_id, buf, rlen);//固件三部测试使用 */
|
||||||
|
|
||||||
|
|||||||
@@ -329,21 +329,9 @@ static void cbk_packet_handler(uint8_t packet_type, uint16_t channel, uint8_t *p
|
|||||||
con_handle = 0;
|
con_handle = 0;
|
||||||
ble_user_cmd_prepare(BLE_CMD_ATT_SEND_INIT, 4, con_handle, 0, 0, 0);
|
ble_user_cmd_prepare(BLE_CMD_ATT_SEND_INIT, 4, con_handle, 0, 0, 0);
|
||||||
set_ble_work_state(BLE_ST_DISCONN);
|
set_ble_work_state(BLE_ST_DISCONN);
|
||||||
// set_app_connect_type(TYPE_NULL);
|
|
||||||
if (!ble_update_get_ready_jump_flag()) {
|
if (!ble_update_get_ready_jump_flag()) {
|
||||||
//extern u8 usr_get_pair_flag();
|
|
||||||
//extern void usr_reconn_adv();
|
|
||||||
if(usr_var.usr_goto_updata==0)
|
if(usr_var.usr_goto_updata==0)
|
||||||
{
|
{
|
||||||
/*if(usr_get_pair_flag())
|
|
||||||
{
|
|
||||||
usr_reconn_adv();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
bt_ble_adv_enable(1);
|
|
||||||
}*/
|
|
||||||
//extern void usr_ble_adv_init();
|
|
||||||
usr_ble_adv_init();
|
usr_ble_adv_init();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -235,6 +235,10 @@ void app_main()
|
|||||||
app_poweron_check(update);
|
app_poweron_check(update);
|
||||||
|
|
||||||
usr_read_device_sta();
|
usr_read_device_sta();
|
||||||
|
{
|
||||||
|
extern void usr_prodcode_init(void);
|
||||||
|
usr_prodcode_init();
|
||||||
|
}
|
||||||
usr_var.usr_goto_pair = 1;
|
usr_var.usr_goto_pair = 1;
|
||||||
usr_clear_pair_info_noreset();
|
usr_clear_pair_info_noreset();
|
||||||
|
|
||||||
|
|||||||
@@ -15,6 +15,7 @@
|
|||||||
#include "vm.h"
|
#include "vm.h"
|
||||||
#include "bleproto.h"
|
#include "bleproto.h"
|
||||||
#include "bleproto_api.h"
|
#include "bleproto_api.h"
|
||||||
|
#include "usr_usb_jb.h"
|
||||||
|
|
||||||
#define LOG_TAG_CONST APP
|
#define LOG_TAG_CONST APP
|
||||||
#define LOG_TAG "[APP]"
|
#define LOG_TAG "[APP]"
|
||||||
@@ -93,9 +94,12 @@ void usr_ble_adv_init()
|
|||||||
{
|
{
|
||||||
int8_t txpower = 0;
|
int8_t txpower = 0;
|
||||||
uint8_t manucode[BLEPROTO_ADV_TLV_LENGTH_MANUCODE] = {0};
|
uint8_t manucode[BLEPROTO_ADV_TLV_LENGTH_MANUCODE] = {0};
|
||||||
uint8_t prodcode[BLEPROTO_ADV_TLV_LENGTH_PRODCODE] = {'C', 'B', 'C', '0'};
|
uint8_t prodcode[BLEPROTO_ADV_TLV_LENGTH_PRODCODE] = {0};
|
||||||
uint8_t gmac[6] = {0};
|
uint8_t gmac[6] = {0};
|
||||||
uint8_t pcode[6] = {'P', 'I', 'C', 'B', 'C', '0'};
|
uint8_t pcode[BLE_PROTO_ADV_LENGTH_PCODE] = {0};
|
||||||
|
|
||||||
|
/* flash 优先,无有效数据则用模块内默认值 */
|
||||||
|
usr_prodcode_get(prodcode, pcode);
|
||||||
|
|
||||||
usr_set_adv_interval(80);
|
usr_set_adv_interval(80);
|
||||||
if (usr_var.usr_ota_succ_flag) {
|
if (usr_var.usr_ota_succ_flag) {
|
||||||
@@ -105,15 +109,24 @@ void usr_ble_adv_init()
|
|||||||
if (usr_var.usr_goto_pair) {
|
if (usr_var.usr_goto_pair) {
|
||||||
usr_clear_pair_info_noreset();
|
usr_clear_pair_info_noreset();
|
||||||
printf("power on force to pair flag= %d\n", usr_auth_data.paired_flag);
|
printf("power on force to pair flag= %d\n", usr_auth_data.paired_flag);
|
||||||
|
printf("adv prodcode=%c%c%c%c pcode=%c%c%c%c%c%c\n",
|
||||||
|
prodcode[0], prodcode[1], prodcode[2], prodcode[3],
|
||||||
|
pcode[0], pcode[1], pcode[2], pcode[3], pcode[4], pcode[5]);
|
||||||
muti_adv_data_len = bleproto_advdata_encode4bind(muti_adv_data, txpower, manucode, pcode, prodcode);
|
muti_adv_data_len = bleproto_advdata_encode4bind(muti_adv_data, txpower, manucode, pcode, prodcode);
|
||||||
usr_var.usr_adv_flag = 1;
|
usr_var.usr_adv_flag = 1;
|
||||||
} else {
|
} else {
|
||||||
usr_get_pair_info();
|
usr_get_pair_info();
|
||||||
if (usr_auth_data.paired_flag == 0) {
|
if (usr_auth_data.paired_flag == 0) {
|
||||||
|
printf("adv prodcode=%c%c%c%c pcode=%c%c%c%c%c%c\n",
|
||||||
|
prodcode[0], prodcode[1], prodcode[2], prodcode[3],
|
||||||
|
pcode[0], pcode[1], pcode[2], pcode[3], pcode[4], pcode[5]);
|
||||||
muti_adv_data_len = bleproto_advdata_encode4bind(muti_adv_data, txpower, manucode, pcode, prodcode);
|
muti_adv_data_len = bleproto_advdata_encode4bind(muti_adv_data, txpower, manucode, pcode, prodcode);
|
||||||
usr_var.usr_adv_flag = 0;
|
usr_var.usr_adv_flag = 0;
|
||||||
} else {
|
} else {
|
||||||
memcpy(gmac, usr_auth_data.gwmac, 6);
|
memcpy(gmac, usr_auth_data.gwmac, 6);
|
||||||
|
printf("adv prodcode=%c%c%c%c pcode=%c%c%c%c%c%c\n",
|
||||||
|
prodcode[0], prodcode[1], prodcode[2], prodcode[3],
|
||||||
|
pcode[0], pcode[1], pcode[2], pcode[3], pcode[4], pcode[5]);
|
||||||
muti_adv_data_len = bleproto_advdata_encode4reconn(muti_adv_data, txpower, gmac, manucode, pcode, prodcode);
|
muti_adv_data_len = bleproto_advdata_encode4reconn(muti_adv_data, txpower, gmac, manucode, pcode, prodcode);
|
||||||
usr_var.usr_adv_flag = 1;
|
usr_var.usr_adv_flag = 1;
|
||||||
}
|
}
|
||||||
@@ -125,11 +138,6 @@ void usr_ble_adv_init()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
u8 usr_get_pair_flag()
|
|
||||||
{
|
|
||||||
return usr_auth_data.paired_flag;
|
|
||||||
}
|
|
||||||
|
|
||||||
void usr_ble_adv_updata()
|
void usr_ble_adv_updata()
|
||||||
{
|
{
|
||||||
static u16 usr_goto_slow_adv = 0;
|
static u16 usr_goto_slow_adv = 0;
|
||||||
|
|||||||
@@ -0,0 +1,50 @@
|
|||||||
|
/******************************************************************************
|
||||||
|
* @file usr_prodcode.h
|
||||||
|
* @brief 产品码 / 品类码持久化与广播刷新
|
||||||
|
* @author cyWu <1917507415@qq.com>
|
||||||
|
* @date 2026.07.24
|
||||||
|
* @version V1.0.0
|
||||||
|
* @history
|
||||||
|
* - V1.0.0, 2026.07.24, cyWu, 首次发布
|
||||||
|
******************************************************************************/
|
||||||
|
|
||||||
|
#ifndef __USR_PRODCODE_H__
|
||||||
|
#define __USR_PRODCODE_H__
|
||||||
|
|
||||||
|
#include "system/includes.h"
|
||||||
|
#include "bleproto_packer.h"
|
||||||
|
|
||||||
|
/*============================================================================*/
|
||||||
|
/* 宏定义 */
|
||||||
|
/*============================================================================*/
|
||||||
|
|
||||||
|
#define USR_PRODCODE_LEN BLEPROTO_ADV_TLV_LENGTH_PRODCODE /* 4 */
|
||||||
|
#define USR_PCODE_LEN BLE_PROTO_ADV_LENGTH_PCODE /* 6 */
|
||||||
|
#define USR_PRODCODE_MAGIC 0xA5
|
||||||
|
|
||||||
|
/*============================================================================*/
|
||||||
|
/* 外部接口 */
|
||||||
|
/*============================================================================*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief 上电从 flash 加载产品码,无则使用默认值
|
||||||
|
*/
|
||||||
|
void usr_prodcode_init(void);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief 获取当前产品码(RAM 缓存)
|
||||||
|
* @param prodcode 输出 4 字节品类/产品型号
|
||||||
|
* @param pcode 输出 6 字节 productCode
|
||||||
|
*/
|
||||||
|
void usr_prodcode_get(u8 prodcode[USR_PRODCODE_LEN], u8 pcode[USR_PCODE_LEN]);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief 写入产品码到 flash,并触发重新广播
|
||||||
|
* @param prodcode 4 字节
|
||||||
|
* @param pcode 6 字节
|
||||||
|
* @return 0 成功,其它失败
|
||||||
|
*/
|
||||||
|
int usr_prodcode_set_save_and_readv(const u8 prodcode[USR_PRODCODE_LEN],
|
||||||
|
const u8 pcode[USR_PCODE_LEN]);
|
||||||
|
|
||||||
|
#endif /* __USR_PRODCODE_H__ */
|
||||||
@@ -0,0 +1,400 @@
|
|||||||
|
/******************************************************************************
|
||||||
|
* @file usr_usb_jb.c
|
||||||
|
* @brief USB CDC 见宝帧解析:校验后写入产品码并重广播
|
||||||
|
* @author cyWu <1917507415@qq.com>
|
||||||
|
* @date 2026.07.24
|
||||||
|
* @version V1.0.1
|
||||||
|
* @history
|
||||||
|
* - V1.0.1, 2026.07.24, cyWu, CDC 中断内禁止 syscfg_write,改延时到任务上下文
|
||||||
|
* - V1.0.0, 2026.07.24, cyWu, 首次发布
|
||||||
|
******************************************************************************/
|
||||||
|
|
||||||
|
#include "system/includes.h"
|
||||||
|
#include "app_config.h"
|
||||||
|
#include "vm.h"
|
||||||
|
#include "usr_usb_jb.h"
|
||||||
|
|
||||||
|
#define LOG_TAG_CONST APP
|
||||||
|
#define LOG_TAG "[USB_JB]"
|
||||||
|
#define LOG_ERROR_ENABLE
|
||||||
|
#define LOG_DEBUG_ENABLE
|
||||||
|
#define LOG_INFO_ENABLE
|
||||||
|
#define LOG_CLI_ENABLE
|
||||||
|
#include "debug.h"
|
||||||
|
|
||||||
|
#if TCFG_USB_SLAVE_CDC_ENABLE
|
||||||
|
#include "usb/device/cdc.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/*============================================================================*/
|
||||||
|
/* 协议常量(对齐 jb_protocol / jb_common) */
|
||||||
|
/*============================================================================*/
|
||||||
|
|
||||||
|
#define PKT_HEAD_0 0x55
|
||||||
|
#define PKT_HEAD_1 0xAA
|
||||||
|
#define MAX_PACKAGE_LEN 128
|
||||||
|
#define JB_RB_CAPACITY 256
|
||||||
|
#define USR_PROD_MAGIC 0x5A
|
||||||
|
|
||||||
|
#ifndef CFG_USER_PROD_INFO
|
||||||
|
#define CFG_USER_PROD_INFO 28
|
||||||
|
#endif
|
||||||
|
|
||||||
|
extern void usr_ble_adv_init(void);
|
||||||
|
|
||||||
|
/*============================================================================*/
|
||||||
|
/* 类型 */
|
||||||
|
/*============================================================================*/
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
uint8_t magic;
|
||||||
|
uint8_t prodcode[USR_PRODCODE_LEN];
|
||||||
|
uint8_t pcode[USR_PCODE_LEN];
|
||||||
|
} usr_prod_info_t;
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
uint8_t buf[JB_RB_CAPACITY];
|
||||||
|
uint16_t write;
|
||||||
|
uint16_t read;
|
||||||
|
uint16_t count;
|
||||||
|
} usr_jb_rb_t;
|
||||||
|
|
||||||
|
/*============================================================================*/
|
||||||
|
/* 静态变量 */
|
||||||
|
/*============================================================================*/
|
||||||
|
|
||||||
|
static const uint8_t s_default_prodcode[USR_PRODCODE_LEN] = {'C', 'B', 'C', '0'};
|
||||||
|
static const uint8_t s_default_pcode[USR_PCODE_LEN] = {'P', 'I', 'C', 'B', 'C', '0'};
|
||||||
|
|
||||||
|
static uint8_t s_prodcode[USR_PRODCODE_LEN];
|
||||||
|
static uint8_t s_pcode[USR_PCODE_LEN];
|
||||||
|
static usr_jb_rb_t s_rb;
|
||||||
|
|
||||||
|
/* 待写 flash / 回 ACK 的缓存(ISR 只填,定时器里执行) */
|
||||||
|
static uint8_t s_pending_save;
|
||||||
|
static uint8_t s_pending_cmd;
|
||||||
|
static uint8_t s_pending_sn;
|
||||||
|
static uint8_t s_pending_prod[USR_PRODCODE_LEN];
|
||||||
|
static uint8_t s_pending_pcode[USR_PCODE_LEN];
|
||||||
|
static int s_process_timer;
|
||||||
|
|
||||||
|
/*============================================================================*/
|
||||||
|
/* 环形缓冲 / 校验 */
|
||||||
|
/*============================================================================*/
|
||||||
|
|
||||||
|
static void usr_jb_rb_init(usr_jb_rb_t *rb)
|
||||||
|
{
|
||||||
|
memset(rb, 0, sizeof(*rb));
|
||||||
|
}
|
||||||
|
|
||||||
|
static void usr_jb_rb_push(usr_jb_rb_t *rb, uint8_t byte)
|
||||||
|
{
|
||||||
|
if (rb->count >= JB_RB_CAPACITY) {
|
||||||
|
rb->read = (rb->read + 1) % JB_RB_CAPACITY;
|
||||||
|
rb->count--;
|
||||||
|
}
|
||||||
|
rb->buf[rb->write] = byte;
|
||||||
|
rb->write = (rb->write + 1) % JB_RB_CAPACITY;
|
||||||
|
rb->count++;
|
||||||
|
}
|
||||||
|
|
||||||
|
static uint8_t usr_jb_rb_pop(usr_jb_rb_t *rb)
|
||||||
|
{
|
||||||
|
uint8_t b = rb->buf[rb->read];
|
||||||
|
rb->read = (rb->read + 1) % JB_RB_CAPACITY;
|
||||||
|
rb->count--;
|
||||||
|
return b;
|
||||||
|
}
|
||||||
|
|
||||||
|
static uint16_t usr_jb_rb_available(const usr_jb_rb_t *rb)
|
||||||
|
{
|
||||||
|
return rb->count;
|
||||||
|
}
|
||||||
|
|
||||||
|
static uint16_t usr_jb_read_u16_be(const uint8_t *buf)
|
||||||
|
{
|
||||||
|
return ((uint16_t)buf[0] << 8) | buf[1];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief 校验和:sum(LEN_H .. payload_last) & 0xFF
|
||||||
|
*/
|
||||||
|
static uint8_t usr_jb_checksum(const uint8_t *frame, uint16_t total_len)
|
||||||
|
{
|
||||||
|
uint16_t sum = 0;
|
||||||
|
uint16_t i;
|
||||||
|
|
||||||
|
if (!frame || total_len < 4) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
for (i = 2; i < total_len - 1; i++) {
|
||||||
|
sum += frame[i];
|
||||||
|
}
|
||||||
|
return (uint8_t)(sum & 0xFF);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief 从环形缓冲提取完整帧(逻辑对齐 jbGetOnePacket)
|
||||||
|
* @return 0 成功, 1 需要更多数据, -2 校验失败
|
||||||
|
*/
|
||||||
|
static int8_t usr_jb_get_one_packet(uint8_t *out, uint16_t *out_len)
|
||||||
|
{
|
||||||
|
static uint8_t state = 0;
|
||||||
|
static uint16_t expect = 0;
|
||||||
|
static uint16_t idx = 0;
|
||||||
|
static uint8_t prev = 0;
|
||||||
|
|
||||||
|
while (usr_jb_rb_available(&s_rb)) {
|
||||||
|
uint8_t b = usr_jb_rb_pop(&s_rb);
|
||||||
|
|
||||||
|
if (state == 0) {
|
||||||
|
if (prev == PKT_HEAD_0 && b == PKT_HEAD_1) {
|
||||||
|
out[0] = PKT_HEAD_0;
|
||||||
|
out[1] = PKT_HEAD_1;
|
||||||
|
idx = 2;
|
||||||
|
state = 1;
|
||||||
|
}
|
||||||
|
} else if (state == 1) {
|
||||||
|
out[idx++] = b;
|
||||||
|
if (idx == 6) {
|
||||||
|
expect = 4 + usr_jb_read_u16_be(&out[2]);
|
||||||
|
if (expect > MAX_PACKAGE_LEN || expect < 7) {
|
||||||
|
state = 0;
|
||||||
|
} else {
|
||||||
|
state = 2;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
out[idx++] = b;
|
||||||
|
if (idx >= expect) {
|
||||||
|
state = 0;
|
||||||
|
if (out[expect - 1] == usr_jb_checksum(out, expect)) {
|
||||||
|
*out_len = expect;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
printf("usr_jb checksum fail expect=0x%02x calc=0x%02x\n",
|
||||||
|
out[expect - 1], usr_jb_checksum(out, expect));
|
||||||
|
return -2;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
prev = b;
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*============================================================================*/
|
||||||
|
/* 产品码 flash */
|
||||||
|
/*============================================================================*/
|
||||||
|
|
||||||
|
static void usr_prodcode_set_default(void)
|
||||||
|
{
|
||||||
|
memcpy(s_prodcode, s_default_prodcode, USR_PRODCODE_LEN);
|
||||||
|
memcpy(s_pcode, s_default_pcode, USR_PCODE_LEN);
|
||||||
|
}
|
||||||
|
|
||||||
|
void usr_prodcode_init(void)
|
||||||
|
{
|
||||||
|
usr_prod_info_t info;
|
||||||
|
int ret;
|
||||||
|
|
||||||
|
usr_jb_rb_init(&s_rb);
|
||||||
|
s_pending_save = 0;
|
||||||
|
s_process_timer = 0;
|
||||||
|
usr_prodcode_set_default();
|
||||||
|
|
||||||
|
memset(&info, 0, sizeof(info));
|
||||||
|
ret = syscfg_read(CFG_USER_PROD_INFO, (u8 *)&info, sizeof(info));
|
||||||
|
if (ret > 0 && info.magic == USR_PROD_MAGIC) {
|
||||||
|
memcpy(s_prodcode, info.prodcode, USR_PRODCODE_LEN);
|
||||||
|
memcpy(s_pcode, info.pcode, USR_PCODE_LEN);
|
||||||
|
printf("prodcode from flash: %c%c%c%c / %c%c%c%c%c%c\n",
|
||||||
|
s_prodcode[0], s_prodcode[1], s_prodcode[2], s_prodcode[3],
|
||||||
|
s_pcode[0], s_pcode[1], s_pcode[2], s_pcode[3], s_pcode[4], s_pcode[5]);
|
||||||
|
} else {
|
||||||
|
printf("prodcode use default: %c%c%c%c / %c%c%c%c%c%c\n",
|
||||||
|
s_prodcode[0], s_prodcode[1], s_prodcode[2], s_prodcode[3],
|
||||||
|
s_pcode[0], s_pcode[1], s_pcode[2], s_pcode[3], s_pcode[4], s_pcode[5]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void usr_prodcode_get(uint8_t *prodcode, uint8_t *pcode)
|
||||||
|
{
|
||||||
|
if (prodcode) {
|
||||||
|
memcpy(prodcode, s_prodcode, USR_PRODCODE_LEN);
|
||||||
|
}
|
||||||
|
if (pcode) {
|
||||||
|
memcpy(pcode, s_pcode, USR_PCODE_LEN);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief 写 VM(必须在任务/定时器上下文调用,禁止在 CDC 中断里调用)
|
||||||
|
*/
|
||||||
|
static int usr_prodcode_save(const uint8_t *prodcode, const uint8_t *pcode)
|
||||||
|
{
|
||||||
|
usr_prod_info_t info;
|
||||||
|
int ret;
|
||||||
|
|
||||||
|
if (!prodcode || !pcode) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
memset(&info, 0, sizeof(info));
|
||||||
|
info.magic = USR_PROD_MAGIC;
|
||||||
|
memcpy(info.prodcode, prodcode, USR_PRODCODE_LEN);
|
||||||
|
memcpy(info.pcode, pcode, USR_PCODE_LEN);
|
||||||
|
|
||||||
|
memcpy(s_prodcode, prodcode, USR_PRODCODE_LEN);
|
||||||
|
memcpy(s_pcode, pcode, USR_PCODE_LEN);
|
||||||
|
|
||||||
|
ret = syscfg_write(CFG_USER_PROD_INFO, (u8 *)&info, sizeof(info));
|
||||||
|
if (ret <= 0) {
|
||||||
|
printf("prodcode flash write fail ret=%d\n", ret);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
printf("prodcode saved: %c%c%c%c / %c%c%c%c%c%c ret=%d\n",
|
||||||
|
s_prodcode[0], s_prodcode[1], s_prodcode[2], s_prodcode[3],
|
||||||
|
s_pcode[0], s_pcode[1], s_pcode[2], s_pcode[3], s_pcode[4], s_pcode[5],
|
||||||
|
ret);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief 解析产品码 payload(仅 TLV)
|
||||||
|
* 格式: [len=4][ProdtCode 4B][len=6][productCode 6B]
|
||||||
|
* @return 0 成功, -1 失败
|
||||||
|
*/
|
||||||
|
static int usr_jb_parse_prod_payload(const uint8_t *payload, uint16_t payload_len,
|
||||||
|
uint8_t *prodcode, uint8_t *pcode)
|
||||||
|
{
|
||||||
|
if (!payload || !prodcode || !pcode) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* TLV: 04 xx xx xx xx 06 yy yy yy yy yy yy */
|
||||||
|
if (payload_len < (1 + USR_PRODCODE_LEN + 1 + USR_PCODE_LEN)) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
if (payload[0] != USR_PRODCODE_LEN) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
if (payload[1 + USR_PRODCODE_LEN] != USR_PCODE_LEN) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
memcpy(prodcode, &payload[1], USR_PRODCODE_LEN);
|
||||||
|
memcpy(pcode, &payload[1 + USR_PRODCODE_LEN + 1], USR_PCODE_LEN);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
#if TCFG_USB_SLAVE_CDC_ENABLE
|
||||||
|
/**
|
||||||
|
* @brief 回 ACK:CMD = 请求 CMD+1,payload = result
|
||||||
|
*/
|
||||||
|
static void usr_jb_send_ack(uint8_t cmd, uint8_t sn, uint8_t result)
|
||||||
|
{
|
||||||
|
uint8_t buf[8];
|
||||||
|
uint16_t len_field = 4; /* CMD+SN+result+CKSUM */
|
||||||
|
uint16_t total = len_field + 4;
|
||||||
|
|
||||||
|
buf[0] = PKT_HEAD_0;
|
||||||
|
buf[1] = PKT_HEAD_1;
|
||||||
|
buf[2] = (uint8_t)(len_field >> 8);
|
||||||
|
buf[3] = (uint8_t)(len_field & 0xFF);
|
||||||
|
buf[4] = (uint8_t)(cmd + 1);
|
||||||
|
buf[5] = sn;
|
||||||
|
buf[6] = result;
|
||||||
|
buf[7] = usr_jb_checksum(buf, total);
|
||||||
|
cdc_write_data(0, buf, total);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief 任务上下文:解析帧 / 写 flash / ACK / 重建广播
|
||||||
|
*/
|
||||||
|
static void usr_jb_process_timeout(void *priv)
|
||||||
|
{
|
||||||
|
uint8_t pkt[MAX_PACKAGE_LEN];
|
||||||
|
uint16_t pkt_len;
|
||||||
|
int8_t ret;
|
||||||
|
uint8_t cmd;
|
||||||
|
uint8_t sn;
|
||||||
|
uint16_t payload_len;
|
||||||
|
|
||||||
|
(void)priv;
|
||||||
|
s_process_timer = 0;
|
||||||
|
|
||||||
|
/* 先把环形缓冲里的完整帧抽完 */
|
||||||
|
do {
|
||||||
|
pkt_len = 0;
|
||||||
|
ret = usr_jb_get_one_packet(pkt, &pkt_len);
|
||||||
|
if (ret != 0) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
cmd = pkt[4];
|
||||||
|
sn = pkt[5];
|
||||||
|
payload_len = (pkt_len >= 7) ? (pkt_len - 7) : 0;
|
||||||
|
|
||||||
|
printf("usr_jb cmd=0x%02x sn=%u plen=%u\n", cmd, sn, payload_len);
|
||||||
|
printf_buf(pkt, pkt_len);
|
||||||
|
|
||||||
|
if (cmd != USR_JB_CMD_SET_PRODCODE) {
|
||||||
|
printf("usr_jb ignore cmd 0x%02x\n", cmd);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (usr_jb_parse_prod_payload(&pkt[6], payload_len,
|
||||||
|
s_pending_prod, s_pending_pcode) != 0) {
|
||||||
|
printf("usr_jb set prodcode payload invalid\n");
|
||||||
|
#if TCFG_USB_SLAVE_CDC_ENABLE
|
||||||
|
usr_jb_send_ack(cmd, sn, 0x01);
|
||||||
|
#endif
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 缓存后统一落盘,避免同一周期多次写 flash */
|
||||||
|
s_pending_cmd = cmd;
|
||||||
|
s_pending_sn = sn;
|
||||||
|
s_pending_save = 1;
|
||||||
|
} while (1);
|
||||||
|
|
||||||
|
if (!s_pending_save) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
s_pending_save = 0;
|
||||||
|
|
||||||
|
if (usr_prodcode_save(s_pending_prod, s_pending_pcode) == 0) {
|
||||||
|
#if TCFG_USB_SLAVE_CDC_ENABLE
|
||||||
|
usr_jb_send_ack(s_pending_cmd, s_pending_sn, 0x00);
|
||||||
|
#endif
|
||||||
|
extern void usr_goto_pair_mode(void);
|
||||||
|
usr_goto_pair_mode();
|
||||||
|
printf("prodcode applied, adv rebuilt\n");
|
||||||
|
} else {
|
||||||
|
#if TCFG_USB_SLAVE_CDC_ENABLE
|
||||||
|
usr_jb_send_ack(s_pending_cmd, s_pending_sn, 0x05);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief USB CDC 喂数:仅压入环形缓冲并挂定时器(可在中断调用)
|
||||||
|
*/
|
||||||
|
void usr_usb_jb_feed(uint8_t *buf, uint32_t len)
|
||||||
|
{
|
||||||
|
uint32_t i;
|
||||||
|
|
||||||
|
if (!buf || len == 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (i = 0; i < len; i++) {
|
||||||
|
usr_jb_rb_push(&s_rb, buf[i]);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 延时到系统定时器任务再解析/写 flash,避免中断里擦写导致复位 */
|
||||||
|
if (s_process_timer == 0) {
|
||||||
|
s_process_timer = sys_timeout_add(NULL, usr_jb_process_timeout, 20);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,51 @@
|
|||||||
|
/******************************************************************************
|
||||||
|
* @file usr_usb_jb.h
|
||||||
|
* @brief USB CDC 见宝帧解析:设置 ProdtCode / productCode 并落盘重广播
|
||||||
|
* @author cyWu <1917507415@qq.com>
|
||||||
|
* @date 2026.07.24
|
||||||
|
* @version V1.0.0
|
||||||
|
* @history
|
||||||
|
* - V1.0.0, 2026.07.24, cyWu, 首次发布
|
||||||
|
******************************************************************************/
|
||||||
|
|
||||||
|
#ifndef __USR_USB_JB_H__
|
||||||
|
#define __USR_USB_JB_H__
|
||||||
|
|
||||||
|
#include <stdint.h>
|
||||||
|
|
||||||
|
/*============================================================================*/
|
||||||
|
/* 宏定义 */
|
||||||
|
/*============================================================================*/
|
||||||
|
|
||||||
|
#define USR_PRODCODE_LEN (4)
|
||||||
|
#define USR_PCODE_LEN (6)
|
||||||
|
#define USR_JB_CMD_SET_PRODCODE (0x64) /**< USB 下发产品码命令 */
|
||||||
|
|
||||||
|
/*============================================================================*/
|
||||||
|
/* 外部接口 */
|
||||||
|
/*============================================================================*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief 上电加载产品码(flash 优先,否则默认值)
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
void usr_prodcode_init(void);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief 获取当前产品码缓存
|
||||||
|
* @param prodcode 输出 ProdtCode,长度 USR_PRODCODE_LEN,可为 NULL
|
||||||
|
* @param pcode 输出 productCode,长度 USR_PCODE_LEN,可为 NULL
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
void usr_prodcode_get(uint8_t *prodcode, uint8_t *pcode);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief USB CDC 喂数:仅入环并挂定时器(可在中断调用)
|
||||||
|
* @note 帧解析 / syscfg_write / ACK / 重广播在定时器任务中执行
|
||||||
|
* @param buf 接收缓冲
|
||||||
|
* @param len 长度
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
void usr_usb_jb_feed(uint8_t *buf, uint32_t len);
|
||||||
|
|
||||||
|
#endif /* __USR_USB_JB_H__ */
|
||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
File diff suppressed because one or more lines are too long
@@ -659,6 +659,9 @@ obj/Release/apps/common/device/usb/device/task_pc.o
|
|||||||
-r=obj/Release/apps/common/device/usb/device/task_pc.o,app_get_curr_task,l
|
-r=obj/Release/apps/common/device/usb/device/task_pc.o,app_get_curr_task,l
|
||||||
-r=obj/Release/apps/common/device/usb/device/task_pc.o,usb_device2id,l
|
-r=obj/Release/apps/common/device/usb/device/task_pc.o,usb_device2id,l
|
||||||
-r=obj/Release/apps/common/device/usb/device/task_pc.o,cdc_read_data,l
|
-r=obj/Release/apps/common/device/usb/device/task_pc.o,cdc_read_data,l
|
||||||
|
-r=obj/Release/apps/common/device/usb/device/task_pc.o,printf,l
|
||||||
|
-r=obj/Release/apps/common/device/usb/device/task_pc.o,put_buf,l
|
||||||
|
-r=obj/Release/apps/common/device/usb/device/task_pc.o,usr_usb_jb_feed,l
|
||||||
-r=obj/Release/apps/common/device/usb/device/task_pc.o,log_tag_const_i_USB,l
|
-r=obj/Release/apps/common/device/usb/device/task_pc.o,log_tag_const_i_USB,l
|
||||||
-r=obj/Release/apps/common/device/usb/device/task_pc.o,log_tag_const_d_USB,l
|
-r=obj/Release/apps/common/device/usb/device/task_pc.o,log_tag_const_d_USB,l
|
||||||
obj/Release/apps/common/device/usb/device/uac1.o
|
obj/Release/apps/common/device/usb/device/uac1.o
|
||||||
@@ -1604,6 +1607,7 @@ obj/Release/apps/earphone/app_main.o
|
|||||||
-r=obj/Release/apps/earphone/app_main.o,audio_dec_init,l
|
-r=obj/Release/apps/earphone/app_main.o,audio_dec_init,l
|
||||||
-r=obj/Release/apps/earphone/app_main.o,check_power_on_voltage,l
|
-r=obj/Release/apps/earphone/app_main.o,check_power_on_voltage,l
|
||||||
-r=obj/Release/apps/earphone/app_main.o,usr_read_device_sta,l
|
-r=obj/Release/apps/earphone/app_main.o,usr_read_device_sta,l
|
||||||
|
-r=obj/Release/apps/earphone/app_main.o,usr_prodcode_init,l
|
||||||
-r=obj/Release/apps/earphone/app_main.o,usr_clear_pair_info_noreset,l
|
-r=obj/Release/apps/earphone/app_main.o,usr_clear_pair_info_noreset,l
|
||||||
-r=obj/Release/apps/earphone/app_main.o,ui_manage_init,l
|
-r=obj/Release/apps/earphone/app_main.o,ui_manage_init,l
|
||||||
-r=obj/Release/apps/earphone/app_main.o,ui_update_status,l
|
-r=obj/Release/apps/earphone/app_main.o,ui_update_status,l
|
||||||
@@ -3290,11 +3294,11 @@ obj/Release/apps/usr_le_code/usr_le_adv.o
|
|||||||
-r=obj/Release/apps/usr_le_code/usr_le_adv.o,ble_multi_trans_disconnect,l
|
-r=obj/Release/apps/usr_le_code/usr_le_adv.o,ble_multi_trans_disconnect,l
|
||||||
-r=obj/Release/apps/usr_le_code/usr_le_adv.o,os_time_dly,l
|
-r=obj/Release/apps/usr_le_code/usr_le_adv.o,os_time_dly,l
|
||||||
-r=obj/Release/apps/usr_le_code/usr_le_adv.o,usr_ble_adv_init,pl
|
-r=obj/Release/apps/usr_le_code/usr_le_adv.o,usr_ble_adv_init,pl
|
||||||
|
-r=obj/Release/apps/usr_le_code/usr_le_adv.o,usr_prodcode_get,l
|
||||||
-r=obj/Release/apps/usr_le_code/usr_le_adv.o,usr_set_adv_interval,l
|
-r=obj/Release/apps/usr_le_code/usr_le_adv.o,usr_set_adv_interval,l
|
||||||
-r=obj/Release/apps/usr_le_code/usr_le_adv.o,bleproto_advdata_encode4bind,l
|
-r=obj/Release/apps/usr_le_code/usr_le_adv.o,bleproto_advdata_encode4bind,l
|
||||||
-r=obj/Release/apps/usr_le_code/usr_le_adv.o,bleproto_advdata_encode4reconn,l
|
-r=obj/Release/apps/usr_le_code/usr_le_adv.o,bleproto_advdata_encode4reconn,l
|
||||||
-r=obj/Release/apps/usr_le_code/usr_le_adv.o,sys_timer_add,l
|
-r=obj/Release/apps/usr_le_code/usr_le_adv.o,sys_timer_add,l
|
||||||
-r=obj/Release/apps/usr_le_code/usr_le_adv.o,usr_get_pair_flag,pl
|
|
||||||
-r=obj/Release/apps/usr_le_code/usr_le_adv.o,usr_ble_adv_updata,pl
|
-r=obj/Release/apps/usr_le_code/usr_le_adv.o,usr_ble_adv_updata,pl
|
||||||
-r=obj/Release/apps/usr_le_code/usr_le_adv.o,ble_trans_module_enable,l
|
-r=obj/Release/apps/usr_le_code/usr_le_adv.o,ble_trans_module_enable,l
|
||||||
-r=obj/Release/apps/usr_le_code/usr_le_adv.o,muti_make_set_adv_data,l
|
-r=obj/Release/apps/usr_le_code/usr_le_adv.o,muti_make_set_adv_data,l
|
||||||
@@ -3359,6 +3363,18 @@ obj/Release/apps/usr_le_code/usr_le_recieve.o
|
|||||||
-r=obj/Release/apps/usr_le_code/usr_le_recieve.o,usr_auth_data,pl
|
-r=obj/Release/apps/usr_le_code/usr_le_recieve.o,usr_auth_data,pl
|
||||||
-r=obj/Release/apps/usr_le_code/usr_le_recieve.o,usr_var,l
|
-r=obj/Release/apps/usr_le_code/usr_le_recieve.o,usr_var,l
|
||||||
obj/Release/apps/usr_le_code/usr_le_recieve_demo.o
|
obj/Release/apps/usr_le_code/usr_le_recieve_demo.o
|
||||||
|
obj/Release/apps/usr_le_code/usr_usb_jb.o
|
||||||
|
-r=obj/Release/apps/usr_le_code/usr_usb_jb.o,usr_prodcode_init,pl
|
||||||
|
-r=obj/Release/apps/usr_le_code/usr_usb_jb.o,syscfg_read,l
|
||||||
|
-r=obj/Release/apps/usr_le_code/usr_usb_jb.o,printf,l
|
||||||
|
-r=obj/Release/apps/usr_le_code/usr_usb_jb.o,usr_prodcode_get,pl
|
||||||
|
-r=obj/Release/apps/usr_le_code/usr_usb_jb.o,usr_usb_jb_feed,pl
|
||||||
|
-r=obj/Release/apps/usr_le_code/usr_usb_jb.o,sys_timeout_add,l
|
||||||
|
-r=obj/Release/apps/usr_le_code/usr_usb_jb.o,printf_buf,l
|
||||||
|
-r=obj/Release/apps/usr_le_code/usr_usb_jb.o,usr_goto_pair_mode,l
|
||||||
|
-r=obj/Release/apps/usr_le_code/usr_usb_jb.o,cdc_write_data,l
|
||||||
|
-r=obj/Release/apps/usr_le_code/usr_usb_jb.o,syscfg_write,l
|
||||||
|
-r=obj/Release/apps/usr_le_code/usr_usb_jb.o,puts,l
|
||||||
obj/Release/cpu/br28/adc_api.o
|
obj/Release/cpu/br28/adc_api.o
|
||||||
-r=obj/Release/cpu/br28/adc_api.o,adc_add_sample_ch,pl
|
-r=obj/Release/cpu/br28/adc_api.o,adc_add_sample_ch,pl
|
||||||
-r=obj/Release/cpu/br28/adc_api.o,printf,l
|
-r=obj/Release/cpu/br28/adc_api.o,printf,l
|
||||||
|
|||||||
+647
-645
File diff suppressed because it is too large
Load Diff
@@ -143,6 +143,7 @@ u8 *syscfg_ptr_read(u16 item_id, u16 *len);
|
|||||||
|
|
||||||
#define CFG_USER_PAIR_INFO 2
|
#define CFG_USER_PAIR_INFO 2
|
||||||
#define CFG_USER_TIM_FLAG 3
|
#define CFG_USER_TIM_FLAG 3
|
||||||
|
#define CFG_USER_PROD_INFO 28 /* ProdtCode + productCode */
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user