From 09981b39c2b4b45f619843129f103055d279ad0f Mon Sep 17 00:00:00 2001 From: FredericG Date: Sat, 22 May 2010 06:30:42 +0000 Subject: [PATCH] A few small fixes git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@647 ebee16cc-31ac-478f-84a7-5cbb03baadba --- flight/PiOS/STM32F10x/pios_i2c.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/flight/PiOS/STM32F10x/pios_i2c.c b/flight/PiOS/STM32F10x/pios_i2c.c index 499030bda..301017023 100644 --- a/flight/PiOS/STM32F10x/pios_i2c.c +++ b/flight/PiOS/STM32F10x/pios_i2c.c @@ -564,7 +564,7 @@ static void EV_IRQHandler(I2CRecTypeDef *i2cx) if(i2cx->transfer_state.STOP_REQUESTED) { TransferEnd(i2cx); DebugPinLow(DEBUG_PIN_ISR); - return; + goto isr_return; } /* Send IIC address */ @@ -620,6 +620,8 @@ static void ER_IRQHandler(I2CRecTypeDef *i2cx) /* Read SR1 and SR2 at the beginning (if not done so, flags may get lost) */ uint32_t event = I2C_GetLastEvent(i2cx->base); + i2cx->transfer_state.INIRQ = 1; + /* Note that only one error number is available */ /* The order of these checks defines the priority */ @@ -646,6 +648,8 @@ static void ER_IRQHandler(I2CRecTypeDef *i2cx) /* Notify that transfer has finished (due to the error) */ TransferEnd(i2cx); + + i2cx->transfer_state.INIRQ = 0; }