Subversion Repositories NaviCtrl

Rev

Rev 482 | Rev 791 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 482 Rev 508
Line 607... Line 607...
607
                                }
607
                                }
608
                                break;
608
                                break;
Line 609... Line 609...
609
 
609
 
610
                        default:// unknown event
610
                        default:// unknown event
-
 
611
                                // should never happen
611
                                // should never happen
612
                                DebugOut.Analog[14]++;
612
                                I2C_GenerateSTOP (I2C1, ENABLE);
613
                                I2C_GenerateSTOP (I2C1, ENABLE);
613
                                VIC_ITCmd(I2C1_ITLine, DISABLE);
614
                                VIC_ITCmd(I2C1_ITLine, DISABLE);
614
                                I2C1_Bus.State = I2C_STATE_IDLE;
615
                                I2C1_Bus.State = I2C_STATE_IDLE;
615
                                I2C1_Bus.Error = I2C_ERROR_UNKNOWN;
616
                                I2C1_Bus.Error = I2C_ERROR_UNKNOWN;
Line 631... Line 632...
631
        if(I2Cx == I2C0) pBus = &I2C0_Bus;
632
        if(I2Cx == I2C0) pBus = &I2C0_Bus;
632
        if(I2Cx == I2C1) pBus = &I2C1_Bus;
633
        if(I2Cx == I2C1) pBus = &I2C1_Bus;
633
        if(pBus == NULL) return(0);
634
        if(pBus == NULL) return(0);
634
        while(pBus->State != I2C_STATE_IDLE)
635
        while(pBus->State != I2C_STATE_IDLE)
635
        {
636
        {
636
                if(CheckDelay(time)) return(0);
637
                if(CheckDelay(time))  // Timeout
-
 
638
                 {
-
 
639
                  return(0);
-
 
640
                 }
637
        }
641
        }
638
        return(1);
642
        return(1);
639
}
643
}
Line 640... Line 644...
640
 
644