Browse Source

Tidy up #ifdeffery for i2c speed

master
Gavan Fantom 13 years ago
parent
commit
6a3c096bc5
  1. 7
      i2c.c

7
i2c.c

@ -25,17 +25,12 @@ void init_i2c(void)
{
IREG(I2CONSET) = 0x40; /* Enable I2C ready for Master Tx */
/* Set up for just under 400kHz */
#if 0
#ifdef I2C_FAST
IWREG(I2SCLL) = (25 * 100);
IWREG(I2SCLH) = (12 * 100);
#else
# if 0
IWREG(I2SCLL) = 1475; /* ~5kHz */
IWREG(I2SCLH) = 1475;
# else
IWREG(I2SCLL) = 73; /* ~100kHz */
IWREG(I2SCLH) = 73;
# endif
#endif
}

Loading…
Cancel
Save