// //****************************************************************************** //* Function to write Satus to screen //****************************************************************************** //============================================================================== int fputc(int ch, FILE *f) // Retarget printf() to USART1 { if (UART_channel == 1) { // Use UART 1 for stdio HAL_Status = HAL_UART_Transmit(&huart1, (uint8_t*) &ch, 1, 200); } else // Use UART 1 for stdio default HAL_Status = HAL_UART_Transmit(&huart1, (uint8_t*) &ch, 1, 200); return ch; } int fgetc(FILE *f) // Retarget scanf() to USART1 { uint8_t TempByte; HAL_Status = HAL_UART_Receive(&huart1, (uint8_t*) &TempByte, 1, 200); return TempByte; } // //------------------------------------------------------------------------------