added printf _ioput function
This commit is contained in:
parent
b9d03c7a7f
commit
e70abcd005
1 changed files with 14 additions and 0 deletions
14
Src/main.c
14
Src/main.c
|
@ -469,6 +469,20 @@ static void MX_GPIO_Init(void)
|
|||
|
||||
/* USER CODE BEGIN 4 */
|
||||
|
||||
int __io_putchar(int ch){
|
||||
uint8_t c[1];
|
||||
c[0] = ch & 0x00FF;
|
||||
HAL_UART_Transmit(&huart1, &*c, 1, 10);
|
||||
return ch;
|
||||
}
|
||||
|
||||
int _write(int file, char *ptr, int len){
|
||||
int DataIdx;
|
||||
for (DataIdx = 0; DataIdx < len; DataIdx++){
|
||||
__io_putchar(*ptr++);
|
||||
}
|
||||
return len;
|
||||
}
|
||||
/* USER CODE END 4 */
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue