当前位置:网站首页>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;
}
边栏推荐
- [introduction to Expo application] v Expert recommendation letter template
- Introduction to go language pointer
- Assembly language learning I (with stack co process, 32-bit registers and related instructions, to be continued 06/29)
- Record common problems: spaces in encodeuricomponent decoding and the use of Schema in third-party apps to invoke apps
- 免实名域名是什么意思?
- 经纬恒润再次荣获PACCAR集团 10PPM 质量奖
- Qtcreator debug code after configuring CDB debugger view variable value display card
- Nested if statement in sum function in SQL Server2005
- Jingwei Hengrun won the 10ppm quality award of paccar group again
- Egret engine P2 physics engine (2) - Funny physical phenomenon of small balls hitting the ground
猜你喜欢

经纬恒润再次荣获PACCAR集团 10PPM 质量奖

How to determine the size of the platform byte order?

Connection flood attack principle

leetcode:98. 验证二叉搜索树

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

app闪退

B站首个UP主付费观看视频还是来了!价格“劝退”网友
![[hot100] palindrome substring and longest palindrome substring](/img/a5/10dec640f02023c4d55cb42e6309fb.png)
[hot100] palindrome substring and longest palindrome substring

Starting MySQL ERROR! Couldn‘t find MySQL server (/usr/local/mysql/bin/mysqld_safe)

Go常用命令
随机推荐
神经网络计算量及参数量
Starting MySQL ERROR! Couldn‘t find MySQL server (/usr/local/mysql/bin/mysqld_safe)
Linux server installation redis
Essence of signal slot macros signal and slot
Qtcreator debug code after configuring CDB debugger view variable value display card
Go common commands
Egret P2 pit encountered by physical engine (1)
Running lantern effect JS text rotation effect realization
Qstring to const char*
B站首个UP主付费观看视频还是来了!价格“劝退”网友
Resolution: div failed to get keyboard event
15 minutes learn to use JWT
Daemon and user threads
[most complete] install MySQL on a Linux server
leetcode:98. 验证二叉搜索树
grep命令用法
[Hot100]10. Regular Expression Matching
Finished product upgrade procedure
【SemiDrive源码分析】【X9芯片启动流程】33 - Display模块 相关概念解析
Cluster distributed