mongoose/examples/stm32/nucleo-f746zg-keil-rtx5-mdk/syscalls.c

19 lines
368 B
C
Raw Normal View History

2023-04-12 04:46:28 +08:00
#include <stdlib.h>
#include <string.h>
#include "main.h"
2023-07-29 01:42:29 +08:00
#ifdef UART_DEBUG // For internal testing purposes
#include "hal.h"
int stdout_putchar (int ch) {
uart_write_byte(USART1, (uint8_t) ch);
return ch;
}
#else
2023-04-12 04:46:28 +08:00
int stdout_putchar (int ch) {
extern UART_HandleTypeDef huart3;
HAL_UART_Transmit(&huart3, (const uint8_t *)&ch, 1, 100);
return ch;
}
2023-07-29 01:42:29 +08:00
#endif