From 4ee216b5e445101bf37fc17e43fe77a27c9c99f5 Mon Sep 17 00:00:00 2001 From: John Melton - G0ORX/N6LYT Date: Thu, 16 Feb 2017 13:21:39 +0000 Subject: [PATCH] source file cleanup --- libusbio.c | 99 ----------- libusbio.h | 19 -- wdsp_init.c | 502 ---------------------------------------------------- 3 files changed, 620 deletions(-) delete mode 100644 libusbio.c delete mode 100644 libusbio.h delete mode 100644 wdsp_init.c diff --git a/libusbio.c b/libusbio.c deleted file mode 100644 index 0f52c6b..0000000 --- a/libusbio.c +++ /dev/null @@ -1,99 +0,0 @@ -/* - * File: libusbio.c - * Author: jm57878 - * - * Created on 18 February 2009, 21:16 - */ - - -#include -#include -#include - -#include "libusbio.h" - -/* - * interface to libusb1.0 - */ - -#define OZY_PID (0x0007) -#define OZY_VID (0xfffe) - -#define VRQ_SDR1K_CTL 0x0d -#define SDR1KCTRL_READ_VERSION 0x7 -#define VRT_VENDOR_IN 0xC0 - -#define OZY_IO_TIMEOUT 500 - -static int init=0; -static libusb_device_handle* ozy_handle; -static libusb_context* context; - -int libusb_open_ozy(void) { - int rc; - -fprintf(stderr,"libusb_open_ozy\n"); - - if(init==0) { - rc=libusb_init(NULL); - if(rc<0) { - fprintf(stderr,"libusb_init failed: %d\n",rc); - return rc; - } - init=1; - } - - ozy_handle=libusb_open_device_with_vid_pid(NULL, OZY_VID, OZY_PID); - if(ozy_handle==NULL) { - fprintf(stderr,"libusbio: cannot find ozy device\n"); - return -1; - } - - rc=libusb_claim_interface(ozy_handle,0); - if(rc<0) { - fprintf(stderr,"libusb_claim_interface failed: %d\n",rc); - return rc; - } - -fprintf(stderr,"libusb_open_ozy: SUCCESS\n"); - return 0; - -} - -void libusb_close_ozy() { - libusb_close(ozy_handle); -} - -int libusb_get_ozy_firmware_string(char* buffer,int buffersize) { - int rc; - rc=libusb_control_transfer(ozy_handle, VRT_VENDOR_IN, VRQ_SDR1K_CTL, SDR1KCTRL_READ_VERSION, 0, buffer, buffersize, OZY_IO_TIMEOUT); - if(rc<0) { - fprintf(stderr,"libusb_get_ozy_firmware failed: %d\n",rc); - return rc; - } - buffer[rc]=0x00; - return 0; -} - -int libusb_write_ozy(int ep,void* buffer,int buffersize) -{ - int rc; - int bytes; - rc = libusb_bulk_transfer(ozy_handle, (unsigned char)ep, (unsigned char *)buffer, buffersize,&bytes, OZY_IO_TIMEOUT); - if(rc==0) { - rc=bytes; - } - return rc; -} - - -int libusb_read_ozy(int ep,void* buffer,int buffersize) -{ - int rc; - int bytes; - rc = libusb_bulk_transfer(ozy_handle, (unsigned char)ep, (unsigned char *)buffer, buffersize,&bytes, OZY_IO_TIMEOUT); - if(rc==0) { - rc=bytes; - } - return rc; -} diff --git a/libusbio.h b/libusbio.h deleted file mode 100644 index eb3660b..0000000 --- a/libusbio.h +++ /dev/null @@ -1,19 +0,0 @@ -/** -* @file libusbio.h -* @brief Header file for the USB I/O functions, interface to libusb1.0 -* @author -* @version 0.1 -* @date 2009-05-18 -*/ - -#ifndef _LIBUSBIO_H -#define _LIBUSBIO_H - -int libusb_open_ozy(void); -void libusb_close_ozy(); -int libusb_get_ozy_firmware_string(char* buffer,int buffersize); -int libusb_write_ozy(int ep,void* buffer,int buffersize); -int libusb_read_ozy(int ep,void* buffer,int buffersize); - -#endif /* _LIBUSBIO_H */ - diff --git a/wdsp_init.c b/wdsp_init.c deleted file mode 100644 index cdeec08..0000000 --- a/wdsp_init.c +++ /dev/null @@ -1,502 +0,0 @@ -/* Copyright (C) -* 2015 - John Melton, G0ORX/N6LYT -* -* This program is free software; you can redistribute it and/or -* modify it under the terms of the GNU General Public License -* as published by the Free Software Foundation; either version 2 -* of the License, or (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software -* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -* -*/ - -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "agc.h" -#include "band.h" -#include "alex.h" -#include "new_protocol.h" -#include "channel.h" -#include "discovered.h" -#include "mode.h" -#include "filter.h" -#include "wdsp.h" -#include "radio.h" -#include "vfo.h" -#include "toolbar.h" -#include "wdsp_init.h" -#ifdef FREEDV -#include "freedv.h" -#endif -#ifdef PSK -#include "main.h" -#include "psk.h" -#endif - -#define PI 3.1415926535897932F -#define min(x,y) (x 48 easy - } - SetAnalyzer(channel, - n_pixout, - spur_elimination_ffts, //number of LO frequencies = number of ffts used in elimination - data_type, //0 for real input data (I only); 1 for complex input data (I & Q) - flp, //vector with one elt for each LO frequency, 1 if high-side LO, 0 otherwise - fft_size, //size of the fft, i.e., number of input samples - buffer_size, //number of samples transferred for each OpenBuffer()/CloseBuffer() - window_type, //integer specifying which window function to use - kaiser_pi, //PiAlpha parameter for Kaiser window - overlap, //number of samples each fft (other than the first) is to re-use from the previous - clip, //number of fft output bins to be clipped from EACH side of each sub-span - span_clip_l, //number of bins to clip from low end of entire span - span_clip_h, //number of bins to clip from high end of entire span - pixels, //number of pixel values to return. may be either <= or > number of bins - stitches, //number of sub-spans to concatenate to form a complete span -/* - avm, //averaging mode - display_average, //number of spans to (moving) average for pixel result - avb, //back multiplier for weighted averaging -*/ - calibration_data_set, //identifier of which set of calibration data to use - span_min_freq, //frequency at first pixel value8192 - span_max_freq, //frequency at last pixel value - max_w //max samples to hold in input ring buffers - ); -} -- 2.45.2