本帖最后由 volbin0042 于 2023-12-7 17:37 编辑
2维无法宣告常数型态 报告警
如何处理 (删const 可正常)
指针型态宣告 观念模糊
//P1
const uint8_t P1_num[3][13]={
{12,0x70,0x31,0x2E,0x70,0x69,0x63,0x3D,0x31,0x31,0xff,0xff,0xff}, //'**=1
{12,0x70,0x31,0x2E,0x70,0x69,0x63,0x3D,0x31,0x32,0xff,0xff,0xff}, //'up=12
{12,0x70,0x31,0x2E,0x70,0x69,0x63,0x3D,0x33,0x32,0xff,0xff,0xff} //'dn=32
};
void App_P1_num(uint8_t X1)
{
LPUART_Transmit(LPUART1, P1_num[X1], P1_num[X1][0], 0xFFFFFF);
}
en_result_t LPUART_Transmit(LPUART_TypeDef* LPUARTx, uint8_t *pu8Data, uint32_t u32Size, uint32_t u32Timeout)
{
pu8Data++;
while(u32Size)
{
while(!REG_READBITS(LPUARTx->ISR, LPUART_ISR_TXE)){;}
REG_WRITE(LPUARTx->DR, *pu8Data);
pu8Data++;
u32Size--;
}
while(!REG_READBITS(LPUARTx->ISR, LPUART_ISR_TC)){;}
REG_CLEARBITS(LPUARTx->ICR, LPUART_ICR_TC);
return Ok;
} |