[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Commit-gnuradio] r9995 - gnuradio/branches/features/cppdb/gnuradio-exam
From: |
trondeau |
Subject: |
[Commit-gnuradio] r9995 - gnuradio/branches/features/cppdb/gnuradio-examples/c++/usrp_test |
Date: |
Sat, 15 Nov 2008 14:22:12 -0700 (MST) |
Author: trondeau
Date: 2008-11-15 14:22:11 -0700 (Sat, 15 Nov 2008)
New Revision: 9995
Modified:
gnuradio/branches/features/cppdb/gnuradio-examples/c++/usrp_test/usrp_test_tx.cc
Log:
Working transmitter example. Tested with RFX2400, sides A and B (by changing
spec to (1,0) for side B).
Modified:
gnuradio/branches/features/cppdb/gnuradio-examples/c++/usrp_test/usrp_test_tx.cc
===================================================================
---
gnuradio/branches/features/cppdb/gnuradio-examples/c++/usrp_test/usrp_test_tx.cc
2008-11-15 00:23:27 UTC (rev 9994)
+++
gnuradio/branches/features/cppdb/gnuradio-examples/c++/usrp_test/usrp_test_tx.cc
2008-11-15 21:22:11 UTC (rev 9995)
@@ -44,7 +44,7 @@
subdev->freq_min(), subdev->freq_max());
unsigned int mux = usrp->determine_tx_mux_value(spec);
- printf("mux: %x\n", mux);
+ printf("mux: %#08x\n", mux);
usrp->set_mux(mux);
float input_rate = usrp->dac_freq() / usrp->interp_rate();
@@ -52,7 +52,9 @@
usrp_tune_result r;
double target_freq = freq;
- bool ok = usrp->tune(0, subdev, target_freq, &r);
+ bool ok = usrp->tune(subdev->which(), subdev, target_freq, &r);
+
+ subdev->set_enable(true);
printf("target_freq: %f\n", target_freq);
printf("ok: %s\n", ok ? "true" : "false");
@@ -62,8 +64,9 @@
printf("r.inverted: %d\n", r.inverted);
/* The rest */
- source = gr_make_sig_source_c(input_rate, GR_SIN_WAVE, 100e3, amp, 0);
-
+ printf("Amplitude: %f\n", amp);
+ source = gr_make_sig_source_c(input_rate, GR_SIN_WAVE, 1e3, amp);
+
connect(source, 0, usrp, 0);
}
@@ -78,7 +81,7 @@
usrp_subdev_spec spec(0,0); // specify the d'board side
int interp = 128; // set the intepolation rate
double freq = strtod(argv[1], NULL); // set the frequency
- float amp = 10; // set the amplutide
+ float amp = 5; // set the amplutide
usrp_test_tx_sptr top_block = make_usrp_test_tx(which, spec,
interp, freq, amp);
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Commit-gnuradio] r9995 - gnuradio/branches/features/cppdb/gnuradio-examples/c++/usrp_test,
trondeau <=