Skip to content

Commit 0db6a4e

Browse files
committed
Formatted with hackrf clang 14 style
1 parent 0d8303e commit 0db6a4e

20 files changed

Lines changed: 478 additions & 525 deletions

firmware/common/clkin.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,9 @@ void clkin_detect_init(void)
7373

7474
reset.first_tcr = TIMER_TCR_CEN | TIMER_TCR_CRST;
7575
reset.second_tcr = TIMER_TCR_CEN;
76-
timer_dma_lli.src = (uint32_t) & (reset);
77-
timer_dma_lli.dest = (uint32_t) & (TIMER2_TCR);
78-
timer_dma_lli.next_lli = (uint32_t) & (timer_dma_lli);
76+
timer_dma_lli.src = (uint32_t) &(reset);
77+
timer_dma_lli.dest = (uint32_t) &(TIMER2_TCR);
78+
timer_dma_lli.next_lli = (uint32_t) &(timer_dma_lli);
7979
timer_dma_lli.control = GPDMA_CCONTROL_TRANSFERSIZE(2) |
8080
GPDMA_CCONTROL_SBSIZE(0) // 1
8181
| GPDMA_CCONTROL_DBSIZE(0) // 1

firmware/common/gpio_lpc.h

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ typedef struct gpio_port_t {
4545
uint32_t _reserved4[31];
4646
volatile uint32_t clr; /* +0x280 */
4747
uint32_t _reserved5[31];
48-
volatile uint32_t not ; /* +0x300 */
48+
volatile uint32_t not; /* +0x300 */
4949
} gpio_port_t;
5050

