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,21 +179,24 @@ static void i2c_lld_serve_interrupt(I2CDriver *i2cp, uint32_t isr) {
|
|||
dp->CR2 |= I2C_CR2_STOP;
|
||||
}
|
||||
}
|
||||
else if (isr & I2C_ISR_STOPF) {
|
||||
/* Stops the associated DMA streams.*/
|
||||
dmaStreamDisable(i2cp->dmatx);
|
||||
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);
|
||||
if (isr & I2C_ISR_NACKF) {
|
||||
/* Starts a STOP sequence immediately.*/
|
||||
dp->CR2 |= I2C_CR2_STOP;
|
||||
|
||||
i2cp->errors |= I2CD_ACK_FAILURE;
|
||||
}
|
||||
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();
|
||||
}
|
||||
chThdSleepMilliseconds(500);
|
||||
palTogglePad(GPIOC, GPIOC_LED2);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue