Created
December 17, 2017 00:59
-
-
Save boochow/c83391594664398efe4b36b37f6ffe8b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Private function prototypes -----------------------------------------------*/ | |
#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) | |
#else | |
#define PUTCHAR_PROTOTYPE int fputc(int ch, FILE *f) | |
#endif /* __GNUC__ */ | |
/** | |
* @brief Retargets the C library printf function to the USART. | |
* @param None | |
* @retval None | |
*/ | |
PUTCHAR_PROTOTYPE | |
{ | |
/* Place your implementation of fputc here */ | |
/* e.g. write a character to the USART3 and Loop until the end of transmission */ | |
HAL_UART_Transmit(&huart3, (uint8_t *)&ch, 1, 0xFFFF); | |
return ch; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment