From 34e43c7ee9700249dc6e5b333b7c264d45d6b530 Mon Sep 17 00:00:00 2001 From: Damien George Date: Mon, 25 Aug 2014 18:12:44 +0100 Subject: stmhal: Improve efficiency of SysTick IRQ and HAL_Delay. SysTick IRQ now increases millisecond counter directly (ie without calling HAL_IncTick). Provide our own version of HAL_Delay that does a wfi while waiting. This more than halves power consumption when running a loop containing a pyb.delay call. It used to be like this, but new version of HAL library regressed this feature. --- stmhal/hal/src/stm32f4xx_hal.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'stmhal/hal') diff --git a/stmhal/hal/src/stm32f4xx_hal.c b/stmhal/hal/src/stm32f4xx_hal.c index 6c076c358..0040658a0 100644 --- a/stmhal/hal/src/stm32f4xx_hal.c +++ b/stmhal/hal/src/stm32f4xx_hal.c @@ -93,7 +93,7 @@ #define CMPCR_CMP_PD_BB (PERIPH_BB_BASE + (CMPCR_OFFSET * 32) + (CMP_PD_BitNumber * 4)) /* Private macro -------------------------------------------------------------*/ /* Private variables ---------------------------------------------------------*/ -static __IO uint32_t uwTick; +__IO uint32_t uwTick; /* Private function prototypes -----------------------------------------------*/ /* Private functions ---------------------------------------------------------*/ -- cgit v1.2.3