fix return type of enable/disable interrupt methods... add host versions for completeness (#2310)

This commit is contained in:
Graham Sanderson 2025-03-09 14:39:21 -05:00 committed by GitHub
parent dd1f48335b
commit b1676c18a3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 15 additions and 2 deletions

View file

@ -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);

View file

@ -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)

View file

@ -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);