mirror of
https://github.com/raspberrypi/pico-sdk.git
synced 2025-04-16 23:43:15 +00:00
Force inline critical_section_{enter,exit}
Otherwise it may end up in flash when we want it to follow the caller's placement (maybe in RAM.)
This commit is contained in:
parent
950a68f80e
commit
6b0bb0aad9
@ -7,6 +7,7 @@
|
||||
#ifndef _PICO_CRITICAL_SECTION_H
|
||||
#define _PICO_CRITICAL_SECTION_H
|
||||
|
||||
#include "pico.h"
|
||||
#include "pico/lock_core.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
@ -58,7 +59,7 @@ void critical_section_init_with_lock_num(critical_section_t *crit_sec, uint lock
|
||||
*
|
||||
* \param crit_sec Pointer to critical_section structure
|
||||
*/
|
||||
static inline void critical_section_enter_blocking(critical_section_t *crit_sec) {
|
||||
__force_inline static void critical_section_enter_blocking(critical_section_t *crit_sec) {
|
||||
crit_sec->save = spin_lock_blocking(crit_sec->spin_lock);
|
||||
}
|
||||
|
||||
@ -67,7 +68,7 @@ static inline void critical_section_enter_blocking(critical_section_t *crit_sec)
|
||||
*
|
||||
* \param crit_sec Pointer to critical_section structure
|
||||
*/
|
||||
static inline void critical_section_exit(critical_section_t *crit_sec) {
|
||||
__force_inline static void critical_section_exit(critical_section_t *crit_sec) {
|
||||
spin_unlock(crit_sec->spin_lock, crit_sec->save);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user