1. The structure prototype and initialization:
Typedef struct
{
Uint8_t enableCRC;//CRC check can make
Buff UartBuff *;//serial port receive buffer data
Void * (Send) (uint8_t *, uint16_t);//send a serial port function
} UartPort;
UartPort uart2={false, & amp; Uart2Buff Uart2SendStr};
2. Uart2SendStr prototype:
Void Uart2SendStr (uint8_t * PSTR, uint16_t strlen)
{
uint16_t i;
for(i=0; i
}
3. The function call:
Void the debug (UartPort * uart)
{
.
Uart - & gt; Send (" 123 ", 3);
.
}
Test before the function call, the other two members address is normal, after the call address 0 x3300, 0 x0031,
CodePudding user response:
Point or test possible problems, also hope to provide theCodePudding user response:
Post the complete codeCodePudding user response:
To clarify, what is the other two, what is normal,Tell variable names respectively, original value, become what,
Additional initialization used when uart2Buff is a what thing, where is defined,
CodePudding user response:
Puzzling change this kind of matter, suspected return auto local variable address,CodePudding user response:
Pointer is too much, don't say please call chain, which is the wild pointer carelessly,