From d1d2676c7c3d5dfe62af0d6085e922ad4e32decd Mon Sep 17 00:00:00 2001 From: Felix Ruess Date: Tue, 6 Mar 2012 23:29:02 +0100 Subject: [PATCH] trying to fix sys_time_usleep for stm32, still doesn't work, maybe is optimized out? --- sw/airborne/arch/stm32/mcu_periph/sys_time_arch.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sw/airborne/arch/stm32/mcu_periph/sys_time_arch.h b/sw/airborne/arch/stm32/mcu_periph/sys_time_arch.h index a7e95b7237..d0cfee8013 100644 --- a/sw/airborne/arch/stm32/mcu_periph/sys_time_arch.h +++ b/sw/airborne/arch/stm32/mcu_periph/sys_time_arch.h @@ -57,7 +57,7 @@ extern void sys_tick_irq_handler(void); /** Busy wait, in microseconds */ // FIXME: directly use the SysTick->VAL here static inline void sys_time_usleep(uint32_t us) { - uint32_t end = GET_CUR_TIME_USEC() + CPU_TICKS_OF_USEC(us); + uint32_t end = GET_CUR_TIME_USEC() + us; while ((uint32_t)GET_CUR_TIME_USEC() < end); }