Skip to content

Commit 0473f60

Browse files
committed
Clean up style with clang-format
1 parent c660618 commit 0473f60

File tree

3 files changed

+15
-19
lines changed

3 files changed

+15
-19
lines changed

src/goesrecv/config.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,8 @@ struct Config {
7272
uint32_t frequency = 0;
7373
uint32_t sampleRate = 0;
7474

75-
// Applies to the tuner IF gain setting
76-
uint8_t gain = 8;
75+
// Applies to the tuner gain setting
76+
uint8_t gain = 30;
7777

7878
// Enable/disable bias tee
7979
bool bias_tee = 0;

src/goesrecv/hackrf_source.cc

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ std::unique_ptr<HackRf> HackRf::open(uint32_t index) {
1919
std::cout << "Is open?" << std::endl;
2020

2121
if (rv < 0) {
22-
std::cerr << "Unable to open Hackrf device: " << hackrf_error_name((enum hackrf_error) rv) << std::endl;
22+
std::cerr << "Unable to open Hackrf device: "
23+
<< hackrf_error_name((enum hackrf_error)rv) << std::endl;
2324
exit(1);
2425
}
2526

@@ -55,9 +56,7 @@ void HackRf::setSampleRate(uint32_t rate) {
5556
sampleRate_ = rate;
5657
}
5758

58-
uint32_t HackRf::getSampleRate() const {
59-
return sampleRate_;
60-
}
59+
uint32_t HackRf::getSampleRate() const { return sampleRate_; }
6160

6261
void HackRf::setIfGain(int gain) {
6362
ASSERT(dev_ != nullptr);
@@ -80,8 +79,6 @@ void HackRf::setBbGain(int gain) {
8079
ASSERT(rv_amp >= 0);
8180
}
8281

83-
84-
8582
void HackRf::setBiasTee(bool on) {
8683
ASSERT(dev_ != nullptr);
8784
auto rv = hackrf_set_antenna_enable(dev_, on ? 1 : 0);
@@ -98,9 +95,9 @@ void HackRf::start(const std::shared_ptr<Queue<Samples> >& queue) {
9895
ASSERT(dev_ != nullptr);
9996
queue_ = queue;
10097
thread_ = std::thread([&] {
101-
auto rv = hackrf_start_rx(dev_, &hackrf_callback, this);
102-
ASSERT(rv == 0);
103-
});
98+
auto rv = hackrf_start_rx(dev_, &hackrf_callback, this);
99+
ASSERT(rv == 0);
100+
});
104101
#ifdef __APPLE__
105102
pthread_setname_np("hackrf");
106103
#else
@@ -123,10 +120,11 @@ void HackRf::stop() {
123120
queue_.reset();
124121
}
125122

126-
void HackRf::process(size_t nsamples, unsigned char* buf, std::complex<float>* fo) {
123+
void HackRf::process(size_t nsamples, unsigned char* buf,
124+
std::complex<float>* fo) {
127125
for (uint32_t i = 0; i < nsamples; i++) {
128-
fo[i].real((static_cast<int8_t>(buf[i*2+0]) / 128.0f));
129-
fo[i].imag((static_cast<int8_t>(buf[i*2+1]) / 128.0f));
126+
fo[i].real((static_cast<int8_t>(buf[i * 2 + 0]) / 128.0f));
127+
fo[i].imag((static_cast<int8_t>(buf[i * 2 + 1]) / 128.0f));
130128
}
131129
}
132130

src/goesrecv/hackrf_source.h

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,13 @@
1111
#include "source.h"
1212

1313
class HackRf : public Source {
14-
public:
14+
public:
1515
static std::unique_ptr<HackRf> open(uint32_t index = 0);
1616

1717
explicit HackRf(struct hackrf_device* dev);
1818
~HackRf();
1919

20-
std::vector<uint32_t> getSampleRates() const {
21-
return sampleRates_;
22-
}
20+
std::vector<uint32_t> getSampleRates() const { return sampleRates_; }
2321

2422
void setFrequency(uint32_t freq);
2523

@@ -45,7 +43,7 @@ class HackRf : public Source {
4543

4644
void handle(const hackrf_transfer* transfer);
4745

48-
protected:
46+
protected:
4947
struct hackrf_device* dev_;
5048

5149
std::vector<uint32_t> loadSampleRates();

0 commit comments

Comments
 (0)