Skip to content

Commit

Permalink
Bugfix in Bafang Protocol for SW102 Display
Browse files Browse the repository at this point in the history
  • Loading branch information
stancecoke committed Jun 29, 2024
1 parent 527c1c3 commit 8a23bf1
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions Src/display_bafang.c
Original file line number Diff line number Diff line change
Expand Up @@ -129,19 +129,16 @@ void Bafang_Service(BAFANG_t* BF_ctx, uint8_t rx)
switch (BF_Message[1]) // analyze and send correct answer
{
case BF_CMD_GETSPEED:

spd_tmp=BF_ctx->Rx.Wheeldiameter;

TxBuff[0]=(BF_ctx->Tx.Speed>>8);
TxBuff[1]=(BF_ctx->Tx.Speed&0xff);
TxBuff[2]=TxBuff[0]+TxBuff[1]+32;
HAL_UART_Transmit_DMA(&huart1, (uint8_t *)&TxBuff, 3);
break;

case BF_CMD_GETERROR:
TxBuff[0]=0;
TxBuff[0]=6;
TxBuff[1]=0;
HAL_UART_Transmit_DMA(&huart1, (uint8_t *)&TxBuff, 2);
HAL_UART_Transmit_DMA(&huart1, (uint8_t *)&TxBuff, 1);
break;

case BF_CMD_GETBAT:
Expand Down

0 comments on commit 8a23bf1

Please sign in to comment.