diff --git a/firmware/common/cpld_xc2c.c b/firmware/common/cpld_xc2c.c index 4806fe43..82833ffa 100644 --- a/firmware/common/cpld_xc2c.c +++ b/firmware/common/cpld_xc2c.c @@ -26,6 +26,7 @@ #include #include +// clang-format off typedef enum { CPLD_XC2C_IR_INTEST = 0b00000010, CPLD_XC2C_IR_BYPASS = 0b11111111, @@ -52,6 +53,7 @@ typedef enum { CPLD_XC2C_IR_STCTEST = 0b00010110, CPLD_XC2C_IR_ISC_NOOP = 0b11100000, } cpld_xc2c_ir_t; +// clang-format on static bool cpld_xc2c_jtag_clock(const jtag_t* const jtag, const uint32_t tms, const uint32_t tdi) { // 8 ns TMS/TDI to TCK setup diff --git a/firmware/common/hackrf_core.c b/firmware/common/hackrf_core.c index 40cbc287..cdb0c468 100644 --- a/firmware/common/hackrf_core.c +++ b/firmware/common/hackrf_core.c @@ -56,6 +56,7 @@ static struct gpio_t gpio_led[] = { #endif }; +// clang-format off static struct gpio_t gpio_1v8_enable = GPIO(3, 6); /* MAX2837 GPIO (XCVR_CTL) PinMux */ @@ -135,6 +136,7 @@ static struct gpio_t gpio_cpld_pp_tdo = GPIO(1, 8); static struct gpio_t gpio_hw_sync_enable = GPIO(5,12); static struct gpio_t gpio_rx_q_invert = GPIO(0, 13); +// clang-format on i2c_bus_t i2c0 = { .obj = (void*)I2C0_BASE, @@ -521,6 +523,7 @@ static void cpu_clock_pll1_max_speed(void) /* 5. Reconfigure PLL1 to produce the final output frequency, with the * crystal oscillator as clock source. */ reg_val = CGU_PLL1_CTRL; + // clang-format off reg_val &= ~( CGU_PLL1_CTRL_CLK_SEL_MASK | CGU_PLL1_CTRL_PD_MASK | CGU_PLL1_CTRL_FBSEL_MASK | @@ -537,6 +540,7 @@ static void cpu_clock_pll1_max_speed(void) CGU_PLL1_CTRL_MSEL(16) | CGU_PLL1_CTRL_FBSEL(0) | CGU_PLL1_CTRL_DIRECT(1); + // clang-format on CGU_PLL1_CTRL = reg_val; /* 6. Wait for PLL1 to lock. */ diff --git a/firmware/common/hackrf_ui.c b/firmware/common/hackrf_ui.c index 02ec0146..a0677f80 100644 --- a/firmware/common/hackrf_ui.c +++ b/firmware/common/hackrf_ui.c @@ -29,6 +29,7 @@ #define UNUSED(x) (void)(x) /* Stub functions for null UI function table */ +// clang-format off void hackrf_ui_init_null(void) { } void hackrf_ui_deinit_null(void) { } void hackrf_ui_set_frequency_null(uint64_t frequency) { UNUSED(frequency); } @@ -45,6 +46,7 @@ void hackrf_ui_set_antenna_bias_null(bool antenna_bias) { UNUSED(antenna_bias); void hackrf_ui_set_clock_source_null(clock_source_t source) { UNUSED(source); } void hackrf_ui_set_transceiver_mode_null(transceiver_mode_t mode) { UNUSED(mode); } bool hackrf_ui_operacake_gpio_compatible_null(void) { return true; } +// clang-format on /* Null UI function table, used if there's no hardware UI detected. Eliminates the * need to check for null UI before calling a function in the table. diff --git a/firmware/common/max2837.c b/firmware/common/max2837.c index 2e853598..c7887fb0 100644 --- a/firmware/common/max2837.c +++ b/firmware/common/max2837.c @@ -259,6 +259,7 @@ typedef struct { uint32_t ft; } max2837_ft_t; +// clang-format off static const max2837_ft_t max2837_ft[] = { { 1750000, MAX2837_FT_1_75M }, { 2500000, MAX2837_FT_2_5M }, @@ -278,6 +279,7 @@ static const max2837_ft_t max2837_ft[] = { { 28000000, MAX2837_FT_28M }, { 0, 0 }, }; +//clang-format on uint32_t max2837_set_lpf_bandwidth(max2837_driver_t* const drv, const uint32_t bandwidth_hz) { const max2837_ft_t* p = max2837_ft; diff --git a/firmware/common/mixer.c b/firmware/common/mixer.c index 6d2b5870..53a18933 100644 --- a/firmware/common/mixer.c +++ b/firmware/common/mixer.c @@ -5,6 +5,7 @@ #include "gpio_lpc.h" /* RFFC5071 GPIO serial interface PinMux */ +// clang-format off #if (defined JAWBREAKER || defined HACKRF_ONE) static struct gpio_t gpio_rffc5072_select = GPIO(2, 13); static struct gpio_t gpio_rffc5072_clock = GPIO(5, 6); @@ -19,6 +20,7 @@ static struct gpio_t gpio_vco_le = GPIO(2, 14); static struct gpio_t gpio_vco_mux = GPIO(5, 25); static struct gpio_t gpio_synt_rfout_en = GPIO(3, 5); #endif +// clang-format on #if (defined JAWBREAKER || defined HACKRF_ONE) const rffc5071_spi_config_t rffc5071_spi_config = { diff --git a/firmware/common/portapack.c b/firmware/common/portapack.c index 0a2edbae..44c617ce 100644 --- a/firmware/common/portapack.c +++ b/firmware/common/portapack.c @@ -31,6 +31,7 @@ static void portapack_sleep_milliseconds(const uint32_t milliseconds) { delay(milliseconds * 40800); } +// clang-format off static struct gpio_t gpio_io_stbx = GPIO(5, 0); /* P2_0 */ static struct gpio_t gpio_addr = GPIO(5, 1); /* P2_1 */ __attribute__((unused)) @@ -40,6 +41,7 @@ static struct gpio_t gpio_unused = GPIO(5, 7); /* P2_8 */ static struct gpio_t gpio_lcd_rdx = GPIO(5, 4); /* P2_4 */ static struct gpio_t gpio_lcd_wrx = GPIO(1, 10); /* P2_9 */ static struct gpio_t gpio_dir = GPIO(1, 13); /* P2_13 */ +// clang-format on typedef struct portapack_if_t { gpio_t gpio_dir; diff --git a/firmware/common/rf_path.c b/firmware/common/rf_path.c index 6394726b..514fec91 100644 --- a/firmware/common/rf_path.c +++ b/firmware/common/rf_path.c @@ -240,6 +240,7 @@ static void switchctrl_set(rf_path_t* const rf_path, const uint8_t gpo) { void rf_path_pin_setup(rf_path_t* const rf_path) { #ifdef HACKRF_ONE /* Configure RF switch control signals */ + // clang-format off scu_pinmux(SCU_HP, SCU_GPIO_FAST | SCU_CONF_FUNCTION0); scu_pinmux(SCU_LP, SCU_GPIO_FAST | SCU_CONF_FUNCTION0); scu_pinmux(SCU_TX_MIX_BP, SCU_GPIO_FAST | SCU_CONF_FUNCTION0); @@ -253,6 +254,7 @@ void rf_path_pin_setup(rf_path_t* const rf_path) { scu_pinmux(SCU_AMP_BYPASS, SCU_GPIO_FAST | SCU_CONF_FUNCTION0); scu_pinmux(SCU_RX_AMP, SCU_GPIO_FAST | SCU_CONF_FUNCTION0); scu_pinmux(SCU_NO_RX_AMP_PWR, SCU_GPIO_FAST | SCU_CONF_FUNCTION0); + // clang-format on /* Configure RF power supply (VAA) switch */ scu_pinmux(SCU_NO_VAA_ENABLE, SCU_GPIO_FAST | SCU_CONF_FUNCTION0); @@ -279,6 +281,7 @@ void rf_path_pin_setup(rf_path_t* const rf_path) { switchctrl_set(rf_path, SWITCHCTRL_AMP_BYPASS | SWITCHCTRL_MIX_BYPASS); #elif RAD1O /* Configure RF switch control signals */ + // clang-format off scu_pinmux(SCU_BY_AMP, SCU_GPIO_FAST | SCU_CONF_FUNCTION0); scu_pinmux(SCU_BY_AMP_N, SCU_GPIO_FAST | SCU_CONF_FUNCTION4); scu_pinmux(SCU_TX_RX, SCU_GPIO_FAST | SCU_CONF_FUNCTION0); @@ -290,6 +293,7 @@ void rf_path_pin_setup(rf_path_t* const rf_path) { scu_pinmux(SCU_TX_AMP, SCU_GPIO_FAST | SCU_CONF_FUNCTION0); scu_pinmux(SCU_RX_LNA, SCU_GPIO_FAST | SCU_CONF_FUNCTION4); scu_pinmux(SCU_MIXER_EN, SCU_GPIO_FAST | SCU_CONF_FUNCTION4); + // clang-format on /* Configure RF power supply (VAA) switch */ scu_pinmux(SCU_VAA_ENABLE, SCU_GPIO_FAST | SCU_CONF_FUNCTION0); diff --git a/firmware/common/rom_iap.h b/firmware/common/rom_iap.h index 0f487586..642f0425 100644 --- a/firmware/common/rom_iap.h +++ b/firmware/common/rom_iap.h @@ -63,6 +63,7 @@ typedef enum { } iap_cmd_code_t; /* ISP/IAP Return Code */ +// clang-format off typedef enum { CMD_SUCCESS = 0x00000000, /* CMD_SUCCESS Command is executed successfully. @@ -94,6 +95,7 @@ typedef enum /* Special Error */ ERROR_IAP_NOT_IMPLEMENTED = 0x00000100 /* IAP is not implemented in this part */ } isp_iap_ret_code_t; +// clang-format on typedef struct { diff --git a/firmware/hackrf_usb/usb_descriptor.c b/firmware/hackrf_usb/usb_descriptor.c index 92bcb798..f37718d3 100644 --- a/firmware/hackrf_usb/usb_descriptor.c +++ b/firmware/hackrf_usb/usb_descriptor.c @@ -159,6 +159,7 @@ uint8_t usb_descriptor_string_languages[] = { USB_WORD(USB_STRING_LANGID), // wLANGID }; +// clang-format off uint8_t usb_descriptor_string_manufacturer[] = { 40, // bLength USB_DESCRIPTOR_TYPE_STRING, // bDescriptorType