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:
Graham Sanderson 2021-03-01 08:10:45 -06:00 committed by GitHub
parent 265485c773
commit fa34820fb9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 25 deletions

View File

@ -13,29 +13,28 @@
extern "C" {
#endif
void multicore_reset_core1();
void multicore_reset_core1(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_sleep_core1();
void multicore_launch_core1_raw(void (*entry)(void), uint32_t *sp, uint32_t vector_table);
bool multicore_fifo_rvalid();
bool multicore_fifo_wready();
bool multicore_fifo_rvalid(void);
bool multicore_fifo_wready(void);
void multicore_fifo_push(uint32_t data);
uint32_t multicore_fifo_pop_blocking();
void multicore_fifo_drain();
void multicore_fifo_clear_irq();
int32_t multicore_fifo_get_status();
void multicore_fifo_drain(void);
void multicore_fifo_clear_irq(void);
int32_t multicore_fifo_get_status(void);
// 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
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);
void multicore_lockout_end_blocking();
void multicore_lockout_end_blocking(void);
#ifdef __cplusplus
}

View File

@ -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);
/*! \brief Send core 1 to sleep.
* \ingroup pico_multicore
*
*/
void multicore_sleep_core1(void);
/*! \brief Launch code on core 1 with no stack protection
* \ingroup pico_multicore
*

View File

@ -107,15 +107,6 @@ void multicore_reset_core1() {
*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) {
assert(!(stack_size_bytes & 3u));
uint32_t *stack_ptr = stack_bottom + stack_size_bytes / sizeof(uint32_t);