阅读:1492回复:2
68013的suspend和resume状态一问
在固件框架程序中
涉及到这两个状态转换的代码有个地方不是很理解 求教一下大侠 if (Sleep) { if(TD_Suspend()) { Sleep = FALSE; // Clear the "go to sleep" flag. Do it here to prevent any race condition between wakeup and the next sleep. do { EZUSB_Susp(); // Place processor in idle mode. } while(!Rwuen && EZUSB_EXTWAKEUP()); // Must continue to go back into suspend if the host has disabled remote wakeup // *and* the wakeup was caused by the external wakeup pin. // 8051 activity will resume here due to USB bus or Wakeup# pin activity. EZUSB_Resume(); // If source is the Wakeup# pin, signal the host to Resume. TD_Resume(); } } 其中的do-while循环我没有看明白,这个循环条件的意思是说:disable远程唤醒功能并且有wakeup信号时,继续维持8051在suspend状态。 为什么产生了wakeup信号,还要维持在suspend状态呢? |
|
沙发#
发布于:2007-04-12 21:19
while(!Rwuen && EZUSB_EXTWAKEUP());
表示当远程呼叫没有被唤醒 并且 启用了外部唤醒则可以保持在suspend状态,假设一下,如果外部唤醒了,那么自然脱离了suspend,如果没有启用外部唤醒,那么就是说永远也不可能有外部唤醒,所以肯定不能再suspend了 |
|
板凳#
发布于:2004-07-26 11:31
不能再沉下去了
自己顶一下 希望大侠给个答案啊 |
|