This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

关于C6748的PSC模块问题咨询

Other Parts Discussed in Thread: TMS320C6748

你好:

PSC下面的代码。最后两句的含义是什么呢? 代码一直在最后一行停着,这个判断始终成立的啊 ,是不是你们的例程有问题呢??

void EVMOMAPL138_lpscTransition(psc_regs_t *psc, uint32_t in_domain, uint8_t in_module, uint8_t in_next_state)
{
   // spin until existing transitions are done.//判断是不是在转换状态,=1时表示在转换状态中
   while (CHKBIT(psc->PTSTAT, in_domain)) {}

   // if we are already in the requested state...just return.
  
 
   if (CHKBIT(psc->MDSTAT[in_module], MASK_STATE) == in_next_state)  //MASK_STATE=0x3F
   {
      return;
   }

   // setup the transition...clear the bits before setting the next state.
   CLRBIT(psc->MDCTL[in_module], NEXT);//NEXT=0x07 mask
   SETBIT(psc->MDCTL[in_module], in_next_state);

   // kick off the transition.
   SETBIT(psc->PTCMD, in_domain);

   // spin until transition is done.
  while (CHKBIT(psc->PTSTAT, in_domain)) {}

  while (CHKBIT(psc->MDSTAT[in_module], MASK_STATE)!= in_next_state) {} //MASK_STATE=0x3F
}