Tidy clang build warnings

- Remove transceiver enums from hackrf.h
 - convert uint64_ts to int64_ts for frequency maths
This commit is contained in:
Dominic Spill
2016-09-15 13:50:50 -06:00
parent 1d122431a0
commit 11ef7f74f6
3 changed files with 21 additions and 20 deletions

View File

@ -83,16 +83,16 @@ int gettimeofday(struct timeval *tv, void* ignored)
#define FD_BUFFER_SIZE (8*1024)
#define FREQ_ONE_MHZ (1000000ull)
#define FREQ_ONE_MHZ (1000000ll)
#define DEFAULT_FREQ_HZ (900000000ull) /* 900MHz */
#define DEFAULT_FREQ_HZ (900000000ll) /* 900MHz */
#define FREQ_MIN_HZ (0ull) /* 0 Hz */
#define FREQ_MAX_HZ (7250000000ull) /* 7250MHz */
#define IF_MIN_HZ (2150000000ull)
#define IF_MAX_HZ (2750000000ull)
#define LO_MIN_HZ (84375000ull)
#define LO_MAX_HZ (5400000000ull)
#define DEFAULT_LO_HZ (1000000000ull)
#define FREQ_MAX_HZ (7250000000ll) /* 7250MHz */
#define IF_MIN_HZ (2150000000ll)
#define IF_MAX_HZ (2750000000ll)
#define LO_MIN_HZ (84375000ll)
#define LO_MAX_HZ (5400000000ll)
#define DEFAULT_LO_HZ (1000000000ll)
#define DEFAULT_SAMPLE_RATE_HZ (10000000) /* 10MHz default sample rate */
@ -107,6 +107,13 @@ int gettimeofday(struct timeval *tv, void* ignored)
#define sleep(a) Sleep( (a*1000) )
#endif
typedef enum {
TRANSCEIVER_MODE_OFF = 0,
TRANSCEIVER_MODE_RX = 1,
TRANSCEIVER_MODE_TX = 2,
TRANSCEIVER_MODE_SS = 3,
} transceiver_mode_t;
/* WAVE or RIFF WAVE file format containing IQ 2x8bits data for HackRF compatible with SDR# Wav IQ file */
typedef struct
{
@ -304,13 +311,13 @@ struct timeval time_start;
struct timeval t_start;
bool automatic_tuning = false;
uint64_t freq_hz;
int64_t freq_hz;
bool if_freq = false;
uint64_t if_freq_hz;
int64_t if_freq_hz;
bool lo_freq = false;
uint64_t lo_freq_hz = DEFAULT_LO_HZ;
int64_t lo_freq_hz = DEFAULT_LO_HZ;
bool image_reject = false;
uint32_t image_reject_selection;
@ -692,7 +699,7 @@ int main(int argc, char** argv) {
freq_hz = if_freq_hz;
break;
case RF_PATH_FILTER_LOW_PASS:
freq_hz = abs(if_freq_hz - lo_freq_hz);
freq_hz = labs(if_freq_hz - lo_freq_hz);
break;
case RF_PATH_FILTER_HIGH_PASS:
freq_hz = if_freq_hz + lo_freq_hz;

View File

@ -78,6 +78,8 @@ typedef enum {
HACKRF_TRANSCEIVER_MODE_OFF = 0,
HACKRF_TRANSCEIVER_MODE_RECEIVE = 1,
HACKRF_TRANSCEIVER_MODE_TRANSMIT = 2,
HACKRF_TRANSCEIVER_MODE_SS = 3,
TRANSCEIVER_MODE_CPLD_UPDATE = 4,
} hackrf_transceiver_mode;
struct hackrf_device {

View File

@ -82,14 +82,6 @@ enum rf_path_filter {
RF_PATH_FILTER_HIGH_PASS = 2,
};
typedef enum {
TRANSCEIVER_MODE_OFF = 0,
TRANSCEIVER_MODE_RX = 1,
TRANSCEIVER_MODE_TX = 2,
TRANSCEIVER_MODE_SS = 3,
TRANSCEIVER_MODE_CPLD_UPDATE = 4
} transceiver_mode_t;
typedef struct hackrf_device hackrf_device;
typedef struct {