1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00
Commit Graph

24 Commits

Author SHA1 Message Date
Teufelchen1
571026d394 Revert "sys/pm_layered: pm_(un)block add attribute optimize(3) -shortens hotpath"
This reverts commit 5447203921.
2023-01-16 11:28:30 +01:00
Karl Fessel
72a1e93eed sys/pm_layered: pm_get_blocker = instead of memcopy -ease readability 2022-11-04 16:59:48 +01:00
Karl Fessel
5447203921 sys/pm_layered: pm_(un)block add attribute optimize(3) -shortens hotpath 2022-11-04 16:59:02 +01:00
Karl Fessel
f3ed268ec6 sys/pm_layered: move (un)block assert for minor speedup 2022-11-03 16:20:56 +01:00
Jue
4b802ad12e sys/pm_layered: add debugging outputs 2022-10-31 22:18:00 +01:00
Benjamin Valentin
7fb8f3b7c5 sys/pm_layered: rename val_u8 -> blockers 2022-04-06 12:29:25 +02:00
Benjamin Valentin
79de7ea5e5 sys/pm_layered: use array representation, get rid of implicit IDLE mode 2022-04-06 12:29:25 +02:00
Juergen Fitschen
b957b3cea1 sys/pm_layered: allow board.h to set PM_BLOCKER_INITIAL 2022-02-11 17:05:34 +01:00
Marian Buschsieweke
635151dc20
sys/pm_layered: use atomic_utils 2021-03-15 21:17:17 +01:00
Bas Stottelaar
1b35d06a51 sys/*: realign ENABLE_DEBUG 2020-10-23 11:27:48 +02:00
Bas Stottelaar
80d9da90df sys/*: add missing include of assert.h 2020-10-22 11:13:09 +02:00
Marian Buschsieweke
5ecafab83d
sys/pm: Correctly access pm_blocker
Replace `volatile` access to pm_blocker by guarding the accesses with
`irq_disable()` ... `irq_restore()`.

`volatile` does only guarantee that no compiler optimizations are performed on
a variable access, but does not provide atomic access. E.g. on systems with
a memory bus of less than 32 bit, the access to pm_blocker cannot be done
with a single CPU instruction. Thus, resorting to disabling IRQs is the easiest
and most portable way to actually achieve atomic access.
2020-07-15 11:21:59 +02:00
benpicco
ee7ec7e3ac
Merge pull request #13978 from maribu/fix_pm_off
sys/pm: Fix behavior of fallback pm_off() implementation
2020-05-01 14:09:48 +02:00
Marian Buschsieweke
a3e7abc2e2
sys/pm: Fix behavior of fallback pm_off() implementation
- pm_off() should prevent other threads from getting executed after it is
  called, as it should turn off the MCU completely according to its doc
    - Previously, the fallback implementation would still allow other threads
      to continue working
    - Simply disabling IRQs and never enabling them again should make sure
      the MCU behaves like it would be completely off
- pm_off() should reduce the power consumption as much as possible
    - Previously, when IRQs came after the call to pm_set_lowest() in the
      fallback implementation of pm_off(), `while(1) {}` got executed at full
      power consumption
    - Just calling `pm_set(0);` in a loop while make sure that lowest power mode
      is restored if the MCU wakes up again.
    - The check if the lowest power mode is available is skipped, as no code
      gets executed afterwards anyway
2020-04-29 12:08:12 +02:00
Marian Buschsieweke
f6873dbac3
sys/pm: Add pm_get_blocker()
Provide access to pm_blocker via a well-defined API rather than hacks.
2020-04-29 11:21:03 +02:00
Thomas Stilwell
325ab426d4
sys/shell/commands: pm: add set mode block mode unblock mode 2020-04-28 16:56:34 +02:00
f66fd7b1ca sys/pm_layered: change PM_BLOCKER_INITIAL to single value 2020-02-14 12:05:59 +01:00
Joakim Nohlgård
9af2696d2f pm_layered: Use {} for empty while loops 2018-02-01 06:55:49 +01:00
smlng
b283b7784c make: fix various compile errors with Wextra
pkg, nordic_softdevice_ble: disable CFLAGS to omit compiler error
        sys, pm_layered: fix casting nonscalar to the same type
        cpu, stm32_common: fix type-limits, remove always true assert
        cpu, stm32f4: fix pointer arithmetic in periph/i2c
        drivers, at86rf2xx: fix type-limits where condition always true
        saul, gpio: fix if no gpio configured for saul
        cpu, saml21: add frequency check to periph/timer
        driver, cc110x: fix unused param and type-limts errors
        boards, wsn430-common: fix old-style-declaration
        make: fix old style definition
        drivers, sdcard_spi: fix old style typedef
        driver, at30tse: remove unnecessary check
        driver, nrf24: fix type-limit
        driver, pn532: change buffer from char to uint8_t
        tests/driver_sdcard: fix type limits
        boards, feather-m0: add missing field inits
        driver, tcs37727: fix type limits
        pkg, emb6: disable some compiler warnings
        tests/emb6: disable some compiler warings
        pkg, openthread: fix sign compare and unused params
        tests/trickle: fix struct init
        tests/pthread_cooperation: fix type limits
        board, mips-malta: remove feature periph_uart
        shell: fix var size for netif command
        gnrc, netif: fix sign-compare
        gnrc, nib: fix sign-compare
        shell: fix output in netif command
        posix: fix type-limits in pthread_cond
2017-11-28 18:31:43 +01:00
416ac62fbf pm: unify and set safe default pm_blocker 2017-10-16 14:32:27 +02:00
Hauke Petersen
5920d99752 pm: fix weak-based default implementations
Instead of using `weak` function definitions, this PR handles
default implementations using `PROVIDES_x` defines, allowing
for cpus/pm realted modules to use their own implementations.
2017-10-16 14:27:35 +02:00
Hauke Petersen
5c7ed2228d pm_layerd: fix initial value for PM_BLOCKER_INITIAL
the current value was a debugging left-over and should
actually be 0.
2017-03-28 19:32:32 +02:00
Hauke Petersen
0fc8c665f1 sys/pm_layered: fixed doxygen group 2017-01-19 11:07:59 +01:00
92f6fc6888 drivers: add layered power modes module 2017-01-12 11:24:15 +01:00