当前位置:网站首页>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 go project directory structure
[docsify basic use]
Out of class implementation of member function of class template
Relevant database questions.
解决:div获取不到键盘事件
[transfer] analysis of memory structure, cache and DMA architecture
Google Earth engine (GEE) - Murray global tidal wetland change V1 (1999-2019) data set
Pit stepping record: Supervisor log return information: redis extension is not installed
Linux服务器安装Redis
leetcode:98. 验证二叉搜索树
随机推荐
Traverse map
我开户后把账号忘记了咋办?股票在网上开户安全吗?
Records of problems solved (continuously updated)
免实名域名是什么意思?
Connection Flood攻击原理
六,购物⻋与订单
Assembly language learning I (with stack co process, 32-bit registers and related instructions, to be continued 06/29)
MySQL Optimization: from more than ten seconds to 300 milliseconds
[most complete] install MySQL on a Linux server
Starting MySQL ERROR! Couldn‘t find MySQL server (/usr/local/mysql/bin/mysqld_safe)
memcpy内存重叠的解决
Finished product upgrade procedure
Steps for formulating class or file templates in idea
Go installation and configuration (1)
0 basic job transfer software test, how to achieve a monthly salary of 9.5k+
Four great happenings on earth
QT common macro definitions
Xshell传输文件
Resolved: initialize specified but the data directory has files in it Aborting
What if I forget my account number after opening an account? Is it safe to open an account online?