Merge pull request #280 from dominicgs/clang

OS X / clang build fixes
This commit is contained in:
Michael Ossmann
2016-09-22 08:59:16 -06:00
committed by GitHub
4 changed files with 31 additions and 20 deletions

View File

@ -2,6 +2,12 @@ language: c
cache: apt
sudo: false
os:
- linux
- osx
compiler:
- gcc
# - clang
@ -12,6 +18,10 @@ before_script:
# - export PATH=$PWD/gcc-arm-none-eabi-5_3-2016q1/bin:$PATH
- export CFLAGS="-Wall -Wextra -Werror"
before_install:
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install libusb; fi
script:
- mkdir host/build
- cd host/build

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 {