5151
struct gpio_t {
@@ -60,9 +60,10 @@ struct gpio_t {
6060
#define GPIO_LPC_PORT_OFFSET (0x2000)
6161

6262
#define GPIO_LPC_PORT(_n) \
63-
((gpio_port_t*) ((GPIO_LPC_BASE + GPIO_LPC_PORT_OFFSET) + (_n) *4))
64-
#define GPIO_LPC_W(_port_num, _pin_num) \
65-
(volatile uint32_t*) ((GPIO_LPC_BASE + GPIO_LPC_W_OFFSET) + ((_port_num) *0x80) + ((_pin_num) *4))
63+
((gpio_port_t*) ((GPIO_LPC_BASE + GPIO_LPC_PORT_OFFSET) + (_n) * 4))
64+
#define GPIO_LPC_W(_port_num, _pin_num) \
65+
(volatile uint32_t*) ((GPIO_LPC_BASE + GPIO_LPC_W_OFFSET) + \
66+
((_port_num) * 0x80) + ((_pin_num) * 4))
6667

6768
// clang-format off
6869
#define GPIO(_port_num, _pin_num) { \

firmware/common/hackrf_core.c

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -540,7 +540,7 @@ Configure PLL1 (Main MCU Clock) to max speed (204MHz).
540540
Note: PLL1 clock is used by M4/M0 core, Peripheral, APB1.
541541
This function shall be called after cpu_clock_init().
542542
*/
543-
void cpu_clock_pll1_max_speed(uint8_t clock_source,uint8_t msel)
543+
void cpu_clock_pll1_max_speed(uint8_t clock_source, uint8_t msel)
544544
{
545545
uint32_t reg_val;
546546

@@ -606,7 +606,7 @@ void cpu_clock_pll1_max_speed(uint8_t clock_source,uint8_t msel)
606606

607607
/* clock startup for LPC4320 configure PLL1 to max speed (204MHz).
608608
Note: PLL1 clock is used by M4/M0 core, Peripheral, APB1. */
609-
void cpu_clock_init(uint8_t clock_source,uint8_t msel)
609+
void cpu_clock_init(uint8_t clock_source, uint8_t msel)
610610
{
611611
/* use IRC as clock source for APB1 (including I2C0) */
612612
CGU_BASE_APB1_CLK = CGU_BASE_APB1_CLK_CLK_SEL(CGU_SRC_IRC);
@@ -696,7 +696,7 @@ void cpu_clock_init(uint8_t clock_source,uint8_t msel)
696696
/* set xtal oscillator to low frequency mode */
697697
CGU_XTAL_OSC_CTRL &= ~CGU_XTAL_OSC_CTRL_HF_MASK;
698698

699-
cpu_clock_pll1_max_speed(clock_source,msel);
699+
cpu_clock_pll1_max_speed(clock_source, msel);
700700

701701
/* use XTAL_OSC as clock source for APB1 */
702702
CGU_BASE_APB1_CLK =
@@ -881,10 +881,10 @@ void pin_setup(void)
881881
* LPC43xx pull-up and pull-down resistors are approximately 53K.
882882
*/
883883

884-
/* configure pin as TIMER 3 MATCH 0 output: 1pps out */
885-
scu_pinmux(SCU_PINMUX_PPS1, SCU_GPIO_PDN | SCU_CONF_FUNCTION6);
886-
/* configure pin as TIMER 3 MATCH 1 output: sampling trigger out */
887-
scu_pinmux(SCU_PINMUX_SAMP_TRIGGER, SCU_GPIO_PDN | SCU_CONF_FUNCTION6);
884+
/* configure pin as TIMER 3 MATCH 0 output: 1pps out */
885+
scu_pinmux(SCU_PINMUX_PPS1, SCU_GPIO_PDN | SCU_CONF_FUNCTION6);
886+
/* configure pin as TIMER 3 MATCH 1 output: sampling trigger out */
887+
scu_pinmux(SCU_PINMUX_SAMP_TRIGGER, SCU_GPIO_PDN | SCU_CONF_FUNCTION6);
888888

889889
#ifdef HACKRF_ONE
890890
scu_pinmux(SCU_PINMUX_PP_TMS, SCU_GPIO_PUP | SCU_CONF_FUNCTION0);
@@ -976,7 +976,6 @@ void pin_setup(void)
976976
else
977977
scu_pinmux(SCU_PINMUX_GP_CLKIN_NOTR9, SCU_CLK_IN | SCU_CONF_FUNCTION1);
978978

979-
980979
sgpio_configure_pin_functions(&sgpio_config);
981980
}
982981

firmware/common/hackrf_core.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,11 @@ extern "C" {
6565
#define SCU_PINMUX_BOOT3 (P2_9) /* GPIO1[10] on P2_9 */
6666
#endif
6767

68-
#define SCU_PINMUX_PP_LCD_TE (P2_3) /* GPIO5[3] on P2_3 */
69-
#define SCU_PINMUX_PPS1 (P2_3) /* T3_MAT0 on P2_3, cpu pin 87 */
68+
#define SCU_PINMUX_PP_LCD_TE (P2_3) /* GPIO5[3] on P2_3 */
69+
#define SCU_PINMUX_PPS1 (P2_3) /* T3_MAT0 on P2_3, cpu pin 87 */
7070

71-
#define SCU_PINMUX_PP_LCD_RDX (P2_4) /* GPIO5[4] on P2_4 */
72-
#define SCU_PINMUX_SAMP_TRIGGER (P2_4) /* T3_MAT1 on P2_4, cpu pin 88 */
71+
#define SCU_PINMUX_PP_LCD_RDX (P2_4) /* GPIO5[4] on P2_4 */
72+
#define SCU_PINMUX_SAMP_TRIGGER (P2_4) /* T3_MAT1 on P2_4, cpu pin 88 */
7373

7474
#define SCU_PINMUX_PP_UNUSED (P2_8) /* GPIO5[7] on P2_8 */
7575
#define SCU_PINMUX_PP_LCD_WRX (P2_9) /* GPIO1[10] on P2_9 */
@@ -236,7 +236,7 @@ extern "C" {
236236

237237
#define SCU_PINMUX_ISP (P2_7) /* GPIO0[7] */
238238

239-
#define SCU_PINMUX_GP_CLKIN_R9 (P4_7)
239+
#define SCU_PINMUX_GP_CLKIN_R9 (P4_7)
240240
#define SCU_PINMUX_GP_CLKIN_NOTR9 (PF_4)
241241

242242
/* HackRF One r9 */
@@ -323,7 +323,7 @@ void hw_sync_enable(const hw_sync_mode_t hw_sync_mode);
323323

324324
void halt_and_flash(const uint32_t duration);
325325

326-
void cpu_clock_pll1_max_speed(uint8_t clock_source,uint8_t msel);
326+
void cpu_clock_pll1_max_speed(uint8_t clock_source, uint8_t msel);
327327

328328
#ifdef __cplusplus
329329
}

firmware/common/rad1o/render.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ int rad1o_DoChar(int sx, int sy, int c)
108108

109109
} while (0);
110110

111-
#define xy_(x, y) ((x < 0 || y < 0 || x >= RESX || y >= RESY) ? 0 : (y) *RESX + (x))
111+
#define xy_(x, y) ((x < 0 || y < 0 || x >= RESX || y >= RESY) ? 0 : (y) * RESX + (x))
112112
#define gPx(x, y) (data[x * height + (height - y / 8 - 1)] & (1 << (y % 8)))
113113

114114
int x = 0;

firmware/common/rom_iap.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ typedef void (*IAP_t)(uint32_t[], uint32_t[]);
3636
typedef struct {
3737
const IAP_t IAP; /* If equal to 0x12345678 IAP not implemented */
3838
/* Other TBD */
39-
} * pENTRY_ROM_API_t;
39+
}* pENTRY_ROM_API_t;
4040

4141
#define pROM_API ((pENTRY_ROM_API_t) ROM_IAP_ADDR)
4242

firmware/common/sct.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2310,7 +2310,7 @@ EV[0:15]_CTRL[MATCHMEM, DIRECTION]
23102310
/* -- SCT_OUTn_SETm: A 1 in bit m selects event m to set output n (or clear it
23112311
* if SETCLRn = 0x1 or 0x2) event 0 = bit 0, event 1 = bit 1,..., event 15 =
23122312
* bit 15. */
2313-
#define SCT_OUTn_SETm(n, m) (((n) &1) << (m))
2313+
#define SCT_OUTn_SETm(n, m) (((n) & 1) << (m))
23142314

23152315
/* --- SCT_OUT0_CLR -------------------------------------- */
23162316
#define SCT_OUT0_CLR MMIO32(SCT_BASE + 0x504)
@@ -2363,4 +2363,4 @@ EV[0:15]_CTRL[MATCHMEM, DIRECTION]
23632363
/* -- SCT_OUTn_CLR_CLRm: A 1 in bit m selects event m to clear output n (or set
23642364
* it if SETCLRn = 0x1 or 0x2) event 0 = bit 0, event 1 = bit 1,..., event 15 =
23652365
* bit 15. */
2366-
#define SCT_OUTn_CLRm(n, m) (((n) &1) << (m))
2366+
#define SCT_OUTn_CLRm(n, m) (((n) & 1) << (m))

firmware/common/si5351c.c

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -229,21 +229,19 @@ void si5351c_configure_clock_control(
229229

230230
if (mcu_clk_sync && detected_platform() != BOARD_ID_HACKRF1_R9) {
231231
clkout_ctrl |= SI5351C_CLK_SRC(SI5351C_CLK_SRC_MULTISYNTH_0_4);
232-
si5351c_configure_multisynth(drv,3,80 * 128 - 512,0,0,1);
233-
}
234-
else {
232+
si5351c_configure_multisynth(drv, 3, 80 * 128 - 512, 0, 0, 1);
233+
} else {
235234
clkout_ctrl |= SI5351C_CLK_SRC(SI5351C_CLK_SRC_MULTISYNTH_SELF);
236235
}
237-
}
238-
else {
236+
} else {
239237
clkout_ctrl = SI5351C_CLK_POWERDOWN | SI5351C_CLK_INT_MODE;
240238
}
241239

242240
/* Clock to CPU is deactivated as it is not used and creates noise */
243241
/* External clock output is kept in current state */
244242
uint8_t data[] = {
245243
16,
246-
SI5351C_CLK_PLL_SRC(pll) |
244+
SI5351C_CLK_PLL_SRC(pll) |
247245
SI5351C_CLK_SRC(SI5351C_CLK_SRC_MULTISYNTH_SELF) |
248246
SI5351C_CLK_IDRV(SI5351C_CLK_IDRV_8MA),
249247
SI5351C_CLK_INT_MODE | SI5351C_CLK_PLL_SRC(pll) |
@@ -266,16 +264,15 @@ void si5351c_configure_clock_control(
266264
if (mcu_clk_sync) {
267265
data[1] |= SI5351C_CLK_INT_MODE;
268266
data[6] |= SI5351C_CLK_SRC(SI5351C_CLK_SRC_MULTISYNTH_0_4);
269-
}
270-
else {
267+
} else {
271268
data[1] |= SI5351C_CLK_FRAC_MODE;
272269
data[6] |= SI5351C_CLK_SRC(SI5351C_CLK_SRC_MULTISYNTH_SELF);
273270
}
274271
if (detected_platform() == BOARD_ID_HACKRF1_R9) {
275272
data[1] = SI5351C_CLK_INT_MODE | SI5351C_CLK_PLL_SRC_A |
276273
SI5351C_CLK_SRC(SI5351C_CLK_SRC_MULTISYNTH_SELF) |
277274
SI5351C_CLK_IDRV(SI5351C_CLK_IDRV_6MA);
278-
data[2] = SI5351C_CLK_PLL_SRC_A |
275+
data[2] = SI5351C_CLK_PLL_SRC_A |
279276
SI5351C_CLK_SRC(SI5351C_CLK_SRC_MULTISYNTH_SELF) |
280277
SI5351C_CLK_IDRV(SI5351C_CLK_IDRV_4MA);
281278
data[3] = clkout_ctrl;
@@ -409,8 +406,7 @@ void si5351c_mcu_clk_sync(si5351c_driver_t* const drv, uint8_t enable)
409406
{
410407
mcu_clk_sync = (enable > 0);
411408

412-
si5351c_clkout_enable(drv,enable);
413-
409+
si5351c_clkout_enable(drv, enable);
414410
}
415411

416412
void si5351c_init(si5351c_driver_t* const drv)

firmware/common/si5351c.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ void si5351c_write(
104104
const size_t data_count);
105105
void si5351c_clkout_enable(si5351c_driver_t* const drv, uint8_t enable);
106106
void si5351c_mcu_clk_enable(uint8_t enable);
107-
void si5351c_mcu_clk_sync(si5351c_driver_t* const drv,uint8_t enable);
107+
void si5351c_mcu_clk_sync(si5351c_driver_t* const drv, uint8_t enable);
108108
void si5351c_init(si5351c_driver_t* const drv);
109109

110110
#ifdef __cplusplus

firmware/common/ui_rad1o.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -272,8 +272,8 @@ static void rad1o_ui_set_bb_tx_vga_gain(const uint32_t gain_db)
272272
ui_update();
273273
}
274274

275-
static void rad1o_ui_set_first_if_frequency(const uint64_t frequency
276-
__attribute__((unused)))
275+
static void rad1o_ui_set_first_if_frequency(
276+
const uint64_t frequency __attribute__((unused)))
277277
{
278278
// Not implemented
279279
}

0 commit comments

Comments
 (0)