Clean up various C source and headers to appease -Wstrict-prototypes
In C, func() is a function taking an unspecified number of arguments, vs func(void) a function taking no arguments. In C++ both forms indicate "no arguments." Update these headers to use the (void) form, which is correct in both languages and avoids complaints when -Wstrict-prototypes is specified.
This commit is contained in:
committed by
graham sanderson
parent
93c600736e
commit
a362925eda
@ -36,7 +36,7 @@ extern "C" {
|
||||
* \ingroup pico_multicore
|
||||
*
|
||||
*/
|
||||
void multicore_reset_core1();
|
||||
void multicore_reset_core1(void);
|
||||
|
||||
/*! \brief Run code on core 1
|
||||
* \ingroup pico_multicore
|
||||
@ -58,7 +58,7 @@ void multicore_launch_core1_with_stack(void (*entry)(void), uint32_t *stack_bott
|
||||
* \ingroup pico_multicore
|
||||
*
|
||||
*/
|
||||
void multicore_sleep_core1();
|
||||
void multicore_sleep_core1(void);
|
||||
|
||||
/*! \brief Launch code on core 1 with no stack protection
|
||||
* \ingroup pico_multicore
|
||||
@ -85,7 +85,7 @@ void multicore_launch_core1_raw(void (*entry)(void), uint32_t *sp, uint32_t vect
|
||||
*
|
||||
* \return true if the FIFO has data in it, false otherwise
|
||||
*/
|
||||
static inline bool multicore_fifo_rvalid() {
|
||||
static inline bool multicore_fifo_rvalid(void) {
|
||||
return !!(sio_hw->fifo_st & SIO_FIFO_ST_VLD_BITS);
|
||||
}
|
||||
|
||||
@ -94,7 +94,7 @@ static inline bool multicore_fifo_rvalid() {
|
||||
*
|
||||
* @return true if the FIFO is full, false otherwise
|
||||
*/
|
||||
static inline bool multicore_fifo_wready() {
|
||||
static inline bool multicore_fifo_wready(void) {
|
||||
return !!(sio_hw->fifo_st & SIO_FIFO_ST_RDY_BITS);
|
||||
}
|
||||
|
||||
@ -120,7 +120,7 @@ bool multicore_fifo_push_timeout_us(uint32_t data, uint64_t timeout_us);
|
||||
*
|
||||
* \return 32 bit unsigned data from the FIFO.
|
||||
*/
|
||||
uint32_t multicore_fifo_pop_blocking();
|
||||
uint32_t multicore_fifo_pop_blocking(void);
|
||||
|
||||
bool multicore_fifo_pop_timeout_us(uint64_t timeout_us, uint32_t *out);
|
||||
|
||||
@ -128,7 +128,7 @@ bool multicore_fifo_pop_timeout_us(uint64_t timeout_us, uint32_t *out);
|
||||
* \ingroup multicore_fifo
|
||||
*
|
||||
*/
|
||||
static inline void multicore_fifo_drain() {
|
||||
static inline void multicore_fifo_drain(void) {
|
||||
while (multicore_fifo_rvalid())
|
||||
(void) sio_hw->fifo_rd;
|
||||
}
|
||||
@ -136,7 +136,7 @@ static inline void multicore_fifo_drain() {
|
||||
/*! \brief Clear FIFO interrupt
|
||||
* \ingroup multicore_fifo
|
||||
*/
|
||||
static inline void multicore_fifo_clear_irq() {
|
||||
static inline void multicore_fifo_clear_irq(void) {
|
||||
// Write any value to clear any interrupts
|
||||
sio_hw->fifo_st = 0xff;
|
||||
}
|
||||
@ -153,19 +153,19 @@ static inline void multicore_fifo_clear_irq() {
|
||||
* 1 | Value is 1 if this core’s TX FIFO is not full (i.e. if FIFO_WR is ready for more data)
|
||||
* 0 | Value is 1 if this core’s RX FIFO is not empty (i.e. if FIFO_RD is valid)
|
||||
*/
|
||||
static inline int32_t multicore_fifo_get_status() {
|
||||
static inline int32_t multicore_fifo_get_status(void) {
|
||||
return sio_hw->fifo_st;
|
||||
}
|
||||
|
||||
// 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
|
||||
}
|
||||
|
@ -46,7 +46,7 @@ bool multicore_fifo_push_timeout_us(uint32_t data, uint64_t timeout_us) {
|
||||
return true;
|
||||
}
|
||||
|
||||
static inline uint32_t multicore_fifo_pop_blocking_inline() {
|
||||
static inline uint32_t multicore_fifo_pop_blocking_inline(void) {
|
||||
// If nothing there yet, we wait for an event first,
|
||||
// to try and avoid too much busy waiting
|
||||
while (!multicore_fifo_rvalid())
|
||||
@ -75,7 +75,7 @@ bool multicore_fifo_pop_timeout_us(uint64_t timeout_us, uint32_t *out) {
|
||||
// Default stack for core1 ... if multicore_launch_core1 is not included then .stack1 section will be garbage collected
|
||||
static uint32_t __attribute__((section(".stack1"))) core1_stack[PICO_CORE1_STACK_SIZE / sizeof(uint32_t)];
|
||||
|
||||
static void __attribute__ ((naked)) core1_trampoline() {
|
||||
static void __attribute__ ((naked)) core1_trampoline(void) {
|
||||
__asm("pop {r0, r1, pc}");
|
||||
}
|
||||
|
||||
@ -110,7 +110,7 @@ void multicore_sleep_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(); // in crt0.S
|
||||
extern void core1_hang(void); // in crt0.S
|
||||
multicore_launch_core1_raw(core1_hang, (uint32_t *) -1, scb_hw->vtor);
|
||||
}
|
||||
|
||||
@ -161,7 +161,7 @@ static bool lockout_in_progress;
|
||||
|
||||
// note this method is in RAM because lockout is used when writing to flash
|
||||
// it only makes inline calls
|
||||
static void __isr __not_in_flash_func(multicore_lockout_handler)() {
|
||||
static void __isr __not_in_flash_func(multicore_lockout_handler)(void) {
|
||||
multicore_fifo_clear_irq();
|
||||
while (multicore_fifo_rvalid()) {
|
||||
if (sio_hw->fifo_rd == LOCKOUT_MAGIC_START) {
|
||||
@ -176,7 +176,7 @@ static void __isr __not_in_flash_func(multicore_lockout_handler)() {
|
||||
}
|
||||
}
|
||||
|
||||
static void check_lockout_mutex_init() {
|
||||
static void check_lockout_mutex_init(void) {
|
||||
// use known available lock - we only need it briefly
|
||||
uint32_t save = hw_claim_lock();
|
||||
if (!mutex_is_initialzed(&lockout_mutex)) {
|
||||
@ -259,4 +259,4 @@ bool multicore_lockout_end_timeout_us(uint64_t timeout_us) {
|
||||
|
||||
void multicore_lockout_end_blocking() {
|
||||
multicore_lockout_end_block_until(at_the_end_of_time);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user