Skip to content

Commit b1676c1

Browse files
authored
fix return type of enable/disable interrupt methods... add host versions for completeness (#2310)
1 parent dd1f483 commit b1676c1

File tree

3 files changed

+15
-2
lines changed

3 files changed

+15
-2
lines changed

src/host/hardware_sync/include/hardware/sync.h

+4
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,10 @@ void restore_interrupts(uint32_t status);
121121

122122
void restore_interrupts_from_disabled(uint32_t status);
123123

124+
void disable_interrupts(void);
125+
126+
void enable_interrupts(void);
127+
124128
uint spin_lock_get_num(spin_lock_t *lock);
125129

126130
spin_lock_t *spin_lock_instance(uint lock_num);

src/host/hardware_sync/sync_core0_only.c

+9
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,15 @@ PICO_WEAK_FUNCTION_DEF(restore_interrupts_from_disabled)
3131
void PICO_WEAK_FUNCTION_IMPL_NAME(restore_interrupts_from_disabled)(uint32_t status) {
3232
}
3333

34+
PICO_WEAK_FUNCTION_DEF(disable_interrupts)
35+
36+
void PICO_WEAK_FUNCTION_IMPL_NAME(disable_interrupts)(void) {
37+
}
38+
39+
PICO_WEAK_FUNCTION_DEF(enable_interrupts)
40+
41+
void PICO_WEAK_FUNCTION_IMPL_NAME(enable_interrupts)(void) {
42+
}
3443

3544
PICO_WEAK_FUNCTION_DEF(spin_lock_instance)
3645

src/rp2_common/hardware_sync/include/hardware/sync.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ __force_inline static void __mem_fence_release(void) {
201201
/*! \brief Explicitly disable interrupts on the calling core
202202
* \ingroup hardware_sync
203203
*/
204-
__force_inline static uint32_t disable_interrupts(void) {
204+
__force_inline static void disable_interrupts(void) {
205205
#ifdef __riscv
206206
__compiler_memory_barrier();
207207
riscv_clear_csr(mstatus, 8);
@@ -214,7 +214,7 @@ __force_inline static uint32_t disable_interrupts(void) {
214214
/*! \brief Explicitly enable interrupts on the calling core
215215
* \ingroup hardware_sync
216216
*/
217-
__force_inline static uint32_t enable_interrupts(void) {
217+
__force_inline static void enable_interrupts(void) {
218218
#ifdef __riscv
219219
__compiler_memory_barrier();
220220
riscv_set_csr(mstatus, 8);

0 commit comments

Comments
 (0)