dbuntin wrote on Sunday, August 30, 2015:
I’ve extended the serial.c and serial.h files from the demo application to facilitate writing strings and debug information to the serial console in my application. I’m using snprintf() and similar library functions defined in stdio.h. These functions use parameters of type " char * ". When passing strings created by these functions to xSerialPutChar() and xSerialPutString() a must cast to a " signed char * " to avoid compiler warnings. Before I make any changes, I’d like to fully understand the types used and the reasons behind them.
Why does xSerialPutChar() use a signed char in it’s prototype?
signed portBASE_TYPE xSerialPutChar( xComPortHandle pxPort, signed char cOutChar, TickType_t xBlockTime );
I’m also not sure I understand the full meaning of the parameter type “const signed char * const pcString” used in xSerialPutString. Could someone help me interpret this type and the use of const twice?
void vSerialPutString( xComPortHandle pxPort, **const signed char * const **pcString, unsigned short usStringLength );
Background: I’ve created my application based on the AVR_ATMege323_WinAVR demo applicaiton. I’m using AVR Studio and it’s native GCC complier.
Thanks,
David