/* * Adalm Pluto Driver * ================== * Author: DJ0ABR * * (c) DJ0ABR * www.dj0abr.de * * 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., 675 Mass Ave, Cambridge, MA 02139, USA. * * ========================= * runloop for RX and TX * ========================= * */ #include "../qo100trx.h" void* plutorun_threadfunction(void* param); void init_runloop() { pthread_t plutorunthread; pthread_create(&plutorunthread, NULL, plutorun_threadfunction, NULL); } void* plutorun_threadfunction(void* param) { ssize_t nbytes_rx, nbytes_tx; uint8_t *p_dat, *p_start; pthread_detach(pthread_self()); printf("entering pluto loop, *** PID:%ld ***\n",syscall(SYS_gettid)); while(keeprunning) { // ====== receive samples from pluto ====== // Refill RX buffer nbytes_rx = iio_buffer_refill(rxbuf); if (nbytes_rx < 0) { printf("Error refilling buf %d\n",(int) nbytes_rx); } //measure_samplerate(0,nbytes_rx/4,10); p_start = (uint8_t *)iio_buffer_first(rxbuf, rx0_i); //for(int ix=0; ix