当前位置:网站首页>A method of MCU log output
A method of MCU log output
2022-07-27 20:57:00 【Passing bears~】
#include <stdio.h>
#include <stdint.h>
#define DEBUG_ENABLE //enable debug setting
#ifdef DEBUG_ENABLE
#define BSP_Printf printf
#else
#define BSP_Printf
#endif
void print_hex_as_string(char *pHead, uint8_t *pHEX, uint16_t len)
{
uint16_t i=0;
BSP_Printf("\r\n%s[%u]\r\n",pHead,len);
for(i=0;i<len;i++)
{
BSP_Printf("%.2X ",pHEX[i]);
if((i&0x000f) == 0x000f)
{
BSP_Printf("\r\n");
}
}
BSP_Printf("\r\n");
}
int main()
{
uint8_t data[] = {
0x01,0x02,0x03};
print_hex_as_string("Hex:", data, 3);
return 0;
}
边栏推荐
- 认识传输介质网络通信的介质
- Advanced SQL skills CTE and recursive query
- 认识网络模型网络模型概述
- Hexagon_V65_Programmers_Reference_Manual(7)
- 五大知名人士对于AI的忧虑
- Download of MySQL driver jar package -- nanny tutorial
- Hcip day 5
- [numpy] broadcast mechanism
- Introduction to rk3399 platform introduction to proficient series (Introduction) 21 day learning challenge
- The variable "lattice" or class "lattice.latticeeasy" (matlab) is not defined
猜你喜欢

Things about stack migration

基于ATX自动化测试解决方案

Why are TS slice files generated when easycvr platform turns off video recording?

Tencent jumped out with 38K and saw the real test ceiling

Flask Mdict builds online MDICT Dictionary Service

Hexagon_V65_Programmers_Reference_Manual(6)

Go --- automatic recompilation of air

Management of user organization structure

CPDA|如何拥有数据分析思维?

Innovative cases | the growth strategy of digitalization of local life services and upgrading of Gaode brand
随机推荐
js中数组与字符串常用方法属性总结
未定义变量 “Lattice“ 或类 “Lattice.latticeEasy“(Matlab)
adb shell ls /system/bin(索引表)
People call this software testing engineer. You're just making a living (with HR interview Dictionary)
Hexagon_V65_Programmers_Reference_Manual(9)
2022-07-19 网工进阶(二十)BGP-路由优选、路由优选逐条分析
openresty lua-resty-core 使用
洋葱集团携手OceanBase实现分布式升级,全球数据首次实现跨云融合
UE5使用DLSS(超级采样)提升场景的 FPS 远离卡顿的优化方案
Openresty Lua resty core use
[Numpy] 数组属性
Go --- automatic recompilation of air
一文了解Pycharm快捷键
SQL高级技巧CTE和递归查询
Hexagon_V65_Programmers_Reference_Manual(8)
When adding RTSP devices to easycvr platform, what is the reason for the phenomenon that they are all connected by TCP?
Innovative cases | the growth strategy of digitalization of local life services and upgrading of Gaode brand
To do the test, you have to go to the big factory and disclose the "hidden rules" of bat big factory recruitment internally
Kingbasees heterogeneous database migration guide (4. Application migration process)
[numpy] array properties