更改内容:优化和玄恒耳机芯片双向通讯功能,通讯波特率为:9600bps,CRC16校验和为:CRC-16-CCITT-FALSE

This commit is contained in:
Alex xu 2025-01-09 18:55:50 +08:00
parent 8ddc4621b7
commit 4e6058168f
7 changed files with 17 additions and 9 deletions

View File

@ -3668,7 +3668,7 @@
<PaneID>0</PaneID>
</Doc>
<Doc>
<Name>E:\todaywork\20241202_tp3410\SY8837_Demo\UsrInc\inc\config.h</Name>
<Name>\todaywork\20241202_tp3410\SY8837_Demo\UsrInc\inc\config.h</Name>
<ColumnNumber>16</ColumnNumber>
<TopLine>183</TopLine>
<CurrentLine>205</CurrentLine>
@ -3677,7 +3677,7 @@
<PaneID>0</PaneID>
</Doc>
<Doc>
<Name>E:\todaywork\20241202_tp3410\SY8837_Demo\UsrInc\charger\charger_module.h</Name>
<Name>..\UsrInc\charger\charger_module.h</Name>
<ColumnNumber>7</ColumnNumber>
<TopLine>46</TopLine>
<CurrentLine>75</CurrentLine>
@ -3686,7 +3686,7 @@
<PaneID>0</PaneID>
</Doc>
<Doc>
<Name>E:\todaywork\20241202_tp3410\SY8837_Demo\UsrInc\vox\vox_module.h</Name>
<Name>..\UsrInc\vox\vox_module.h</Name>
<ColumnNumber>18</ColumnNumber>
<TopLine>459</TopLine>
<CurrentLine>490</CurrentLine>

View File

@ -28,10 +28,18 @@
/******************************************************************************\
Macro definitions
\******************************************************************************/
#define Baud_Rate0 115200//9600//19200//38400//93750
/* Log Debug 接口。 */
#define Baud_Rate0 115200//19200//38400//93750
#define S0REL_VALUE (1024-345600/Baud_Rate0)
#define Baud_Rate1 9600//19200//38400//93750
/* 双向通讯接口。 */
#if XUANHENG
#define Baud_Rate1 9600//9600//19200//38400//93750
#else
#define Baud_Rate1 9600//9600//19200//38400//93750
#endif
#define S1REL_VALUE (1024-345600/Baud_Rate1)
#define UART_REC_ENABLE_Pos (4U)

View File

@ -1516,7 +1516,7 @@ void Vox_Follow_Chg( g_Vox_Fllow_Chg_Cfg *n_Vox_Fllow_Chg )
*******************************************************************************
* u16 CalCheckCrc16(u8 * pucFrame, u16 usLen)
*
* Description :
* Description : (CRC-16-CCITT-FALSE)
*
*
* Arguments : u8 *pucFrame:
@ -1531,7 +1531,7 @@ void Vox_Follow_Chg( g_Vox_Fllow_Chg_Cfg *n_Vox_Fllow_Chg )
uint16_t CalCheckCrc16(uint8_t *pucFrame, unsigned int usLen)
{
uint16_t wCRCin = 0x0000;
uint16_t wCRCin = 0xFFFF;
uint16_t wCPoly = 0x1021;
uint8_t wChar = 0;
unsigned int i;
@ -1908,10 +1908,10 @@ void HandleTxCommand(VOX_BES_COMMAND_E TxCommand, e_Vox_Chan nVox_Chn_Select)
4D41Byte0x00
*/
tx_pData[7] = HW_VER << 4;
tx_pData[7] = FW_VER >> 8;
tx_pData[7] |= FW_VER >> 8;
tx_pData[8] = FW_VER;
tx_pData[9] = ( ( ChgStatus & CHG_STA_ING ) << 6 ) | bat_level;
tx_pData[9] = ( ( ChgStatus & CHG_STA_ING ) << 6 ) | ( 5 * bat_level );
if(nVox_Chn_Select == VOL_CHAN)
{