mirror of
https://github.com/rtlsdrblog/rtl-sdr-blog.git
synced 2024-11-10 04:37:37 +01:00
add -D direct sampling flag to rtl_tcp
This commit is contained in:
parent
8426cbe3f0
commit
65c8e96bb2
@ -1248,7 +1248,7 @@ int rtlsdr_set_offset_tuning(rtlsdr_dev_t *dev, int on)
|
||||
* specified bias tee support. Offset tuning is not used for
|
||||
*R820T devices so it is no problem.
|
||||
*/
|
||||
rtlsdr_set_gpio(dev, 0, on);
|
||||
rtlsdr_set_bias_tee(dev, on);
|
||||
return -2;
|
||||
}
|
||||
|
||||
|
@ -105,6 +105,7 @@ void usage(void)
|
||||
printf("\t[-d device index (default: 0)]\n");
|
||||
printf("\t[-P ppm_error (default: 0)]\n");
|
||||
printf("\t[-T enable bias-T on GPIO PIN 0 (works for rtl-sdr.com v3 dongles)]\n");
|
||||
printf("\t[-D enable direct sampling (default: off)]\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
@ -396,6 +397,7 @@ int main(int argc, char **argv)
|
||||
int dev_given = 0;
|
||||
int gain = 0;
|
||||
int ppm_error = 0;
|
||||
int direct_sampling = 0;
|
||||
struct llist *curelem,*prev;
|
||||
pthread_attr_t attr;
|
||||
void *status;
|
||||
@ -413,7 +415,7 @@ int main(int argc, char **argv)
|
||||
struct sigaction sigact, sigign;
|
||||
#endif
|
||||
|
||||
while ((opt = getopt(argc, argv, "a:p:f:g:s:b:n:d:P:T")) != -1) {
|
||||
while ((opt = getopt(argc, argv, "a:p:f:g:s:b:n:d:P:TD")) != -1) {
|
||||
switch (opt) {
|
||||
case 'd':
|
||||
dev_index = verbose_device_search(optarg);
|
||||
@ -446,6 +448,9 @@ int main(int argc, char **argv)
|
||||
case 'T':
|
||||
enable_biastee = 1;
|
||||
break;
|
||||
case 'D':
|
||||
direct_sampling = 1;
|
||||
break;
|
||||
default:
|
||||
usage();
|
||||
break;
|
||||
@ -482,6 +487,11 @@ int main(int argc, char **argv)
|
||||
SetConsoleCtrlHandler( (PHANDLER_ROUTINE) sighandler, TRUE );
|
||||
#endif
|
||||
|
||||
/* Set direct sampling */
|
||||
if (direct_sampling || frequency < 2800000) {
|
||||
verbose_direct_sampling(dev, 2);
|
||||
}
|
||||
|
||||
/* Set the tuner error */
|
||||
verbose_ppm_set(dev, ppm_error);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user