当前位置:网站首页>Keil serial port redirection
Keil serial port redirection
2022-06-30 07:11:00 【Delta-delta】
Macro definition method
#include "stdio.h"
/* ------------------ Redirect printf Function mapping to serial port 1 On -------------------*/
#if !defined(__MICROLIB)
//#pragma import(__use_no_semihosting)
__asm (".global __use_no_semihosting\n\t");
void _sys_exit(int x) // Avoid using half host mode
{
x = x;
}
//__use_no_semihosting was requested, but _ttywrch was
void _ttywrch(int ch)
{
ch = ch;
}
struct __FILE
{
int handle;
};
FILE __stdout;
#endif
#if defined ( __GNUC__ ) && !defined (__clang__)
#define PUTCHAR_PROTOTYPE int __io_putchar(int ch)
#else
#define PUTCHAR_PROTOTYPE int fputc(int ch, FILE *f)
#endif
PUTCHAR_PROTOTYPE
{
/* Realize the function of sending a byte of data through the serial port */
//serial_write(&serial1, (uint8_t)ch); // Send your own data to the serial port
HAL_UART_Transmit(&huart1, (uint8_t *)&ch, 1, 0xFFFF);
return ch;
}
边栏推荐
- freemarker
- Determine whether the picture is in JPG picture format
- If I am in Zhuhai, where can I open an account? In addition, is it safe to open a mobile account?
- Calculation and parameter quantity of neural network
- 踩坑记录:supervisor 日志返回信息:redis扩展未安装
- Qstring to const char*
- 【Hot100】15. Sum of three numbers
- 0 basic job transfer software test, how to achieve a monthly salary of 9.5k+
- 已解决:initialize specified but the data directory has files in it. Aborting
- Class template case - encapsulation of array classes
猜你喜欢

Jingwei Hengrun won the 10ppm quality award of paccar group again

The maximum expression in Oracle database message list is 1000 error

How to set the hot deployment of idea web project

Relevant database questions.

MySQL优化:从十几秒优化到三百毫秒

vs2019和sql

Introduction to go project directory structure

I graduated this year, but I don't know what I want to do

Record one time of Tencent Test Development Engineer's automation interface test practice experience

Xshell transfer file
随机推荐
Calculation and parameter quantity of neural network
ROS program compilation, like no compilation, refers to the execution of the old compiled executable program
Go项目目录结构介绍
Win10 step pit - power on 0xc0000225
28 rounds of interviews with 10 companies in two and a half years
【SemiDrive源码分析】【X9芯片启动流程】34 - RTOS侧 Display模块 sdm_display_init 显示初始化源码分析
解决:div获取不到键盘事件
Go common commands
Win10踩坑-开机0xc0000225
QT common macro definitions
[introduction to Expo application] v Expert recommendation letter template
2021-07-02
六,购物⻋与订单
Which securities company is good for opening a mobile account? Also, is it safe to open an account online?
Develop common dependency Libraries
Determine whether the picture is in JPG picture format
How to determine the size of the platform byte order?
QT generate random number qrandomgenerator
Class templates and friends
汇编语言学习一(有栈协程铺垫,32位寄存器和相关指令学习,未完待续06/29)