mirror of
https://github.com/greatscottgadgets/hackrf.git
synced 2026-03-03 05:55:18 +01:00
Always use void argument type for functions taking no arguments.
This commit is contained in:
@@ -73,17 +73,17 @@ __attribute__((used)) void hard_fault_handler_c(uint32_t* args)
|
||||
while (1) {}
|
||||
}
|
||||
|
||||
void mem_manage_handler()
|
||||
void mem_manage_handler(void)
|
||||
{
|
||||
while (1) {}
|
||||
}
|
||||
|
||||
void bus_fault_handler()
|
||||
void bus_fault_handler(void)
|
||||
{
|
||||
while (1) {}
|
||||
}
|
||||
|
||||
void usage_fault_handler()
|
||||
void usage_fault_handler(void)
|
||||
{
|
||||
while (1) {}
|
||||
}
|
||||
|
||||
@@ -76,8 +76,8 @@ void fpga_set_tx_nco_enable(fpga_driver_t* const drv, const bool enable);
|
||||
void fpga_set_tx_nco_pstep(fpga_driver_t* const drv, const uint8_t phase_increment);
|
||||
|
||||
bool fpga_image_load(unsigned int index);
|
||||
bool fpga_spi_selftest();
|
||||
bool fpga_sgpio_selftest();
|
||||
bool fpga_if_xcvr_selftest();
|
||||
bool fpga_spi_selftest(void);
|
||||
bool fpga_sgpio_selftest(void);
|
||||
bool fpga_if_xcvr_selftest(void);
|
||||
|
||||
#endif // __FPGA_H
|
||||
|
||||
@@ -50,7 +50,7 @@ static int rx_samples(const unsigned int num_samples, uint32_t max_cycles)
|
||||
return rc;
|
||||
}
|
||||
|
||||
bool fpga_spi_selftest()
|
||||
bool fpga_spi_selftest(void)
|
||||
{
|
||||
// Skip if FPGA configuration failed.
|
||||
if (selftest.fpga_image_load != PASSED) {
|
||||
@@ -81,7 +81,7 @@ static uint8_t lfsr_advance(uint8_t v)
|
||||
return (v << 1) | feedback;
|
||||
}
|
||||
|
||||
bool fpga_sgpio_selftest()
|
||||
bool fpga_sgpio_selftest(void)
|
||||
{
|
||||
bool timeout = false;
|
||||
|
||||
@@ -168,7 +168,7 @@ static bool in_range(int value, int expected, int error)
|
||||
return (value > min) && (value < max);
|
||||
}
|
||||
|
||||
bool fpga_if_xcvr_selftest()
|
||||
bool fpga_if_xcvr_selftest(void)
|
||||
{
|
||||
bool timeout = false;
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
|
||||
#include <libopencm3/lpc43xx/gpdma.h>
|
||||
|
||||
void gpdma_controller_enable()
|
||||
void gpdma_controller_enable(void)
|
||||
{
|
||||
GPDMA_CONFIG |= GPDMA_CONFIG_E(1);
|
||||
while ((GPDMA_CONFIG & GPDMA_CONFIG_E_MASK) == 0) {}
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
|
||||
#include <libopencm3/lpc43xx/gpdma.h>
|
||||
|
||||
void gpdma_controller_enable();
|
||||
void gpdma_controller_enable(void);
|
||||
|
||||
void gpdma_channel_enable(const uint_fast8_t channel);
|
||||
void gpdma_channel_disable(const uint_fast8_t channel);
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
|
||||
typedef const struct gpio_t* gpio_t;
|
||||
|
||||
void gpio_init();
|
||||
void gpio_init(void);
|
||||
void gpio_set(gpio_t gpio);
|
||||
void gpio_clear(gpio_t gpio);
|
||||
void gpio_toggle(gpio_t gpio);
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
void gpio_init()
|
||||
void gpio_init(void)
|
||||
{
|
||||
for (size_t i = 0; i < 8; i++) {
|
||||
GPIO_LPC_PORT(i)->dir = 0;
|
||||
|
||||
@@ -54,17 +54,17 @@ void ice40_spi_write(ice40_spi_driver_t* const drv, uint8_t r, uint16_t v)
|
||||
spi_bus_transfer(drv->bus, value, 3);
|
||||
}
|
||||
|
||||
static void spi_ssp1_wait_for_tx_fifo_not_full()
|
||||
static void spi_ssp1_wait_for_tx_fifo_not_full(void)
|
||||
{
|
||||
while ((SSP_SR(SSP1_BASE) & SSP_SR_TNF) == 0) {}
|
||||
}
|
||||
|
||||
static void spi_ssp1_wait_for_rx_fifo_not_empty()
|
||||
static void spi_ssp1_wait_for_rx_fifo_not_empty(void)
|
||||
{
|
||||
while ((SSP_SR(SSP1_BASE) & SSP_SR_RNE) == 0) {}
|
||||
}
|
||||
|
||||
static void spi_ssp1_wait_for_not_busy()
|
||||
static void spi_ssp1_wait_for_not_busy(void)
|
||||
{
|
||||
while (SSP_SR(SSP1_BASE) & SSP_SR_BSY) {}
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
* Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
int main()
|
||||
int main(void)
|
||||
{
|
||||
while (1) {}
|
||||
}
|
||||
|
||||
@@ -55,7 +55,7 @@ static uint32_t default_output = 0;
|
||||
* On Praline, instead, MS0/CLK1 (SCT_CLK) is configured to output its
|
||||
* clock (f=2 * sample clock) to the SCTimer.
|
||||
*/
|
||||
void operacake_sctimer_init()
|
||||
void operacake_sctimer_init(void)
|
||||
{
|
||||
// We start by resetting the SCTimer
|
||||
RESET_CTRL1 = RESET_CTRL1_SCT_RST;
|
||||
@@ -216,7 +216,7 @@ void operacake_sctimer_set_dwell_times(struct operacake_dwell_times* times, int
|
||||
SCT_CTRL &= ~SCT_CTRL_HALT_L(1);
|
||||
}
|
||||
|
||||
void operacake_sctimer_stop()
|
||||
void operacake_sctimer_stop(void)
|
||||
{
|
||||
// Halt timer
|
||||
SCT_CTRL |= SCT_CTRL_HALT_L(1);
|
||||
@@ -228,7 +228,7 @@ void operacake_sctimer_stop()
|
||||
* called by set_transceiver_mode so the HackRF starts capturing with the
|
||||
* same antenna selected each time.
|
||||
*/
|
||||
void operacake_sctimer_reset_state()
|
||||
void operacake_sctimer_reset_state(void)
|
||||
{
|
||||
SCT_CTRL |= SCT_CTRL_HALT_L(1);
|
||||
|
||||
|
||||
@@ -32,10 +32,10 @@ struct operacake_dwell_times {
|
||||
uint8_t port;
|
||||
};
|
||||
|
||||
void operacake_sctimer_init();
|
||||
void operacake_sctimer_init(void);
|
||||
void operacake_sctimer_enable(bool enable);
|
||||
void operacake_sctimer_set_dwell_times(struct operacake_dwell_times* times, int n);
|
||||
void operacake_sctimer_stop();
|
||||
void operacake_sctimer_reset_state();
|
||||
void operacake_sctimer_stop(void);
|
||||
void operacake_sctimer_reset_state(void);
|
||||
|
||||
#endif /* __OPERACAKE_SCTIMER_H */
|
||||
|
||||
@@ -70,7 +70,7 @@ static portapack_if_t portapack_if = {
|
||||
#define GPIO_DATA_SHIFT (8)
|
||||
static const uint32_t gpio_data_mask = 0xFFU << GPIO_DATA_SHIFT;
|
||||
|
||||
static void portapack_data_mask_set()
|
||||
static void portapack_data_mask_set(void)
|
||||
{
|
||||
portapack_if.gpio_port_data->mask = ~gpio_data_mask;
|
||||
}
|
||||
@@ -87,13 +87,13 @@ static void portapack_data_write_high(const uint32_t value)
|
||||
portapack_if.gpio_port_data->mpin = value;
|
||||
}
|
||||
|
||||
static void portapack_dir_read()
|
||||
static void portapack_dir_read(void)
|
||||
{
|
||||
portapack_if.gpio_port_data->dir &= ~gpio_data_mask;
|
||||
gpio_set(portapack_if.gpio_dir);
|
||||
}
|
||||
|
||||
static void portapack_dir_write()
|
||||
static void portapack_dir_write(void)
|
||||
{
|
||||
gpio_clear(portapack_if.gpio_dir);
|
||||
portapack_if.gpio_port_data->dir |= gpio_data_mask;
|
||||
@@ -105,32 +105,32 @@ static void portapack_dir_write()
|
||||
*/
|
||||
}
|
||||
|
||||
__attribute__((unused)) static void portapack_lcd_rd_assert()
|
||||
__attribute__((unused)) static void portapack_lcd_rd_assert(void)
|
||||
{
|
||||
gpio_clear(portapack_if.gpio_lcd_rdx);
|
||||
}
|
||||
|
||||
static void portapack_lcd_rd_deassert()
|
||||
static void portapack_lcd_rd_deassert(void)
|
||||
{
|
||||
gpio_set(portapack_if.gpio_lcd_rdx);
|
||||
}
|
||||
|
||||
static void portapack_lcd_wr_assert()
|
||||
static void portapack_lcd_wr_assert(void)
|
||||
{
|
||||
gpio_clear(portapack_if.gpio_lcd_wrx);
|
||||
}
|
||||
|
||||
static void portapack_lcd_wr_deassert()
|
||||
static void portapack_lcd_wr_deassert(void)
|
||||
{
|
||||
gpio_set(portapack_if.gpio_lcd_wrx);
|
||||
}
|
||||
|
||||
static void portapack_io_stb_assert()
|
||||
static void portapack_io_stb_assert(void)
|
||||
{
|
||||
gpio_clear(portapack_if.gpio_io_stbx);
|
||||
}
|
||||
|
||||
static void portapack_io_stb_deassert()
|
||||
static void portapack_io_stb_deassert(void)
|
||||
{
|
||||
gpio_set(portapack_if.gpio_io_stbx);
|
||||
}
|
||||
@@ -188,7 +188,7 @@ static void portapack_io_write(const bool address, const uint_fast16_t value)
|
||||
portapack_io_stb_deassert();
|
||||
}
|
||||
|
||||
static void portapack_if_init()
|
||||
static void portapack_if_init(void)
|
||||
{
|
||||
portapack_data_mask_set();
|
||||
portapack_data_write_high(0);
|
||||
@@ -242,7 +242,7 @@ static void portapack_lcd_data_write_command_and_data(
|
||||
}
|
||||
}
|
||||
|
||||
static void portapack_lcd_sleep_out()
|
||||
static void portapack_lcd_sleep_out(void)
|
||||
{
|
||||
const uint8_t cmd_11[] = {};
|
||||
portapack_lcd_data_write_command_and_data(0x11, cmd_11, ARRAY_SIZEOF(cmd_11));
|
||||
@@ -252,13 +252,13 @@ static void portapack_lcd_sleep_out()
|
||||
portapack_sleep_milliseconds(120);
|
||||
}
|
||||
|
||||
static void portapack_lcd_display_on()
|
||||
static void portapack_lcd_display_on(void)
|
||||
{
|
||||
const uint8_t cmd_29[] = {};
|
||||
portapack_lcd_data_write_command_and_data(0x29, cmd_29, ARRAY_SIZEOF(cmd_29));
|
||||
}
|
||||
|
||||
static void portapack_lcd_ramwr_start()
|
||||
static void portapack_lcd_ramwr_start(void)
|
||||
{
|
||||
const uint8_t cmd_2c[] = {};
|
||||
portapack_lcd_data_write_command_and_data(0x2c, cmd_2c, ARRAY_SIZEOF(cmd_2c));
|
||||
@@ -306,13 +306,13 @@ static void portapack_lcd_write_pixels_color(const ui_color_t c, size_t n)
|
||||
}
|
||||
}
|
||||
|
||||
static void portapack_lcd_wake()
|
||||
static void portapack_lcd_wake(void)
|
||||
{
|
||||
portapack_lcd_sleep_out();
|
||||
portapack_lcd_display_on();
|
||||
}
|
||||
|
||||
static void portapack_lcd_reset()
|
||||
static void portapack_lcd_reset(void)
|
||||
{
|
||||
portapack_lcd_reset_state(false);
|
||||
portapack_sleep_milliseconds(1);
|
||||
@@ -322,7 +322,7 @@ static void portapack_lcd_reset()
|
||||
portapack_sleep_milliseconds(120);
|
||||
}
|
||||
|
||||
static void portapack_lcd_init()
|
||||
static void portapack_lcd_init(void)
|
||||
{
|
||||
// LCDs are configured for IM[2:0] = 001
|
||||
// 8080-I system, 16-bit parallel bus
|
||||
|
||||
@@ -12,7 +12,7 @@ static const uint8_t* data;
|
||||
static uint8_t charBuf[MAXCHR];
|
||||
|
||||
// Get next nibble
|
||||
static uint8_t gnn()
|
||||
static uint8_t gnn(void)
|
||||
{
|
||||
static uint8_t byte;
|
||||
uint8_t val;
|
||||
|
||||
@@ -30,7 +30,7 @@ static uint8_t lcdBuffer[RESX * RESY];
|
||||
|
||||
static bool isTurned;
|
||||
|
||||
static void select()
|
||||
static void select(void)
|
||||
{
|
||||
/*
|
||||
* The LCD requires 9-Bit frames
|
||||
@@ -58,7 +58,7 @@ static void select()
|
||||
gpio_clear(&gpio_lcd_cs);
|
||||
}
|
||||
|
||||
static void deselect()
|
||||
static void deselect(void)
|
||||
{
|
||||
gpio_set(&gpio_lcd_cs);
|
||||
}
|
||||
|
||||
@@ -489,7 +489,7 @@ static void portapack_radio_path_item_update(
|
||||
static rf_path_direction_t portapack_direction = RF_PATH_DIRECTION_OFF;
|
||||
static bool portapack_lna_on = false;
|
||||
|
||||
static void portapack_radio_path_redraw()
|
||||
static void portapack_radio_path_redraw(void)
|
||||
{
|
||||
for (size_t i = 0; i < ARRAY_SIZEOF(radio_draw_list); i++) {
|
||||
portapack_draw_radio_path_item(i);
|
||||
@@ -736,7 +736,7 @@ const hackrf_ui_t portapack_hackrf_ui = {
|
||||
&portapack_ui_operacake_gpio_compatible,
|
||||
};
|
||||
|
||||
const hackrf_ui_t* portapack_hackrf_ui_init()
|
||||
const hackrf_ui_t* portapack_hackrf_ui_init(void)
|
||||
{
|
||||
if (portapack()) {
|
||||
return &portapack_hackrf_ui;
|
||||
|
||||
@@ -25,6 +25,6 @@
|
||||
|
||||
#include "hackrf_ui.h"
|
||||
|
||||
const hackrf_ui_t* portapack_hackrf_ui_init() __attribute__((weak));
|
||||
const hackrf_ui_t* portapack_hackrf_ui_init(void) __attribute__((weak));
|
||||
|
||||
#endif /*__UI_PORTAPACK_H__*/
|
||||
|
||||
@@ -67,7 +67,7 @@ static uint_fast8_t usb_endpoint_number(const uint_fast8_t endpoint_address)
|
||||
return (endpoint_address & 0xF);
|
||||
}
|
||||
|
||||
void usb_peripheral_reset()
|
||||
void usb_peripheral_reset(void)
|
||||
{
|
||||
RESET_CTRL0 = RESET_CTRL0_USB0_RST;
|
||||
RESET_CTRL0 = 0;
|
||||
@@ -75,7 +75,7 @@ void usb_peripheral_reset()
|
||||
while ((RESET_ACTIVE_STATUS0 & RESET_CTRL0_USB0_RST) == 0) {}
|
||||
}
|
||||
|
||||
void usb_phy_enable()
|
||||
void usb_phy_enable(void)
|
||||
{
|
||||
CREG_CREG0 &= ~CREG_CREG0_USB0PHY;
|
||||
}
|
||||
@@ -634,7 +634,7 @@ static void usb_check_for_transfer_events(void)
|
||||
}
|
||||
}
|
||||
|
||||
void usb0_isr()
|
||||
void usb0_isr(void)
|
||||
{
|
||||
const uint32_t status = usb_get_status();
|
||||
|
||||
|
||||
@@ -239,7 +239,7 @@ static bool cpld_jtag_sram_load(jtag_t* const jtag)
|
||||
}
|
||||
#endif
|
||||
|
||||
static void m0_rom_to_ram()
|
||||
static void m0_rom_to_ram(void)
|
||||
{
|
||||
uint32_t* dest = &__ram_m0_start__;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user