Skip to content

Commit d4267de

Browse files
committed
Formatted with command "clang-format -i <file>"
1 parent 8550ac5 commit d4267de

10 files changed

Lines changed: 456 additions & 509 deletions

File tree

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/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/hackrf_usb/hackrf_usb.c

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -131,19 +131,18 @@ static usb_request_handler_fn vendor_request_handler[] = {
131131
usb_vendor_request_set_leds,
132132
usb_vendor_request_user_config_set_bias_t_opts,
133133

134-
usb_vendor_request_time_set_divisor_next_pps,
135-
usb_vendor_request_time_set_divisor_one_pps,
136-
usb_vendor_request_time_set_trig_delay_next_pps,
137-
usb_vendor_request_time_get_seconds_now,
138-
usb_vendor_request_time_set_seconds_now,
139-
usb_vendor_request_time_set_seconds_next_pps,
140-
usb_vendor_request_time_get_ticks_now,
141-
usb_vendor_request_time_set_ticks_now,
134+
usb_vendor_request_time_set_divisor_next_pps,
135+
usb_vendor_request_time_set_divisor_one_pps,
136+
usb_vendor_request_time_set_trig_delay_next_pps,
137+
usb_vendor_request_time_get_seconds_now,
138+
usb_vendor_request_time_set_seconds_now,
139+
usb_vendor_request_time_set_seconds_next_pps,
140+
usb_vendor_request_time_get_ticks_now,
141+
usb_vendor_request_time_set_ticks_now,
142142
usb_vendor_request_time_set_clk_freq,
143-
usb_vendor_request_time_set_mcu_clk_sync,
143+
usb_vendor_request_time_set_mcu_clk_sync,
144144

145-
NULL
146-
};
145+
NULL};
147146

148147
static const uint32_t vendor_request_handler_count =
149148
sizeof(vendor_request_handler) / sizeof(vendor_request_handler[0]);
@@ -259,7 +258,7 @@ int main(void)
259258
#if (defined HACKRF_ONE || defined RAD1O)
260259
enable_rf_power();
261260
#endif
262-
cpu_clock_init(CGU_SRC_XTAL,17);
261+
cpu_clock_init(CGU_SRC_XTAL, 17);
263262

264263
/* Wake the M0 */
265264
ipc_halt_m0();
@@ -313,7 +312,7 @@ int main(void)
313312
}
314313

315314
/* start time timer */
316-
time_timer_init();
315+
time_timer_init();
317316

318317
while (true) {
319318
transceiver_request_t request;

0 commit comments

Comments
 (0)