当前位置:网站首页>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;
}
边栏推荐
- Qtcreator debug code after configuring CDB debugger view variable value display card
- Xshell transfer file
- JS create PDF file
- [daily question] 535 Encryption and decryption of tinyurl
- 0 basic job transfer software test, how to achieve a monthly salary of 9.5k+
- 踩坑记录:supervisor 日志返回信息:redis扩展未安装
- oracle数据库报列表中最大表达式为1000错误
- [my advanced OpenGL learning journey] about the access methods of vector and matrix classification of OpenGL shaders: xyzw/rgba/stpq and array subscripts
- Introduction to go project directory structure
- JS null judgment operators | and? Usage of
猜你喜欢

The maximum expression in Oracle database message list is 1000 error

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

How to use string branches for switch case
![[datawhale team learning] task02: mathematical operation, string and text, list](/img/3e/c9c984d7576a2e410da7f81a8c0aa6.jpg)
[datawhale team learning] task02: mathematical operation, string and text, list

The first up Master of station B paid to watch the video still came! Price "Persuading" netizens

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

第一行代码(第三版)学习笔记

Relevant database questions.

Xshell transfer file

Class templates and friends
随机推荐
memcpy内存重叠的解决
【Hot100】15. 三数之和
How to use string branches for switch case
Linu基础-分区规划与使用
Class template case - encapsulation of array classes
If I am in Zhuhai, where can I open an account? In addition, is it safe to open a mobile account?
What does the real name free domain name mean?
What if I don't know what to do after graduating from university?
Starting MySQL ERROR! Couldn‘t find MySQL server (/usr/local/mysql/bin/mysqld_safe)
Xshell transfer file
Write about your feelings about love and express your emotions
The first up Master of station B paid to watch the video still came! Price "Persuading" netizens
Egret P2 physical engine (1) small ball falling demo
已解决:initialize specified but the data directory has files in it. Aborting
元宇宙由哪些底层技术支撑?
Vs2019 and SQL
Utilisation de la commande grep
JS null judgment operators | and? Usage of
Four great happenings on earth
【SemiDrive源码分析】【X9芯片启动流程】33 - Display模块 相关概念解析