hi
I'm using stm32 by keil5 compiler and This is my printf function
in this code my printf only sends data in uart1. is there any function to send data by printf and choosing uart.
for example my printf become like this :
printf(&huart2,"HELLO WORLD"%d,variable)?
Thankyou.
I'm using stm32 by keil5 compiler and This is my printf function
C:
#ifdef __GNUC__
/* With GCC/RAISONANCE, small printf (option LD Linker->Libraries->Small printf
set to 'Yes') calls __io_putchar() */
#define PUTCHAR_PROTOTYPE int __io_putchar(int ch)
#define GETCHAR_PROTOTYPE int __io_getchar(void)
#else
#define PUTCHAR_PROTOTYPE int fputc(int ch, FILE *f)
#define GETCHAR_PROTOTYPE int fgetc(FILE *f)
#endif /* __GNUC__ */
PUTCHAR_PROTOTYPE
{
HAL_UART_Transmit(&huart1,(uint8_t*)&ch,1,100);
return ch;
}
in this code my printf only sends data in uart1. is there any function to send data by printf and choosing uart.
for example my printf become like this :
printf(&huart2,"HELLO WORLD"%d,variable)?
Thankyou.