mirror of
https://github.com/greatscottgadgets/hackrf.git
synced 2026-03-21 06:43:03 +01:00
Add braces to all control statements without them.
This commit is contained in:
@@ -175,20 +175,24 @@ void print_clk_control(uint16_t clk_ctrl)
|
||||
{
|
||||
uint8_t clk_src, clk_pwr;
|
||||
printf("\tclock control = \n");
|
||||
if (clk_ctrl & SI5351C_CLK_POWERDOWN)
|
||||
if (clk_ctrl & SI5351C_CLK_POWERDOWN) {
|
||||
printf("\t\tPower Down\n");
|
||||
else
|
||||
} else {
|
||||
printf("\t\tPower Up\n");
|
||||
if (clk_ctrl & SI5351C_CLK_INT_MODE)
|
||||
}
|
||||
if (clk_ctrl & SI5351C_CLK_INT_MODE) {
|
||||
printf("\t\tInt Mode\n");
|
||||
else
|
||||
} else {
|
||||
printf("\t\tFrac Mode\n");
|
||||
if (clk_ctrl & SI5351C_CLK_PLL_SRC)
|
||||
}
|
||||
if (clk_ctrl & SI5351C_CLK_PLL_SRC) {
|
||||
printf("\t\tPLL src B\n");
|
||||
else
|
||||
} else {
|
||||
printf("\t\tPLL src A\n");
|
||||
if (clk_ctrl & SI5351C_CLK_INV)
|
||||
}
|
||||
if (clk_ctrl & SI5351C_CLK_INV) {
|
||||
printf("\t\tInverted\n");
|
||||
}
|
||||
clk_src = (clk_ctrl >> 2) & 0x3;
|
||||
switch (clk_src) {
|
||||
case 0:
|
||||
@@ -256,11 +260,12 @@ int si5351c_read_multisynth_config(hackrf_device* device, const uint_fast8_t ms_
|
||||
printf("\tp1 = %u\n", p1);
|
||||
printf("\tp2 = %u\n", p2);
|
||||
printf("\tp3 = %u\n", p3);
|
||||
if (p3)
|
||||
if (p3) {
|
||||
printf("\tOutput (800Mhz PLL): %#.10f Mhz\n",
|
||||
((double) 800 /
|
||||
(double) (((double) p1 * p3 + p2 + 512 * p3) / (double) (128 * p3))) /
|
||||
div_lut[r_div]);
|
||||
}
|
||||
} else {
|
||||
// MS6 and 7 are integer only
|
||||
unsigned int parms;
|
||||
@@ -278,9 +283,10 @@ int si5351c_read_multisynth_config(hackrf_device* device, const uint_fast8_t ms_
|
||||
(parameters[2] & 0x70) >> 4;
|
||||
parms = (ms_number == 6) ? parameters[0] : parameters[1];
|
||||
printf("\tp1_int = %u\n", parms);
|
||||
if (parms)
|
||||
if (parms) {
|
||||
printf("\tOutput (800Mhz PLL): %#.10f Mhz\n",
|
||||
(800.0f / parms) / div_lut[r_div]);
|
||||
}
|
||||
}
|
||||
printf("\toutput divider = %u\n", div_lut[r_div]);
|
||||
return HACKRF_SUCCESS;
|
||||
@@ -412,20 +418,22 @@ static const char* mode_name(uint32_t mode)
|
||||
{
|
||||
const char* mode_names[] = {"IDLE", "WAIT", "RX", "TX_START", "TX_RUN"};
|
||||
const uint32_t num_modes = sizeof(mode_names) / sizeof(mode_names[0]);
|
||||
if (mode < num_modes)
|
||||
if (mode < num_modes) {
|
||||
return mode_names[mode];
|
||||
else
|
||||
} else {
|
||||
return "UNKNOWN";
|
||||
}
|
||||
}
|
||||
|
||||
static const char* error_name(uint32_t error)
|
||||
{
|
||||
const char* error_names[] = {"NONE", "RX_TIMEOUT", "TX_TIMEOUT"};
|
||||
const uint32_t num_errors = sizeof(error_names) / sizeof(error_names[0]);
|
||||
if (error < num_errors)
|
||||
if (error < num_errors) {
|
||||
return error_names[error];
|
||||
else
|
||||
} else {
|
||||
return "UNKNOWN";
|
||||
}
|
||||
}
|
||||
|
||||
static void print_state(hackrf_m0_state* state)
|
||||
|
||||
Reference in New Issue
Block a user