• Switch/Case in I2C interrupt
    Hi, I am using C8051F005 as I2C slave. In the I2C interrupt, there is switch/case statement to load SMB0DAT with data to be output based on the OP_CODE. There are 15 cases. The master will get wrong...
  • Switch Case Statement problem
    I am using switch statement as follows uint16 val; switch (val) { case 0x0000: ... break case 0x0001: ... break case 0x0000: ... break case 0x0000: ... break case 0x0000: ... break...
  • Switch and Case structure
    I am trying to do a simple function to return values based on the input...shown below. char func (unsigned char add) { signed char i; switch (add) { case 0: i = 0; break; case 1: i = 1; break;...
  • Trouble in "SWITCH" case
    Dear all iam having problem with SWITCH case switch(aaa) { case '1': LIGHT=1; printf("Light On\n"); break; case '2': LIGHT=0; printf("Light Off\n"); break; case '3': printf("Unknown...
  • Switch / Case Optimization
    I've read through this thread: http://www.keil.com/forum/8020/ and I understand that: 1. For "a few" case values, I'll get a series of if / else if's. Not sure how many that is. 2. If the case...