void up_idle(void) { #if defined(CONFIG_SUPPRESS_INTERRUPTS) || defined(CONFIG_SUPPRESS_TIMER_INTS) /* If the system is idle and there are no timer interrupts, then process * "fake" timer interrupts. Hopefully, something will wake up. */ sched_process_timer(); #else /* If the g_dma_inprogress is zero, then there is no DMA in progress. This * value is needed in the IDLE loop to determine if the IDLE loop should * go into lower power power consumption modes. According to the LPC17xx * User Manual: "The DMA controller can continue to work in Sleep mode, and * has access to the peripheral SRAMs and all peripheral registers. The * flash memory and the Main SRAM are not available in Sleep mode, they are * disabled in order to save power." */ #ifdef CONFIG_LPC17_GPDMA if (g_dma_inprogress == 0) #endif { /* Sleep until an interrupt occurs in order to save power */ BEGIN_IDLE(); asm("WFI"); END_IDLE(); } #endif }
void up_idle(void) { #if defined(CONFIG_SUPPRESS_INTERRUPTS) || defined(CONFIG_SUPPRESS_TIMER_INTS) /* If the system is idle and there are no timer interrupts, then process * "fake" timer interrupts. Hopefully, something will wake up. */ sched_process_timer(); #else /* Perform IDLE mode power management */ BEGIN_IDLE(); stm32_idlepm(); END_IDLE(); #endif }
void up_idle(void) { #if defined(CONFIG_SUPPRESS_INTERRUPTS) || defined(CONFIG_SUPPRESS_TIMER_INTS) /* If the system is idle and there are no timer interrupts, then process * "fake" timer interrupts. Hopefully, something will wake up. */ sched_process_timer(); #else /* Sleep until an interrupt occurs to save power */ BEGIN_IDLE(); asm("WFI"); END_IDLE(); #endif }
void up_idle(void) { #if defined(CONFIG_SUPPRESS_INTERRUPTS) || defined(CONFIG_SUPPRESS_TIMER_INTS) /* If the system is idle and there are no timer interrupts, then process * "fake" timer interrupts. Hopefully, something will wake up. */ sched_process_timer(); #else /* Perform IDLE mode power management */ up_idlepm(); /* Sleep until an interrupt occurs to save power. * * NOTE: There is an STM32F107 errata that is fixed by the following * workaround: * * "2.17.11 Ethernet DMA not working after WFI/WFE instruction * Description * If a WFI/WFE instruction is executed to put the system in sleep mode * while the Ethernet MAC master clock on the AHB bus matrix is ON and all * remaining masters clocks are OFF, the Ethernet DMA will be not able to * perform any AHB master accesses during sleep mode." * * Workaround * Enable DMA1 or DMA2 clocks in the RCC_AHBENR register before * executing the WFI/WFE instruction." * * Here the workaround is just to avoid SLEEP mode for the connectivity * line parts if Ethernet is enabled. The errate recommends a more * general solution: Enabling DMA1/2 clocking in stm32f10xx_rcc.c if the * STM32107 Ethernet peripheral is enabled. */ #if !defined(CONFIG_STM32_CONNECTIVITYLINE) || !defined(CONFIG_STM32_ETHMAC) #if !(defined(CONFIG_DEBUG_SYMBOLS) && defined(CONFIG_STM32_DISABLE_IDLE_SLEEP_DURING_DEBUG)) BEGIN_IDLE(); asm("WFI"); END_IDLE(); #endif #endif #endif }
void up_idle(void) { #if defined(CONFIG_SUPPRESS_INTERRUPTS) || defined(CONFIG_SUPPRESS_TIMER_INTS) /* If the system is idle and there are no timer interrupts, then process * "fake" timer interrupts. Hopefully, something will wake up. */ sched_process_timer(); #else /* Perform IDLE mode power management */ up_idlepm(); /* Sleep until an interrupt occurs to save power. */ #if !(defined(CONFIG_DEBUG_SYMBOLS) && defined(CONFIG_STM32L4_DISABLE_IDLE_SLEEP_DURING_DEBUG)) BEGIN_IDLE(); asm("WFI"); END_IDLE(); #endif #endif }