From 02ba23bf680a771a5b497cc5ebd92e4b4aea7d64 Mon Sep 17 00:00:00 2001 From: Jared Boone Date: Wed, 20 Nov 2013 15:24:50 -0800 Subject: [PATCH] Fix broken sgpio-rx project, broken due to massive changes to how RF path and tuning is done. --- firmware/sgpio-rx/Makefile | 2 ++ firmware/sgpio-rx/sgpio-rx.c | 25 +++++-------------------- 2 files changed, 7 insertions(+), 20 deletions(-) diff --git a/firmware/sgpio-rx/Makefile b/firmware/sgpio-rx/Makefile index db89574e..79ed6509 100644 --- a/firmware/sgpio-rx/Makefile +++ b/firmware/sgpio-rx/Makefile @@ -24,6 +24,8 @@ BINARY = sgpio-rx SRC = $(BINARY).c \ ../common/hackrf_core.c \ + ../common/tuning.c \ + ../common/rf_path.c \ ../common/sgpio.c \ ../common/si5351c.c \ ../common/max2837.c \ diff --git a/firmware/sgpio-rx/sgpio-rx.c b/firmware/sgpio-rx/sgpio-rx.c index 61c33604..823204b4 100644 --- a/firmware/sgpio-rx/sgpio-rx.c +++ b/firmware/sgpio-rx/sgpio-rx.c @@ -21,16 +21,12 @@ */ #include -#include #include -#include -#include #include -#include -#include -#include +#include #include +#include void tx_test() { sgpio_configure(TRANSCEIVER_MODE_TX, false); @@ -91,27 +87,16 @@ void rx_test() { int main(void) { const uint32_t freq = 2700000000U; - uint8_t switchctrl = 0; pin_setup(); enable_1v8_power(); cpu_clock_init(); ssp1_init(); - ssp1_set_mode_max2837(); - max2837_setup(); - rffc5071_setup(); -#ifdef JAWBREAKER - switchctrl = (SWITCHCTRL_AMP_BYPASS | SWITCHCTRL_HP); -#endif - rffc5071_rx(switchctrl); - rffc5071_set_frequency(500); // 500 MHz + rf_path_init(); + rf_path_set_direction(RF_PATH_DIRECTION_RX); - max2837_set_frequency(freq); - max2837_start(); - max2837_rx(); + set_freq(freq / 1000000, freq % 1000000); - ssp1_set_mode_max5864(); - max5864_xcvr(); rx_test(); gpio_set(PORT_LED1_3, (PIN_LED2)); /* LED2 on */