Browse Source

Merge branch 'f4exb:master' into mcp

chirpmodem-v8.0.0
srcejon 3 months ago committed by GitHub
parent
commit
5cc04f567b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 20
      .github/workflows/coverity.sh
  2. 2
      external/CMakeLists.txt
  3. 5
      flatpak/org.sdrangel.SDRangel.yaml
  4. 12
      plugins/channelrx/demodadsb/adsbdemodsink.cpp
  5. 4
      plugins/channelrx/demodadsb/adsbdemodsink.h
  6. 3
      plugins/samplemimo/plutosdrmimo/plutosdrmithread.h
  7. 3
      plugins/samplemimo/plutosdrmimo/plutosdrmothread.h
  8. 3
      plugins/samplesink/plutosdroutput/plutosdroutputthread.h
  9. 26
      plugins/samplesink/usrpoutput/usrpoutput.cpp
  10. 3
      plugins/samplesource/plutosdrinput/plutosdrinputthread.h
  11. 26
      plugins/samplesource/usrpinput/usrpinput.cpp
  12. 3
      sdrbase/dsp/dspdevicesinkengine.h
  13. 3
      sdrgui/gui/glspectrumview.h
  14. 2
      snap/snapcraft.yaml

20
.github/workflows/coverity.sh

@ -166,9 +166,13 @@ printf "\033[33;1mCoverity Build Capture version: %s\033[0m\n" "$COVERITY_TOOL_V @@ -166,9 +166,13 @@ printf "\033[33;1mCoverity Build Capture version: %s\033[0m\n" "$COVERITY_TOOL_V
# Configure
RESULTS_DIR="$REPO_ROOT/cov-int"
BUILD_DIR="$REPO_ROOT/build-coverity"
RESULTS_ARCHIVE=analysis-results.tgz
cd "$REPO_ROOT"
if [ ! -f "${REPO_ROOT}/${RESULTS_ARCHIVE}" ] ; then
RESULTS_ARCHIVE="$REPO_ROOT/analysis-results.tgz"
cd "$REPO_ROOT" || {
echo "ERROR: Unable to change to repository root: $REPO_ROOT" >&2
exit 1
}
if [ ! -f "$RESULTS_ARCHIVE" ] ; then
rm -rf "$RESULTS_DIR"
rm -rf "$BUILD_DIR"
@ -179,7 +183,7 @@ if [ ! -f "${REPO_ROOT}/${RESULTS_ARCHIVE}" ] ; then @@ -179,7 +183,7 @@ if [ ! -f "${REPO_ROOT}/${RESULTS_ARCHIVE}" ] ; then
# Build
printf "\033[33;1mRunning Coverity Scan Analysis Tool...\033[0m\n"
cd "$BUILD_DIR"
cov-build --dir "$RESULTS_DIR" ninja -C "$BUILD_DIR" -j "$JOBS"
if grep -q "No files were emitted." "$RESULTS_DIR/build-log.txt"; then
echo "ERROR: Coverity did not emit any files." >&2
@ -193,8 +197,8 @@ if [ ! -f "${REPO_ROOT}/${RESULTS_ARCHIVE}" ] ; then @@ -193,8 +197,8 @@ if [ ! -f "${REPO_ROOT}/${RESULTS_ARCHIVE}" ] ; then
tar czf "$RESULTS_ARCHIVE" -C "$REPO_ROOT" cov-int
fi
if ! tar tf "${REPO_ROOT}/${RESULTS_ARCHIVE}" | grep '^cov-int/build-log.txt$' >/dev/null; then
echo "ERROR: Coverity archive ${REPO_ROOT}/${RESULTS_ARCHIVE} does not contain cov-int/build-log.txt" >&2
if ! tar tf "$RESULTS_ARCHIVE" | grep '^cov-int/build-log.txt$' >/dev/null; then
echo "ERROR: Coverity archive $RESULTS_ARCHIVE does not contain cov-int/build-log.txt" >&2
exit 1
fi
@ -258,8 +262,8 @@ else @@ -258,8 +262,8 @@ else
--silent --write-out "\n%{http_code}\n" \
--form project="$COVERITY_SCAN_PROJECT_NAME" \
--form token="$COVERITY_SCAN_TOKEN" \
--form email=blackhole@blackhole.io \
--form file=@$RESULTS_ARCHIVE \
--form "email=$COVERITY_SCAN_NOTIFICATION_EMAIL" \
--form "file=@$RESULTS_ARCHIVE" \
--form version="$VERSION_SHA" \
--form description="Automated Build: $VERSION_SHA" \
$UPLOAD_URL)

2
external/CMakeLists.txt vendored

@ -27,7 +27,7 @@ set(MIRISDR_TAG "v2.0.0") @@ -27,7 +27,7 @@ set(MIRISDR_TAG "v2.0.0")
set(LIBSIGMF_TAG "new-namespaces")
set(PTHREADS4W_TAG "Version-2-11-0-release")
set(RTLSDR_TAG "v2.0.1")
set(RTLSDR_TAG "v2.0.3")
set(RTLSDR_UDEV OFF)
set(SOAPYSDR_TAG "1667b4e6301d7ad47b340dcdcd6e9969bf57d843")
set(SOAPYSDR_SDRPLAY_TAG "soapy-sdrplay-0.2.0")

5
flatpak/org.sdrangel.SDRangel.yaml

@ -380,9 +380,8 @@ modules: @@ -380,9 +380,8 @@ modules:
- -Wno-dev
sources:
- type: git
url: https://github.com/steve-m/librtlsdr.git
# latest master for 2.0.2 versioning fix
commit: ae0dd6d4f09088d13500a854091b45ad281ca4f0
url: https://github.com/osmocom/rtl-sdr.git
commit: 797f8143266d983c56d8f35d2d442527529dd8a5
- name: plutosdr
buildsystem: cmake-ninja

12
plugins/channelrx/demodadsb/adsbdemodsink.cpp

@ -121,10 +121,14 @@ void ADSBDemodSink::feed(const SampleVector::const_iterator& begin, const Sample @@ -121,10 +121,14 @@ void ADSBDemodSink::feed(const SampleVector::const_iterator& begin, const Sample
void ADSBDemodSink::processOneSample(Real magsq)
{
m_magsqSum += magsq;
if (magsq > m_magsqPeak)
m_magsqPeak = magsq;
m_magsqCount++;
{
QMutexLocker locker(&m_magsqMutex);
m_magsqSum += magsq;
if (magsq > m_magsqPeak)
m_magsqPeak = magsq;
m_magsqCount++;
}
m_sampleBuffer[m_writeBuffer][m_writeIdx] = magsq;
m_writeIdx++;
if (!m_bufferDateTimeValid[m_writeBuffer])

4
plugins/channelrx/demodadsb/adsbdemodsink.h

@ -35,6 +35,8 @@ public: @@ -35,6 +35,8 @@ public:
void getMagSqLevels(double& avg, double& peak, int& nbSamples)
{
QMutexLocker locker(&m_magsqMutex);
if (m_magsqCount > 0)
{
m_magsq = m_magsqSum / m_magsqCount;
@ -107,6 +109,8 @@ private: @@ -107,6 +109,8 @@ private:
int m_magsqCount;
MagSqLevelsStore m_magSqLevelStore;
QMutex m_magsqMutex;
MessageQueue *m_messageQueueToGUI;
MessageQueue *m_messageQueueToWorker;

3
plugins/samplemimo/plutosdrmimo/plutosdrmithread.h

@ -21,6 +21,7 @@ @@ -21,6 +21,7 @@
#ifndef _PLUTOSDR_PLUTOSDRMITHREAD_H_
#define _PLUTOSDR_PLUTOSDRMITHREAD_H_
#include <atomic>
#include <QThread>
#include <QMutex>
#include <QWaitCondition>
@ -53,7 +54,7 @@ signals: @@ -53,7 +54,7 @@ signals:
private:
QMutex m_startWaitMutex;
QWaitCondition m_startWaiter;
bool m_running;
std::atomic_bool m_running;
DevicePlutoSDRBox *m_plutoBox;
qint16 *m_buf[2]; //!< one buffer per I/Q channel

3
plugins/samplemimo/plutosdrmimo/plutosdrmothread.h

@ -21,6 +21,7 @@ @@ -21,6 +21,7 @@
#ifndef _PLUTOSDR_PLUTOSDRMOTHREAD_H_
#define _PLUTOSDR_PLUTOSDRMOTHREAD_H_
#include <atomic>
#include <QThread>
#include <QMutex>
#include <QWaitCondition>
@ -52,7 +53,7 @@ signals: @@ -52,7 +53,7 @@ signals:
private:
QMutex m_startWaitMutex;
QWaitCondition m_startWaiter;
bool m_running;
std::atomic_bool m_running;
DevicePlutoSDRBox *m_plutoBox;
qint16 *m_buf[2]; //!< one buffer per I/Q channel

3
plugins/samplesink/plutosdroutput/plutosdroutputthread.h

@ -21,6 +21,7 @@ @@ -21,6 +21,7 @@
#ifndef PLUGINS_SAMPLESOURCE_PLUTOSDROUTPUT_PLUTOSDROUTPUTTHREAD_H_
#define PLUGINS_SAMPLESOURCE_PLUTOSDROUTPUT_PLUTOSDROUTPUTTHREAD_H_
#include <atomic>
#include <QThread>
#include <QMutex>
#include <QWaitCondition>
@ -51,7 +52,7 @@ signals: @@ -51,7 +52,7 @@ signals:
private:
QMutex m_startWaitMutex;
QWaitCondition m_startWaiter;
bool m_running;
std::atomic_bool m_running;
DevicePlutoSDRBox *m_plutoBox;
int16_t *m_buf; //!< holds I+Q values of each sample from device

26
plugins/samplesink/usrpoutput/usrpoutput.cpp

@ -816,13 +816,22 @@ bool USRPOutput::applySettings(const USRPOutputSettings& settings, const QList<Q @@ -816,13 +816,22 @@ bool USRPOutput::applySettings(const USRPOutputSettings& settings, const QList<Q
}
}
const std::string gpioBank = "FP0"; // Front Panel GPIO
if (settingsKeys.contains("gpioDir") || force)
{
if (m_deviceShared.m_deviceParams->getDevice())
{
m_deviceShared.m_deviceParams->getDevice()->set_gpio_attr("FP0", "CTRL", ~settings.m_gpioDir, 0xff); // 0 for GPIO, 1 for ATR
m_deviceShared.m_deviceParams->getDevice()->set_gpio_attr("FP0", "DDR", settings.m_gpioDir, 0xff); // 0 for input, 1 for output
qDebug() << "USRPOutput::applySettings: set GPIO dir to " << settings.m_gpioDir;
std::vector<std::string> banks = m_deviceShared.m_deviceParams->getDevice()->get_gpio_banks(0);
for (const auto& bank : banks)
{
if (!gpioBank.compare(bank))
{
m_deviceShared.m_deviceParams->getDevice()->set_gpio_attr(gpioBank, "CTRL", ~settings.m_gpioDir, 0xff); // 0 for GPIO, 1 for ATR
m_deviceShared.m_deviceParams->getDevice()->set_gpio_attr(gpioBank, "DDR", settings.m_gpioDir, 0xff); // 0 for input, 1 for output
qDebug() << "USRPOutput::applySettings: set GPIO dir to" << settings.m_gpioDir;
}
}
}
}
@ -830,8 +839,15 @@ bool USRPOutput::applySettings(const USRPOutputSettings& settings, const QList<Q @@ -830,8 +839,15 @@ bool USRPOutput::applySettings(const USRPOutputSettings& settings, const QList<Q
{
if (m_deviceShared.m_deviceParams->getDevice())
{
m_deviceShared.m_deviceParams->getDevice()->set_gpio_attr("FP0", "OUT", settings.m_gpioPins, 0xff);
qDebug() << "USRPOutput::applySettings: set GPIO pins to " << settings.m_gpioPins;
std::vector<std::string> banks = m_deviceShared.m_deviceParams->getDevice()->get_gpio_banks(0);
for (const auto& bank : banks)
{
if (!gpioBank.compare(bank))
{
m_deviceShared.m_deviceParams->getDevice()->set_gpio_attr(gpioBank, "OUT", settings.m_gpioPins, 0xff);
qDebug() << "USRPOutput::applySettings: set GPIO pins to" << settings.m_gpioPins;
}
}
}
}

3
plugins/samplesource/plutosdrinput/plutosdrinputthread.h

@ -21,6 +21,7 @@ @@ -21,6 +21,7 @@
#ifndef PLUGINS_SAMPLESOURCE_PLUTOSDRINPUT_PLUTOSDRINPUTTHREAD_H_
#define PLUGINS_SAMPLESOURCE_PLUTOSDRINPUT_PLUTOSDRINPUTTHREAD_H_
#include <atomic>
#include <QThread>
#include <QMutex>
#include <QWaitCondition>
@ -53,7 +54,7 @@ signals: @@ -53,7 +54,7 @@ signals:
private:
QMutex m_startWaitMutex;
QWaitCondition m_startWaiter;
bool m_running;
std::atomic_bool m_running;
DevicePlutoSDRBox *m_plutoBox;
int16_t *m_buf; //!< holds I+Q values of each sample from device

26
plugins/samplesource/usrpinput/usrpinput.cpp

@ -898,13 +898,22 @@ bool USRPInput::applySettings(const USRPInputSettings& settings, const QList<QSt @@ -898,13 +898,22 @@ bool USRPInput::applySettings(const USRPInputSettings& settings, const QList<QSt
}
}
const std::string gpioBank = "FP0"; // Front Panel GPIO
if (settingsKeys.contains("gpioDir") || force)
{
if (m_deviceShared.m_deviceParams->getDevice())
{
m_deviceShared.m_deviceParams->getDevice()->set_gpio_attr("FP0", "CTRL", ~settings.m_gpioDir, 0xff); // 0 for GPIO, 1 for ATR
m_deviceShared.m_deviceParams->getDevice()->set_gpio_attr("FP0", "DDR", settings.m_gpioDir, 0xff); // 0 for input, 1 for output
qDebug() << "USRPInput::applySettings: set GPIO dir to " << settings.m_gpioDir;
std::vector<std::string> banks = m_deviceShared.m_deviceParams->getDevice()->get_gpio_banks(0);
for (const auto& bank : banks)
{
if (!gpioBank.compare(bank))
{
m_deviceShared.m_deviceParams->getDevice()->set_gpio_attr(gpioBank, "CTRL", ~settings.m_gpioDir, 0xff); // 0 for GPIO, 1 for ATR
m_deviceShared.m_deviceParams->getDevice()->set_gpio_attr(gpioBank, "DDR", settings.m_gpioDir, 0xff); // 0 for input, 1 for output
qDebug() << "USRPInput::applySettings: set GPIO dir to" << settings.m_gpioDir;
}
}
}
}
@ -912,8 +921,15 @@ bool USRPInput::applySettings(const USRPInputSettings& settings, const QList<QSt @@ -912,8 +921,15 @@ bool USRPInput::applySettings(const USRPInputSettings& settings, const QList<QSt
{
if (m_deviceShared.m_deviceParams->getDevice())
{
m_deviceShared.m_deviceParams->getDevice()->set_gpio_attr("FP0", "OUT", settings.m_gpioPins, 0xff);
qDebug() << "USRPInput::applySettings: set GPIO pins to " << settings.m_gpioPins;
std::vector<std::string> banks = m_deviceShared.m_deviceParams->getDevice()->get_gpio_banks(0);
for (const auto& bank : banks)
{
if (!gpioBank.compare(bank))
{
m_deviceShared.m_deviceParams->getDevice()->set_gpio_attr(gpioBank, "OUT", settings.m_gpioPins, 0xff);
qDebug() << "USRPInput::applySettings: set GPIO pins to" << settings.m_gpioPins;
}
}
}
}

3
sdrbase/dsp/dspdevicesinkengine.h

@ -22,6 +22,7 @@ @@ -22,6 +22,7 @@
#ifndef SDRBASE_DSP_DSPDEVICESINKENGINE_H_
#define SDRBASE_DSP_DSPDEVICESINKENGINE_H_
#include <atomic>
#include <QObject>
#include <QTimer>
#include <QMutex>
@ -83,7 +84,7 @@ private: @@ -83,7 +84,7 @@ private:
MessageQueue m_inputMessageQueue; //<! Input message queue. Post here.
State m_state;
std::atomic<State> m_state;
QString m_errorMessage;
QString m_deviceDescription;

3
sdrgui/gui/glspectrumview.h

@ -26,6 +26,7 @@ @@ -26,6 +26,7 @@
#ifndef INCLUDE_GLSPECTRUMVIEW_H
#define INCLUDE_GLSPECTRUMVIEW_H
#include <atomic>
#include <QTimer>
#include <QMutex>
#include <QOpenGLBuffer>
@ -431,7 +432,7 @@ private: @@ -431,7 +432,7 @@ private:
QMatrix4x4 m_glHistogramSpectrumMatrix;
QMatrix4x4 m_glHistogramBoxMatrix;
bool m_displayHistogram;
bool m_displayChanged;
std::atomic_bool m_displayChanged;
bool m_displaySourceOrSink;
int m_displayStreamIndex;
float m_frequencyZoomFactor;

2
snap/snapcraft.yaml

@ -524,7 +524,7 @@ parts: @@ -524,7 +524,7 @@ parts:
plugin: cmake
source: https://github.com/osmocom/rtl-sdr.git
source-type: git
source-commit: 420086af84d7eaaf98ff948cd11fea2cae71734a
source-commit: 797f8143266d983c56d8f35d2d442527529dd8a5
build-packages:
- libusb-1.0-0-dev
cmake-parameters:

Loading…
Cancel
Save