git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@5538 35acf78f-673a-0410-8e92-d51de3d6d3f4
This commit is contained in:
parent
96d50f2ac1
commit
d1e24e796e
|
@ -179,20 +179,23 @@ static void i2c_lld_serve_interrupt(I2CDriver *i2cp, uint32_t isr) {
|
||||||
dp->CR2 |= I2C_CR2_STOP;
|
dp->CR2 |= I2C_CR2_STOP;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (isr & I2C_ISR_STOPF) {
|
if (isr & I2C_ISR_NACKF) {
|
||||||
/* Stops the associated DMA streams.*/
|
/* Starts a STOP sequence immediately.*/
|
||||||
dmaStreamDisable(i2cp->dmatx);
|
dp->CR2 |= I2C_CR2_STOP;
|
||||||
dmaStreamDisable(i2cp->dmarx);
|
|
||||||
|
|
||||||
wakeup_isr(i2cp, RDY_OK);
|
|
||||||
}
|
|
||||||
else if (isr & I2C_ISR_NACKF) {
|
|
||||||
/* Stops the associated DMA streams.*/
|
|
||||||
dmaStreamDisable(i2cp->dmatx);
|
|
||||||
dmaStreamDisable(i2cp->dmarx);
|
|
||||||
|
|
||||||
i2cp->errors |= I2CD_ACK_FAILURE;
|
i2cp->errors |= I2CD_ACK_FAILURE;
|
||||||
wakeup_isr(i2cp, RDY_RESET);
|
}
|
||||||
|
if (isr & I2C_ISR_STOPF) {
|
||||||
|
/* Stops the associated DMA streams.*/
|
||||||
|
dmaStreamDisable(i2cp->dmatx);
|
||||||
|
dmaStreamDisable(i2cp->dmarx);
|
||||||
|
|
||||||
|
if (i2cp->errors) {
|
||||||
|
wakeup_isr(i2cp, RDY_RESET);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
wakeup_isr(i2cp, RDY_OK);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -103,6 +103,7 @@ int main(void) {
|
||||||
chSysHalt();
|
chSysHalt();
|
||||||
}
|
}
|
||||||
chThdSleepMilliseconds(500);
|
chThdSleepMilliseconds(500);
|
||||||
|
palTogglePad(GPIOC, GPIOC_LED2);
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue