From 0e673c44e65783cdbde6f7e7a3968f8608cc5872 Mon Sep 17 00:00:00 2001 From: jiskra Date: Sat, 10 Jun 2017 13:30:45 +0800 Subject: [PATCH] =?UTF-8?q?=E9=98=85=E8=AF=BB=E4=BB=A3=E7=A0=81=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E7=9A=84=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dump1090.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/dump1090.c b/dump1090.c index 698a1a7..2f73d14 100644 --- a/dump1090.c +++ b/dump1090.c @@ -340,6 +340,7 @@ void modesInitRTLSDR(void) { device_count = rtlsdr_get_device_count(); if (!device_count) { + } fprintf(stderr, "No supported RTLSDR devices found.\n"); exit(1); } @@ -399,10 +400,10 @@ void rtlsdrCallback(unsigned char *buf, uint32_t len, void *ctx) { * on the start of the new buffer. */ memcpy(Modes.data, Modes.data+MODES_DATA_LEN, (MODES_FULL_LEN-1)*4); /* Read the new data. */ - memcpy(Modes.data+(MODES_FULL_LEN-1)*4, buf, len); + memcpy(Modes.data+(MODES_FULL_LEN-1)*4, buf, len);//memcpy(*dest,*src,LEN) Modes.data_ready = 1; /* Signal to the other thread that new data is ready */ - pthread_cond_signal(&Modes.data_cond); + pthread_cond_signal(&Modes.data_cond); //pthread_cond_signal函数的作用是发送一个信号给另外一个处于阻塞状态的线程,使其脱离阻塞状态继续执行。 pthread_mutex_unlock(&Modes.data_mutex); }