⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 util.h

📁 unix/linux下串口调试工具
💻 H
字号:
/******************************************************************************  SCT, Serial Communication Tracer  **  CopyRight (C)  Bruce (ZhaoFei), zhaofei@zflogic.com*                         http://www.zflogic.com**  All sources in the package are copyrighted under the the terms of GNU GPL******************************************************************************                                                                         *  This program is free software; you can redistribute it and/or modify*  it under the terms of the GNU General Public License as published by*  the Free Software Foundation; either version 2 of the License, or*  (at your option) any later version.**  This program is distributed in the hope that it will be useful,*  but WITHOUT ANY WARRANTY; without even the implied warranty of*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the*  GNU General Public License for more details.**  You should have received a copy of the GNU General Public License*  along with this program; if not, write to the Free Software*  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA**  If you intend to use this pragram commercially on a regular basis you*  must contact the author for an appropriate donation.*                                                                       ***************************************************************************/#ifndef UTIL_H#define UTIL_H#ifndef UTIL_L#define UTIL_L  extern#endif#ifndef uchar #define uchar unsigned char#endif#ifndef uint #define uint unsigned char#endif#ifndef ulong #define ulong unsigned char#endif#ifndef bool#define bool uint#endif#ifndef true#define true 1#endif#ifndef false#define false 0#endif//basic macro#ifndef max#define max(a,b)            (((a) > (b)) ? (a) : (b))#endif#ifndef min#define min(a,b)            (((a) < (b)) ? (a) : (b))#endifUTIL_L void hex2str(char *str, uchar *hex,int len);UTIL_L uchar asc2hex(char asccode);UTIL_L void ascs2hex(uchar *hex,uchar *ascs,int srclen);UTIL_L void str2hex(uchar *hex, int *len, char *str);UTIL_L void noz_str(char *str);	//replace teminate null with ' ' of stringUTIL_L void disp_hexasc(uchar *data, int size);#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -