void UpdateDisplay_long(uint16_t addr1,int32_t number1)
{
uint8_t TempBuff[]={0xA5,0x5A,0x07,0x82,0x01,0x10,0x00,0x00,0x00,0x00};
TempBuff[0x04]=addr1>>8;
TempBuff[0x05]=addr1;
TempBuff[0x06]=number1>>24;
TempBuff[0x07]=number1>>16;
TempBuff[0x08]=number1>>8;
TempBuff[0x09]=number1;
// 串口发送 这样可以 但是这样发送CPU在这里耗费很多时间
//HAL_UART_Transmit(&huart3,TempBuff,sizeof(TempBuff),0XFFFF);
// DMA发送 不成功,想着节约CPU时间
HAL_UART_Transmit_DMA(&huart3, (uint8_t *)TempBuff, sizeof(TempBuff));//使用DMA发送数据
}
|