2016-02-11 09:02 PM
Guys,
I want to transmit ''res'' into UART buffer :FRESULT f_open (FIL* fp, /* Pointer to the blank file object */
const TCHAR* path, /* Pointer to the file name */
BYTE mode /* Access mode and file open mode flags */
)
{
FRESULT res;
I want to print ''res'' to UART buffervoid Transmit_String_ff(unsigned char *s)
{
HAL_UART_Transmit(&huart1, s, strlen(s), 1000); // As a pointer, with a length
} I can't do Transmit_String_ff(res) I got this error,error: #167: argument of type ''FRESULT'' is incompatible with parameter of type ''unsigned char *'' How can I fix it ? thanks
2016-02-11 10:08 PM
The FatFS source file
ff.h
says:typedef enum {
.... } FRESULT; Thus, just cast it; enum is usually (but not necessarily)int
:sprintf (buf, ''%d'',
(int)
fres); That is more or less basic C stuff.