Quantcast
Channel: C2000™︎ 微控制器论坛 - 最近的话题
Viewing all articles
Browse latest Browse all 12277

怀疑例程有bug

$
0
0
#define HALL3_READ_MACRO(v)																					\
	v.CmtnTrigHall = 0;		/* Reset trigger, it only handshakes with calling program.*/					\
	if (v.EdgeDebounced==0)	/* Debounce current position. */												\
	{  																										\
		HALL3_DEBOUNCE_MACRO(v)																				\
		v.CmtnTrigHall = v.EdgeDebounced;      /* Set Commutation trigger here*/							\
	}																										\
	else							/* If current position is debounced, find match in table */				\
		HALL3_NEXT_STATE_MACRO(v)	/* and return pointer to current state.  Ptr to be incremented*/		\
								    /* by MOD6CNT after RET.*/												\
																											\
	v.EdgeDebounced = 0;            /* Reset trigger*/ 

在看F2803XHALL3_GPIO.H文件里面一个宏定义的函数,这个函数根本就永远不会执行HALL3_NEXT_STATE_MACRO(v)。因为每次跳出HALL3_READ_MACRO(v)函数时都会执行v.EdgeDebounced = 0; 那么就是说每次进入HALL3_READ_MACRO(v))函数,v.EdgeDebounced都为0,那就永远不会执行HALL3_NEXT_STATE_MACRO(v)了,麻烦大神解释一下这是不是BUG。


Viewing all articles
Browse latest Browse all 12277

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>