move get_core_num() into platform.h (#852)
This commit is contained in:
@ -304,15 +304,6 @@ __force_inline static void spin_unlock(spin_lock_t *lock, uint32_t saved_irq) {
|
||||
restore_interrupts(saved_irq);
|
||||
}
|
||||
|
||||
/*! \brief Get the current core number
|
||||
* \ingroup hardware_sync
|
||||
*
|
||||
* \return The core number the call was made from
|
||||
*/
|
||||
__force_inline static uint get_core_num(void) {
|
||||
return (*(uint32_t *) (SIO_BASE + SIO_CPUID_OFFSET));
|
||||
}
|
||||
|
||||
/*! \brief Initialise a spin lock
|
||||
* \ingroup hardware_sync
|
||||
*
|
||||
|
@ -17,6 +17,8 @@
|
||||
*/
|
||||
|
||||
#include "hardware/platform_defs.h"
|
||||
#include "hardware/regs/addressmap.h"
|
||||
#include "hardware/regs/sio.h"
|
||||
|
||||
// Marker for builds targeting the RP2040
|
||||
#define PICO_RP2040 1
|
||||
@ -423,6 +425,15 @@ static inline void busy_wait_at_least_cycles(uint32_t minimum_cycles) {
|
||||
);
|
||||
}
|
||||
|
||||
/*! \brief Get the current core number
|
||||
* \ingroup pico_platform
|
||||
*
|
||||
* \return The core number the call was made from
|
||||
*/
|
||||
__force_inline static uint get_core_num(void) {
|
||||
return (*(uint32_t *) (SIO_BASE + SIO_CPUID_OFFSET));
|
||||
}
|
||||
|
||||
#else // __ASSEMBLER__
|
||||
|
||||
#define WRAPPER_FUNC_NAME(x) __wrap_##x
|
||||
|
Reference in New Issue
Block a user