debug uart
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
#include "app_config.h"
|
||||
|
||||
#define BSP_PRINTF_BUFF_SIZE 256
|
||||
#define BSP_PRINTF_HANDLE UART(1)
|
||||
#define BSP_PRINTF_HANDLE UART(2)
|
||||
|
||||
#define BSP_UART_BUFF_SIZE 64
|
||||
|
||||
|
||||
@@ -681,7 +681,7 @@ void APP_Init (void)
|
||||
TIMER_RUN_FOREVER);
|
||||
drv_timer_start(&timerWait);
|
||||
|
||||
DT_Init(&fdUart, BSP_UART2, gRecv.bufRx, &gRecv.lenRx, YM_MSG_SIZE_MAX + 16);
|
||||
DT_Init(&fdUart, BSP_UART1, gRecv.bufRx, &gRecv.lenRx, YM_MSG_SIZE_MAX + 16);
|
||||
|
||||
ymodem_init(sendDataHandler, boot_ProtocolDataHandle, boot_SetReplyInfo);
|
||||
|
||||
|
||||
@@ -13,8 +13,8 @@ extern "C" {
|
||||
#define KEY0_Pin GPIO_PIN_8
|
||||
#define KEY0_GPIO_Port GPIOC
|
||||
|
||||
#define LED0_Pin GPIO_PIN_8
|
||||
#define LED0_GPIO_Port GPIOA
|
||||
#define LED0_Pin GPIO_PIN_13
|
||||
#define LED0_GPIO_Port GPIOC
|
||||
#elif defined(STM32F411xE)||defined(STM32F401xC)
|
||||
#define KEY0_Pin GPIO_PIN_0
|
||||
#define KEY0_GPIO_Port GPIOA
|
||||
|
||||
+2
-2
@@ -188,14 +188,14 @@ int main (void)
|
||||
|
||||
int fputc(int ch, FILE *f)
|
||||
{
|
||||
HAL_UART_Transmit(&huart1, (uint8_t *)&ch, 1, 0xffff);
|
||||
HAL_UART_Transmit(&huart2, (uint8_t *)&ch, 1, 0xffff);
|
||||
return ch;
|
||||
}
|
||||
|
||||
int fgetc(FILE * f)
|
||||
{
|
||||
uint8_t ch = 0;
|
||||
HAL_UART_Receive(&huart1,&ch, 1, 0xffff);
|
||||
HAL_UART_Receive(&huart2,&ch, 1, 0xffff);
|
||||
return ch;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user