Clarified hackrf_si5351c control logic
This commit is contained in:
@ -257,6 +257,24 @@ int main(int argc, char** argv) {
|
||||
}
|
||||
}
|
||||
|
||||
if(write && read) {
|
||||
fprintf(stderr, "Read and write options are mutually exclusive.\n");
|
||||
usage();
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
if(write && dump_config) {
|
||||
fprintf(stderr, "Config and write options are mutually exclusive.\n");
|
||||
usage();
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
if(!(write || read || dump_config)) {
|
||||
fprintf(stderr, "Specify read, write, or config option.\n");
|
||||
usage();
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
if(serial_number != NULL) {
|
||||
result = hackrf_open_by_serial(serial_number, &device);
|
||||
} else {
|
||||
@ -277,13 +295,17 @@ int main(int argc, char** argv) {
|
||||
if( result == HACKRF_SUCCESS ) {
|
||||
result = write_register(device, register_number, register_value);
|
||||
}
|
||||
} else if(read) {
|
||||
}
|
||||
|
||||
if(read) {
|
||||
if( register_number == REGISTER_INVALID ) {
|
||||
result = dump_registers(device);
|
||||
} else {
|
||||
result = dump_register(device, register_number);
|
||||
}
|
||||
} else if(dump_config) {
|
||||
}
|
||||
|
||||
if(dump_config) {
|
||||
dump_configuration(device);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user