HAL [LPC824] Fix multi channel I2C issue

- Update resource count value which did not count up during multiple
channel I2C resources are used
pull/598/head
Toyomasa Watarai 2014-10-24 17:47:00 +09:00
parent 3dfb033226
commit c48829330c
1 changed files with 1 additions and 0 deletions

View File

@ -121,6 +121,7 @@ void i2c_init(i2c_t *obj, PinName sda, PinName scl)
i2c_ch = get_available_i2c();
if (i2c_ch == -1)
return;
i2c_used |= (1 << (i2c_ch - 1));
swm = &SWM_I2C_SDA[i2c_ch - 1];
regVal = LPC_SWM->PINASSIGN[swm->n] & ~(0xFF << swm->offset);