diff options
| author | hathach <[email protected]> | 2025-05-20 16:18:00 +0700 |
|---|---|---|
| committer | hathach <[email protected]> | 2025-05-20 17:01:31 +0700 |
| commit | a4875fefead1a2b27f13a588dea44eaca737f553 (patch) | |
| tree | c849560774bf10fd28f6ba67911d0ba09f1b1571 /src/osal/osal_pico.h | |
| parent | bb1d348eb3908543f7bc80fc462d91bba62edace (diff) | |
rename osal_critcal to osal_spinlock
add spinlock implementation for most rtos
Diffstat (limited to 'src/osal/osal_pico.h')
| -rw-r--r-- | src/osal/osal_pico.h | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/osal/osal_pico.h b/src/osal/osal_pico.h index be631ed18..ace5907d7 100644 --- a/src/osal/osal_pico.h +++ b/src/osal/osal_pico.h @@ -44,22 +44,22 @@ TU_ATTR_ALWAYS_INLINE static inline void osal_task_delay(uint32_t msec) { } //--------------------------------------------------------------------+ -// Critical API +// Spinlock API //--------------------------------------------------------------------+ -typedef critical_section_t osal_critical_t; -#define OSAL_CRITIAL_DEF(_name, _int_set) \ - osal_critical_t _name +typedef critical_section_t osal_spinlock_t; // pico implement critical section with spinlock +#define OSAL_SPINLOCK_DEF(_name, _int_set) \ + osal_spinlock_t _name -TU_ATTR_ALWAYS_INLINE static inline void osal_critical_init(osal_critical_t *ctx) { +TU_ATTR_ALWAYS_INLINE static inline void osal_spin_init(osal_spinlock_t *ctx) { critical_section_init(ctx); } -TU_ATTR_ALWAYS_INLINE static inline void osal_critical_enter(osal_critical_t *ctx, bool in_isr) { +TU_ATTR_ALWAYS_INLINE static inline void osal_spin_lock(osal_spinlock_t *ctx, bool in_isr) { (void) in_isr; critical_section_enter_blocking(ctx); } -TU_ATTR_ALWAYS_INLINE static inline void osal_critical_exit(osal_critical_t *ctx, bool in_isr) { +TU_ATTR_ALWAYS_INLINE static inline void osal_spin_unlock(osal_spinlock_t *ctx, bool in_isr) { (void) in_isr; critical_section_exit(ctx); } |
