diff --git a/arch/arm/src/stm32/stm32_i2c.c b/arch/arm/src/stm32/stm32_i2c.c index f4c97eca506..2110a4847f2 100644 --- a/arch/arm/src/stm32/stm32_i2c.c +++ b/arch/arm/src/stm32/stm32_i2c.c @@ -7,7 +7,7 @@ * * With extensions, modifications by: * - * Copyright (C) 2011-2014, 2016 Gregory Nutt. All rights reserved. + * Copyright (C) 2011-2014, 2016-2017 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -670,15 +670,15 @@ static inline int stm32_i2c_sem_waitdone(FAR struct stm32_i2c_priv_s *priv) do { + /* Calculate the elapsed time */ + + elapsed = clock_systimer() - start; + /* Poll by simply calling the timer interrupt handler until it * reports that it is done. */ stm32_i2c_isr(priv); - - /* Calculate the elapsed time */ - - elapsed = clock_systimer() - start; } /* Loop until the transfer is complete. */ diff --git a/arch/arm/src/stm32/stm32_i2c_alt.c b/arch/arm/src/stm32/stm32_i2c_alt.c index 6d4171163ca..1501df0c27c 100644 --- a/arch/arm/src/stm32/stm32_i2c_alt.c +++ b/arch/arm/src/stm32/stm32_i2c_alt.c @@ -7,7 +7,7 @@ * * With extensions, modifications by: * - * Copyright (C) 2011-2014, 2016 Gregory Nutt. All rights reserved. + * Copyright (C) 2011-2014, 2016-2017 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Copyright( C) 2014 Patrizio Simona. All rights reserved. diff --git a/arch/arm/src/stm32/stm32f30xxx_i2c.c b/arch/arm/src/stm32/stm32f30xxx_i2c.c index 4a1ae02a512..487a8c07118 100644 --- a/arch/arm/src/stm32/stm32f30xxx_i2c.c +++ b/arch/arm/src/stm32/stm32f30xxx_i2c.c @@ -7,7 +7,7 @@ * * With extensions and modifications for the F1, F2, and F4 by: * - * Copyright (C) 2011-2013, 2016 Gregory Nutt. All rights reserved. + * Copyright (C) 2011-2013, 2016-2017 Gregory Nutt. All rights reserved. * Author: Gregroy Nutt * * And this version for the STM32 F3 by @@ -704,15 +704,15 @@ static inline int stm32_i2c_sem_waitdone(FAR struct stm32_i2c_priv_s *priv) do { + /* Calculate the elapsed time */ + + elapsed = clock_systimer() - start; + /* Poll by simply calling the timer interrupt handler until it * reports that it is done. */ stm32_i2c_isr(priv); - - /* Calculate the elapsed time */ - - elapsed = clock_systimer() - start; } /* Loop until the transfer is complete. */ diff --git a/arch/arm/src/stm32/stm32f40xxx_i2c.c b/arch/arm/src/stm32/stm32f40xxx_i2c.c index be15a27be00..29a8b449c80 100644 --- a/arch/arm/src/stm32/stm32f40xxx_i2c.c +++ b/arch/arm/src/stm32/stm32f40xxx_i2c.c @@ -7,7 +7,7 @@ * * With extensions, modifications by: * - * Copyright (C) 2011-2014, 2016 Gregory Nutt. All rights reserved. + * Copyright (C) 2011-2014, 2016-2017 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -672,15 +672,15 @@ static inline int stm32_i2c_sem_waitdone(FAR struct stm32_i2c_priv_s *priv) do { + /* Calculate the elapsed time */ + + elapsed = clock_systimer() - start; + /* Poll by simply calling the timer interrupt handler until it * reports that it is done. */ stm32_i2c_isr(priv); - - /* Calculate the elapsed time */ - - elapsed = clock_systimer() - start; } /* Loop until the transfer is complete. */ diff --git a/arch/arm/src/stm32f7/stm32_i2c.c b/arch/arm/src/stm32f7/stm32_i2c.c index c98a1bd2251..50ae643876e 100644 --- a/arch/arm/src/stm32f7/stm32_i2c.c +++ b/arch/arm/src/stm32f7/stm32_i2c.c @@ -897,15 +897,15 @@ static inline int stm32_i2c_sem_waitdone(FAR struct stm32_i2c_priv_s *priv) do { + /* Calculate the elapsed time */ + + elapsed = clock_systimer() - start; + /* Poll by simply calling the timer interrupt handler until it * reports that it is done. */ stm32_i2c_isr(priv); - - /* Calculate the elapsed time */ - - elapsed = clock_systimer() - start; } /* Loop until the transfer is complete. */ diff --git a/arch/arm/src/stm32l4/stm32l4_i2c.c b/arch/arm/src/stm32l4/stm32l4_i2c.c index 48aa7a9b0e2..b6ee80df8b0 100644 --- a/arch/arm/src/stm32l4/stm32l4_i2c.c +++ b/arch/arm/src/stm32l4/stm32l4_i2c.c @@ -4,7 +4,7 @@ * * Copyright (C) 2011 Uros Platise. All rights reserved. * Author: Uros Platise - * Copyright (C) 2011-2013, 2016 Gregory Nutt. All rights reserved. + * Copyright (C) 2011-2013, 2016-2017 Gregory Nutt. All rights reserved. * Author: Gregroy Nutt * Author: John Wharington * Author: Sebastien Lorquet @@ -648,15 +648,15 @@ static inline int stm32l4_i2c_sem_waitdone(FAR struct stm32l4_i2c_priv_s *priv) do { + /* Calculate the elapsed time */ + + elapsed = clock_systimer() - start; + /* Poll by simply calling the timer interrupt handler until it * reports that it is done. */ stm32l4_i2c_isr(priv); - - /* Calculate the elapsed time */ - - elapsed = clock_systimer() - start; } /* Loop until the transfer is complete. */