AnsweredAssumed Answered

Switch/Case compiler error?

Question asked by Laz on Aug 20, 2009
Latest reply on Jun 11, 2010 by Laz

I am using VSDP 5.0 and ADSP 21368.  In the following code snippet the if/elseif method works, and rthe switch/case method creates a jump(0x0).

 

Any clues?

 

void setPin (PSD_PIN_NAME pin)
{
#if 0
// DEBUG!
if (pin == TEMP_CONV)
  sysreg_bit_set(sysreg_FLAGS, FLG5);
else if (pin == TEMP_FRAME)
   sysreg_bit_set(sysreg_FLAGS, FLG6);
else if (pin == POINTER_EN)
   sysreg_bit_set(sysreg_FLAGS, FLG7);
else if (pin == LEVEL_CS)
   sysreg_bit_set(sysreg_FLAGS, FLG8);
 
return;
#endif

switch (pin)
{
  case TEMP_CONV:
    sysreg_bit_set(sysreg_FLAGS, FLG5);
    break;

  case TEMP_FRAME:
    sysreg_bit_set(sysreg_FLAGS, FLG6);
    break;

  case POINTER_EN:
    sysreg_bit_set(sysreg_FLAGS, FLG7);
    break;

  case LEVEL_CS:
    sysreg_bit_set(sysreg_FLAGS, FLG8);
    break;

  default:
   break;
} // end switch
}

Outcomes