diff --git a/extensions/ex_list/list.h b/extensions/ex_list/list.h index 2585e5d..05c4886 100644 --- a/extensions/ex_list/list.h +++ b/extensions/ex_list/list.h @@ -6,15 +6,15 @@ #define LIST_POISON1 NULL #define LIST_POISON2 NULL -//计算member在type中的位置 +//璁$畻member鍦╰ype涓殑浣嶇疆 #define offsetof(type, member) (size_t)(&((type*)0)->member) -//根据member的地址获取type的起始地址 +//鏍规嵁member鐨勫湴鍧鑾峰彇type鐨勮捣濮嬪湴鍧 #define container_of(ptr, type, member) ({ \ const typeof(((type *)0)->member)*__mptr = (ptr); \ (type *)((char *)__mptr - offsetof(type, member)); }) -//链表结构 +//閾捐〃缁撴瀯 struct list_head { struct list_head *prev; @@ -53,7 +53,7 @@ extern void __list_add(struct list_head *new, struct list_head *next); #endif -//从头部添加 +//浠庡ご閮ㄦ坊鍔 /** * list_add - add a new entry * @new: new entry to be added @@ -71,7 +71,7 @@ static inline void list_add(struct list_head *new, struct list_head *head) extern void list_add(struct list_head *new, struct list_head *head); #endif -//从尾部添加 +//浠庡熬閮ㄦ坊鍔 static inline void list_add_tail(struct list_head *new, struct list_head *head) { __list_add(new, head->prev, head); diff --git a/inc/xcmd_define.h b/inc/xcmd_define.h index 807713b..2de84e4 100644 --- a/inc/xcmd_define.h +++ b/inc/xcmd_define.h @@ -1,7 +1,7 @@ /* * @Author: your name * @Date: 2021-09-20 19:59:05 - * @LastEditTime: 2021-09-20 20:07:50 + * @LastEditTime: 2022-02-17 22:41:13 * @LastEditors: Please set LastEditors * @Description: In User Settings Edit * @FilePath: /xcmd/inc/xcmd_define.h @@ -94,7 +94,7 @@ extern "C" { #define DCH(n) "\x1B[%dP",n /* 鍒犻櫎瀛楃 鍒犻櫎褰撳墠鍏夋爣浣嶇疆鐨 涓瓧绗︼紝杩欎細浠庡睆骞曞彸杈圭紭浠ョ┖鏍煎瓧绗︾Щ鍔ㄣ*/ #define ECH(n) "\x1B[%dX",n /* 鎿﹂櫎瀛楃 鎿﹂櫎褰撳墠鍏夋爣浣嶇疆鐨 涓瓧绗︼紝鏂规硶鏄娇鐢ㄧ┖鏍煎瓧绗﹁鐩栧畠浠*/ #define IL(n) "\x1B[%dL",n /* 鎻掑叆琛 灏 琛屾彃鍏ュ厜鏍囦綅缃殑缂撳啿鍖恒 鍏夋爣鎵鍦ㄧ殑琛屽強鍏朵笅鏂圭殑琛屽皢鍚戜笅绉诲姩銆*/ -#define DL(n) "\x1B[%dM\r",n /* 鍒犻櫎琛 浠庣紦鍐插尯涓垹闄 琛岋紝浠庡厜鏍囨墍鍦ㄧ殑琛屽紑濮嬨*/ +#define DL(n) "\x1B[%dM",n /* 鍒犻櫎琛 浠庣紦鍐插尯涓垹闄 琛岋紝浠庡厜鏍囨墍鍦ㄧ殑琛屽紑濮嬨*/ /* 鎵撳嵃瀛椾綋棰滆壊璁剧疆 */ #define TX_DEF "\x1b[0m" diff --git a/src/xcmd.c b/src/xcmd.c index 5eeb181..21a6c59 100755 --- a/src/xcmd.c +++ b/src/xcmd.c @@ -296,7 +296,7 @@ static void xcmd_parser(uint8_t byte) if(num > 0) { - if( !(g_xcmder.parser.recv_hook_func && g_xcmder.parser.recv_hook_func(g_xcmder.parser.encode_buf)) ) + if( !(g_xcmder.parser.recv_hook_func && !g_xcmder.parser.recv_hook_func(g_xcmder.parser.encode_buf)) ) { if(CMD_IS_PRINT(g_xcmder.parser.encode_buf[0])) {