added prescaler for 16 bit pwm in LPC1347 target
Fork of mbed-dev by
Diff: targets/hal/TARGET_Maxim/TARGET_MAX32600/i2c_api.c
- Revision:
- 72:ad655cb9b50e
- Parent:
- 0:9b334a45a8ff
- Child:
- 144:ef7eb2e8f9f7
--- a/targets/hal/TARGET_Maxim/TARGET_MAX32600/i2c_api.c Thu Feb 25 09:45:11 2016 +0000 +++ b/targets/hal/TARGET_Maxim/TARGET_MAX32600/i2c_api.c Thu Feb 25 10:15:11 2016 +0000 @@ -227,6 +227,17 @@ obj->i2c->trans |= MXC_F_I2CM_TRANS_TX_START; + // Wait for the FIFO to be empty + while(!(obj->i2c->intfl & MXC_F_I2CM_INTFL_TX_FIFO_EMPTY)) {} + + if(obj->i2c->intfl & MXC_F_I2CM_INTFL_TX_NACKED) { + return 1; + } + + if(obj->i2c->intfl & (MXC_F_I2CM_INTFL_TX_TIMEOUT | MXC_F_I2CM_INTFL_TX_LOST_ARBITR)) { + return 2; + } + return 0; }