From b1676c18a3a9e3670d2a83a6d72b3a97e0ff31db Mon Sep 17 00:00:00 2001 From: Graham Sanderson Date: Sun, 9 Mar 2025 14:39:21 -0500 Subject: [PATCH] fix return type of enable/disable interrupt methods... add host versions for completeness (#2310) --- src/host/hardware_sync/include/hardware/sync.h | 4 ++++ src/host/hardware_sync/sync_core0_only.c | 9 +++++++++ src/rp2_common/hardware_sync/include/hardware/sync.h | 4 ++-- 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/src/host/hardware_sync/include/hardware/sync.h b/src/host/hardware_sync/include/hardware/sync.h index ffbc0803..ae3865ae 100644 --- a/src/host/hardware_sync/include/hardware/sync.h +++ b/src/host/hardware_sync/include/hardware/sync.h @@ -121,6 +121,10 @@ void restore_interrupts(uint32_t status); void restore_interrupts_from_disabled(uint32_t status); +void disable_interrupts(void); + +void enable_interrupts(void); + uint spin_lock_get_num(spin_lock_t *lock); spin_lock_t *spin_lock_instance(uint lock_num); diff --git a/src/host/hardware_sync/sync_core0_only.c b/src/host/hardware_sync/sync_core0_only.c index 47d0f2f5..70964c4b 100644 --- a/src/host/hardware_sync/sync_core0_only.c +++ b/src/host/hardware_sync/sync_core0_only.c @@ -31,6 +31,15 @@ PICO_WEAK_FUNCTION_DEF(restore_interrupts_from_disabled) void PICO_WEAK_FUNCTION_IMPL_NAME(restore_interrupts_from_disabled)(uint32_t status) { } +PICO_WEAK_FUNCTION_DEF(disable_interrupts) + +void PICO_WEAK_FUNCTION_IMPL_NAME(disable_interrupts)(void) { +} + +PICO_WEAK_FUNCTION_DEF(enable_interrupts) + +void PICO_WEAK_FUNCTION_IMPL_NAME(enable_interrupts)(void) { +} PICO_WEAK_FUNCTION_DEF(spin_lock_instance) diff --git a/src/rp2_common/hardware_sync/include/hardware/sync.h b/src/rp2_common/hardware_sync/include/hardware/sync.h index 82b25378..69b3e69a 100644 --- a/src/rp2_common/hardware_sync/include/hardware/sync.h +++ b/src/rp2_common/hardware_sync/include/hardware/sync.h @@ -201,7 +201,7 @@ __force_inline static void __mem_fence_release(void) { /*! \brief Explicitly disable interrupts on the calling core * \ingroup hardware_sync */ -__force_inline static uint32_t disable_interrupts(void) { +__force_inline static void disable_interrupts(void) { #ifdef __riscv __compiler_memory_barrier(); riscv_clear_csr(mstatus, 8); @@ -214,7 +214,7 @@ __force_inline static uint32_t disable_interrupts(void) { /*! \brief Explicitly enable interrupts on the calling core * \ingroup hardware_sync */ -__force_inline static uint32_t enable_interrupts(void) { +__force_inline static void enable_interrupts(void) { #ifdef __riscv __compiler_memory_barrier(); riscv_set_csr(mstatus, 8);