remove broken and fairly pointless deep sleep API (#198)
* remove broken and fairly pointless deep sleep API, use multicore_reset_core1 instead * strict-prototype for multicore_fifo_drain() in host header * Also for multicore_lockout_victim_init() Co-authored-by: Luke Wren <wren6991@gmail.com>
This commit is contained in:
parent
f239bd3de5
commit
4904fe2e32
@ -13,29 +13,28 @@
|
|||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void multicore_reset_core1();
|
void multicore_reset_core1(void);
|
||||||
void multicore_launch_core1(void (*entry)(void));
|
void multicore_launch_core1(void (*entry)(void));
|
||||||
void multicore_launch_core1_with_stack(void (*entry)(void), uint32_t *stack_bottom, size_t stack_size_bytes);
|
void multicore_launch_core1_with_stack(void (*entry)(void), uint32_t *stack_bottom, size_t stack_size_bytes);
|
||||||
void multicore_sleep_core1();
|
|
||||||
void multicore_launch_core1_raw(void (*entry)(void), uint32_t *sp, uint32_t vector_table);
|
void multicore_launch_core1_raw(void (*entry)(void), uint32_t *sp, uint32_t vector_table);
|
||||||
|
|
||||||
bool multicore_fifo_rvalid();
|
bool multicore_fifo_rvalid(void);
|
||||||
bool multicore_fifo_wready();
|
bool multicore_fifo_wready(void);
|
||||||
void multicore_fifo_push(uint32_t data);
|
void multicore_fifo_push(uint32_t data);
|
||||||
uint32_t multicore_fifo_pop_blocking();
|
uint32_t multicore_fifo_pop_blocking();
|
||||||
void multicore_fifo_drain();
|
void multicore_fifo_drain(void);
|
||||||
void multicore_fifo_clear_irq();
|
void multicore_fifo_clear_irq(void);
|
||||||
int32_t multicore_fifo_get_status();
|
int32_t multicore_fifo_get_status(void);
|
||||||
|
|
||||||
// call this from the lockout victim thread
|
// call this from the lockout victim thread
|
||||||
void multicore_lockout_victim_init();
|
void multicore_lockout_victim_init(void);
|
||||||
|
|
||||||
// start locking out the other core (it will be
|
// start locking out the other core (it will be
|
||||||
bool multicore_lockout_start_timeout_us(uint64_t timeout_us);
|
bool multicore_lockout_start_timeout_us(uint64_t timeout_us);
|
||||||
void multicore_lockout_start_blocking();
|
void multicore_lockout_start_blocking(void);
|
||||||
|
|
||||||
bool multicore_lockout_end_timeout_us(uint64_t timeout_us);
|
bool multicore_lockout_end_timeout_us(uint64_t timeout_us);
|
||||||
void multicore_lockout_end_blocking();
|
void multicore_lockout_end_blocking(void);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
@ -55,12 +55,6 @@ void multicore_launch_core1(void (*entry)(void));
|
|||||||
*/
|
*/
|
||||||
void multicore_launch_core1_with_stack(void (*entry)(void), uint32_t *stack_bottom, size_t stack_size_bytes);
|
void multicore_launch_core1_with_stack(void (*entry)(void), uint32_t *stack_bottom, size_t stack_size_bytes);
|
||||||
|
|
||||||
/*! \brief Send core 1 to sleep.
|
|
||||||
* \ingroup pico_multicore
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
void multicore_sleep_core1(void);
|
|
||||||
|
|
||||||
/*! \brief Launch code on core 1 with no stack protection
|
/*! \brief Launch code on core 1 with no stack protection
|
||||||
* \ingroup pico_multicore
|
* \ingroup pico_multicore
|
||||||
*
|
*
|
||||||
|
@ -107,15 +107,6 @@ void multicore_reset_core1() {
|
|||||||
*power_off_clr = PSM_FRCE_OFF_PROC1_BITS;
|
*power_off_clr = PSM_FRCE_OFF_PROC1_BITS;
|
||||||
}
|
}
|
||||||
|
|
||||||
void multicore_sleep_core1() {
|
|
||||||
multicore_reset_core1();
|
|
||||||
// note we give core1 an invalid stack pointer, as it should not be used
|
|
||||||
// note also if we ge simply passed a function that returned immediately, we'd end up in core1_hang anyway
|
|
||||||
// however that would waste 2 bytes for that function (the horror!)
|
|
||||||
extern void core1_hang(void); // in crt0.S
|
|
||||||
multicore_launch_core1_raw(core1_hang, (uint32_t *) -1, scb_hw->vtor);
|
|
||||||
}
|
|
||||||
|
|
||||||
void multicore_launch_core1_with_stack(void (*entry)(void), uint32_t *stack_bottom, size_t stack_size_bytes) {
|
void multicore_launch_core1_with_stack(void (*entry)(void), uint32_t *stack_bottom, size_t stack_size_bytes) {
|
||||||
assert(!(stack_size_bytes & 3u));
|
assert(!(stack_size_bytes & 3u));
|
||||||
uint32_t *stack_ptr = stack_bottom + stack_size_bytes / sizeof(uint32_t);
|
uint32_t *stack_ptr = stack_bottom + stack_size_bytes / sizeof(uint32_t);
|
||||||
|
Loading…
Reference in New Issue
Block a user