Advertisement
Guest User

Untitled

a guest
Nov 3rd, 2014
2,135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.41 KB | None | 0 0
  1. --- bladeRFDevice.cpp (revision 387)
  2. +++ bladeRFDevice.cpp (working copy)
  3. @@ -35,7 +35,6 @@
  4.  
  5. #include <Logger.h>
  6.  
  7. -
  8. #define MIN_OVERSAMPLING 4
  9.  
  10. #define HEALTH_BAD 10
  11. @@ -128,7 +127,36 @@
  12. << "." << ver.patch << " (" << ver.describe << ")";
  13.  
  14. uint32_t val = 0;
  15. - bladerf_config_gpio_read(bdev, &val);
  16. +
  17. + status = bladerf_sync_config(bdev,
  18. + BLADERF_MODULE_RX,
  19. + BLADERF_FORMAT_SC16_Q11,
  20. + DEFAULT_STREAM_RX_BUFFERS,
  21. + DEFAULT_STREAM_SAMPLES,
  22. + DEFAULT_STREAM_RX_XFERS,
  23. + DEFAULT_STREAM_TIMEOUT
  24. + );
  25. +
  26. + if (status < 0) {
  27. + LOG(CRIT) << "Failed to intialize RX sync handle: " << bladerf_strerror(status);
  28. + checkHealth(mRxHealth, false);
  29. + }
  30. +
  31. + status = bladerf_sync_config(bdev,
  32. + BLADERF_MODULE_TX,
  33. + BLADERF_FORMAT_SC16_Q11,
  34. + DEFAULT_STREAM_TX_BUFFERS,
  35. + DEFAULT_STREAM_SAMPLES,
  36. + DEFAULT_STREAM_TX_XFERS,
  37. + DEFAULT_STREAM_TIMEOUT
  38. + );
  39. +
  40. + if (status < 0) {
  41. + LOG(CRIT) << "Failed to intialize TX sync handle: " << bladerf_strerror(status);
  42. + checkHealth(mTxHealth, false);
  43. + }
  44. +
  45. + bladerf_config_gpio_read(bdev, &val);
  46. val |= 0x10000; //enable timestamps, clears and resets everything on write
  47. bladerf_config_gpio_write(bdev, val);
  48. bladerf_config_gpio_read(bdev, &val);
  49. @@ -185,34 +213,6 @@
  50. else
  51. LOG(INFO) << "Actual bandwidth " << bw;
  52.  
  53. - status = bladerf_sync_config(bdev,
  54. - BLADERF_MODULE_RX,
  55. - BLADERF_FORMAT_SC16_Q11,
  56. - DEFAULT_STREAM_RX_BUFFERS,
  57. - DEFAULT_STREAM_SAMPLES,
  58. - DEFAULT_STREAM_RX_XFERS,
  59. - DEFAULT_STREAM_TIMEOUT
  60. - );
  61. -
  62. - if (status < 0) {
  63. - LOG(CRIT) << "Failed to intialize RX sync handle: " << bladerf_strerror(status);
  64. - checkHealth(mRxHealth, false);
  65. - }
  66. -
  67. - status = bladerf_sync_config(bdev,
  68. - BLADERF_MODULE_TX,
  69. - BLADERF_FORMAT_SC16_Q11,
  70. - DEFAULT_STREAM_TX_BUFFERS,
  71. - DEFAULT_STREAM_SAMPLES,
  72. - DEFAULT_STREAM_TX_XFERS,
  73. - DEFAULT_STREAM_TIMEOUT
  74. - );
  75. -
  76. - if (status < 0) {
  77. - LOG(CRIT) << "Failed to intialize TX sync handle: " << bladerf_strerror(status);
  78. - checkHealth(mTxHealth, false);
  79. - }
  80. -
  81. mRxGain1 = BLADERF_RXVGA1_GAIN_MAX;
  82. mDcCorrect = true;
  83. mRxMaxOffset = RX_OFFSET_ERROR * RX_AVERAGE_DAMPING;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement