当前位置:网站首页>mcu日志输出的一种方法
mcu日志输出的一种方法
2022-07-27 18:25:00 【路过的小熊~】
#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;
}
边栏推荐
- 【分层强化学习】HAC论文及代码
- Hexagon_V65_Programmers_Reference_Manual(8)
- 国际权威认可!OceanBase入选Forrester Translytical数据平台报告
- How to improve the picture transmission speed and success rate in the development of IM instant messaging under the mobile network
- 品牌列表案例
- Flask Mdict builds online MDICT Dictionary Service
- 程序中的地址如何转换?
- 学术分享 | 清华大学 康重庆:电力系统碳计量技术与应用(Matlab代码实现)
- JVs privatization deployment start failure handling scheme
- 用户和权限限制用户使用资源
猜你喜欢

IOU 目标跟踪其二:VIOU Tracker

Jetpack compose performance optimization guide - compilation metrics

从0开始写bootloader

Xdc 2022 Intel technology special session: Intel Software and hardware technology builds the cornerstone of cloud computing architecture

MySQL驱动jar包的下载--保姆教程

JVS基础介绍

One week activity express | in simple terms, issue 8; Meetup Chengdu station registration in progress

JVS公众号登陆配置

说透缓存一致性与内存屏障

Management of user organization structure
随机推荐
好开不贵,舒适安全!深度体验比亚迪宋Pro DM-i
People call this software testing engineer. You're just making a living (with HR interview Dictionary)
R语言使用dplyr包左连接两个dataframe数据(left join)
Software test interview question: count the number in a queue, how many positive numbers and how many negative numbers, such as [1, 3, 5, 7, 0, -1, -9, -4, -5, 8]
[Numpy] 数组索引和切片
征服所有程序员的3件IT装备 →
人家这才叫软件测试工程师,你那只是混口饭吃(附HR面试宝典)
从0开始写bootloader
认识网络模型TCPIP模型
Best practices for Oracle kingbasees migration of Jincang database (4. Oracle database migration practice)
一周活动速递|深入浅出第8期;Meetup成都站报名进行中
How does the industrial switch enter the web management interface?
【数据集显示标注】VOC文件结构+数据集标注可视化+代码实现
金仓数据库 KingbaseES异构数据库移植指南 (3. KingbaseES移植能力支撑体系)
How to calculate the execution time in the function resource usage when using the timer trigger type to process database data?
[dataset display annotation] VOC file structure + dataset annotation visualization + code implementation
用户登录切换案例
说透缓存一致性与内存屏障
Programmer growth Chapter 18: project launch
14天鸿蒙设备开发实战-第七章 设备联网上云 学习笔记