This commit is contained in:
DreamSourceLab 2017-06-04 23:57:41 +08:00
commit 0d0733d8ee
100 changed files with 135 additions and 219 deletions

View File

@ -20,14 +20,12 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <libsigrok4DSL/libsigrok.h>
#ifdef ENABLE_DECODE
#include <libsigrokdecode4DSL/libsigrokdecode.h> /* First, so we avoid a _POSIX_C_SOURCE warning. */
#include <libsigrokdecode4DSL/libsigrokdecode.h>
#endif
#include <stdint.h>
#include <libsigrok4DSL/libsigrok.h>
#include <getopt.h>
#include <QApplication>

View File

@ -20,7 +20,6 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "analog.h"
#include "analogsnapshot.h"

View File

@ -20,7 +20,6 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <extdef.h>
#include <assert.h>

View File

@ -24,6 +24,8 @@
#ifndef DSVIEW_PV_DATA_ANALOGSNAPSHOT_H
#define DSVIEW_PV_DATA_ANALOGSNAPSHOT_H
#include <libsigrok4DSL/libsigrok.h>
#include "snapshot.h"
#include <utility>

View File

@ -19,7 +19,6 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <libsigrok4DSL/libsigrok.h>
#include <libsigrokdecode4DSL/libsigrokdecode.h>
#include "decoder.h"

View File

@ -18,6 +18,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <boost/foreach.hpp>
#include <boost/thread/thread.hpp>

View File

@ -19,7 +19,6 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "dso.h"
#include "dsosnapshot.h"

View File

@ -19,7 +19,6 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <extdef.h>
#include <assert.h>

View File

@ -23,11 +23,12 @@
#ifndef DSVIEW_PV_DATA_DSOSNAPSHOT_H
#define DSVIEW_PV_DATA_DSOSNAPSHOT_H
#include "snapshot.h"
#include <utility>
#include <vector>
#include <libsigrok4DSL/libsigrok.h>
#include "snapshot.h"
namespace DsoSnapshotTest {
class Basic;
}

View File

@ -19,7 +19,6 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "group.h"
#include "groupsnapshot.h"

View File

@ -19,7 +19,6 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <extdef.h>
#include <assert.h>

View File

@ -20,7 +20,6 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "logic.h"
#include "logicsnapshot.h"

View File

@ -20,7 +20,6 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <extdef.h>
#include <QDebug>
@ -662,7 +661,7 @@ bool LogicSnapshot::block_nxt_edge(uint64_t *lbp, uint64_t &index, uint64_t bloc
{
unsigned int level = min_level;
bool fast_forward = true;
const uint64_t last = last_sample ? ~0ULL : 0;
const uint64_t last = last_sample ? ~0ULL : 0ULL;
//----- Search Next Edge Within Current LeafBlock -----//
if (level == 0)
@ -704,7 +703,7 @@ bool LogicSnapshot::block_nxt_edge(uint64_t *lbp, uint64_t &index, uint64_t bloc
// Check if there was a change in this block
if (sample) {
index = (index & (~0 << (level + 1)*ScalePower)) + (bsf_folded(sample) << level*ScalePower);
index = (index & (~0ULL << (level + 1)*ScalePower)) + (bsf_folded(sample) << level*ScalePower);
break;
} else {
index = ((index >> (level + 1)*ScalePower) + 1) << (level + 1)*ScalePower;
@ -730,7 +729,7 @@ bool LogicSnapshot::block_nxt_edge(uint64_t *lbp, uint64_t &index, uint64_t bloc
// Update the low level position of the change in this block
if (level == 0 ? sample ^ last : sample) {
index = (index & (~0 << (level + 1)*ScalePower)) + (bsf_folded(level == 0 ? sample ^ last : sample) << level*ScalePower);
index = (index & (~0ULL << (level + 1)*ScalePower)) + (bsf_folded(level == 0 ? sample ^ last : sample) << level*ScalePower);
if (level == min_level)
break;
}
@ -747,7 +746,7 @@ bool LogicSnapshot::block_pre_edge(uint64_t *lbp, uint64_t &index, bool last_sam
unsigned int level = min_level;
bool fast_forward = true;
const uint64_t last = last_sample ? ~0ULL : 0;
const uint64_t last = last_sample ? ~0ULL : 0ULL;
uint64_t block_start = index & ~LeafMask;
//----- Search Next Edge Within Current LeafBlock -----//
@ -801,7 +800,7 @@ bool LogicSnapshot::block_pre_edge(uint64_t *lbp, uint64_t &index, bool last_sam
// Check if there was a change in this block
if (sample) {
index = (index & (~0 << (level + 1)*ScalePower)) +
index = (index & (~0ULL << (level + 1)*ScalePower)) +
(bsr64(sample) << level*ScalePower) +
~(~0ULL << level*ScalePower);
break;
@ -832,7 +831,7 @@ bool LogicSnapshot::block_pre_edge(uint64_t *lbp, uint64_t &index, bool last_sam
// Update the low level position of the change in this block
if (level == 0 ? sample ^ last : sample) {
index = (index & (~0 << (level + 1)*ScalePower)) +
index = (index & (~0ULL << (level + 1)*ScalePower)) +
(bsr64(level == 0 ? sample ^ last : sample) << level*ScalePower) +
~(~0ULL << level*ScalePower);
if (level == min_level) {
@ -840,7 +839,7 @@ bool LogicSnapshot::block_pre_edge(uint64_t *lbp, uint64_t &index, bool last_sam
break;
}
} else {
index = (index & (~0 << (level + 1)*ScalePower));
index = (index & (~0ULL << (level + 1)*ScalePower));
}
}
}

View File

@ -24,6 +24,8 @@
#ifndef DSVIEW_PV_DATA_LOGICSNAPSHOT_H
#define DSVIEW_PV_DATA_LOGICSNAPSHOT_H
#include <libsigrok4DSL/libsigrok.h>
#include "snapshot.h"
#include <QString>

View File

@ -17,6 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "mathstack.h"
#include <boost/foreach.hpp>

View File

@ -20,12 +20,9 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef DSVIEW_PV_DATA_SNAPSHOT_H
#define DSVIEW_PV_DATA_SNAPSHOT_H
#include <libsigrok4DSL/libsigrok.h>
#include <boost/thread.hpp>
namespace pv {

View File

@ -21,8 +21,6 @@
#include <sstream>
#include <libsigrok4DSL/libsigrok.h>
#include "device.h"
using std::ostringstream;

View File

@ -19,12 +19,12 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <cassert>
#include <QDebug>
#include <libsigrok4DSL/libsigrok.h>
#include "devinst.h"
#include <pv/sigsession.h>

View File

@ -22,16 +22,16 @@
#ifndef DSVIEW_PV_DEVICE_DEVINST_H
#define DSVIEW_PV_DEVICE_DEVINST_H
#include <string>
#include <boost/shared_ptr.hpp>
#include <QObject>
#include <string>
#include <glib.h>
#include <stdint.h>
#include <libsigrok4DSL/libsigrok.h>
struct sr_dev_inst;
struct sr_channel;
struct sr_channel_group;

View File

@ -29,8 +29,6 @@
#include <boost/filesystem.hpp>
#include <libsigrok4DSL/libsigrok.h>
using std::string;
namespace pv {

View File

@ -20,15 +20,12 @@
*/
#include <cassert>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include "inputfile.h"
#include <libsigrok4DSL/libsigrok.h>
using std::string;
namespace pv {

View File

@ -21,8 +21,6 @@
#include "sessionfile.h"
#include <libsigrok4DSL/libsigrok.h>
namespace pv {
namespace device {

View File

@ -20,7 +20,6 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "devicemanager.h"
#include "device/devinst.h"
#include "device/device.h"
@ -38,8 +37,6 @@
#include <boost/foreach.hpp>
#include <libsigrok4DSL/libsigrok.h>
using boost::shared_ptr;
using std::list;
using std::map;

View File

@ -19,7 +19,6 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "calibration.h"
#include <boost/foreach.hpp>
@ -30,7 +29,6 @@
#include <QtConcurrent/QtConcurrent>
#include <QTime>
#include "libsigrok4DSL/libsigrok.h"
#include "../view/trace.h"
using namespace boost;

View File

@ -20,7 +20,6 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "deviceoptions.h"
#include <boost/foreach.hpp>

View File

@ -40,8 +40,9 @@
#include <boost/shared_ptr.hpp>
#include <pv/device/devinst.h>
#include <pv/prop/binding/deviceoptions.h>
#include <libsigrok4DSL/libsigrok.h>
#include "../device/devinst.h"
#include "../prop/binding/deviceoptions.h"
#include "../toolbars/titlebar.h"
#include "../dialogs/dsdialog.h"

View File

@ -19,7 +19,6 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "dsomeasure.h"
#include "../device/devinst.h"

View File

@ -19,7 +19,6 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "fftoptions.h"
#include <boost/foreach.hpp>

View File

@ -19,7 +19,6 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "protocolexp.h"
#include <boost/foreach.hpp>

View File

@ -19,7 +19,6 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "protocollist.h"
#include <boost/foreach.hpp>

View File

@ -19,7 +19,6 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "search.h"
#include "../view/logicsignal.h"

View File

@ -28,8 +28,8 @@
#include <QVBoxLayout>
#include <QGridLayout>
#include <QDialogButtonBox>
#include "../sigsession.h"
#include <libsigrok4DSL/libsigrok.h>
#include "../toolbars/titlebar.h"
#include "dsdialog.h"
#include "../device/devinst.h"

View File

@ -19,7 +19,6 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "waitingdialog.h"
#include <boost/foreach.hpp>
@ -31,7 +30,6 @@
#include <QtConcurrent/QtConcurrent>
#include <QVBoxLayout>
#include "libsigrok4DSL/libsigrok.h"
#include "../view/trace.h"
using namespace boost;

View File

@ -19,7 +19,6 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "dsotriggerdock.h"
#include "../sigsession.h"
#include "../device/devinst.h"
@ -39,8 +38,6 @@
#include <QVBoxLayout>
#include <QHBoxLayout>
#include "libsigrok4DSL/libsigrok.h"
using namespace boost;
using namespace std;

View File

@ -19,7 +19,6 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef DSVIEW_PV_DSOTRIGGERDOCK_H
#define DSVIEW_PV_DSOTRIGGERDOCK_H
@ -32,8 +31,6 @@
#include <vector>
#include <libsigrok4DSL/libsigrok.h>
namespace pv {
class SigSession;

View File

@ -42,8 +42,6 @@
#include <QRegExpValidator>
#include <QMessageBox>
#include "libsigrok4DSL/libsigrok.h"
using namespace boost;
namespace pv {

View File

@ -19,7 +19,6 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef DSVIEW_PV_MEASUREDOCK_H
#define DSVIEW_PV_MEASUREDOCK_H
@ -43,8 +42,6 @@
#include <vector>
#include <libsigrok4DSL/libsigrok.h>
namespace pv {
class SigSession;

View File

@ -19,7 +19,6 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "protocoldock.h"
#include "../sigsession.h"
#include "../view/decodetrace.h"

View File

@ -40,8 +40,6 @@
#include <vector>
#include <boost/thread.hpp>
#include <libsigrok4DSL/libsigrok.h>
#include "../data/decodermodel.h"
namespace pv {

View File

@ -19,7 +19,6 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "searchdock.h"
#include "../sigsession.h"
#include "../view/cursor.h"

View File

@ -42,8 +42,6 @@
#include <vector>
#include <libsigrok4DSL/libsigrok.h>
#include "../widgets/fakelineedit.h"
namespace pv {

View File

@ -19,7 +19,6 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "triggerdock.h"
#include "../sigsession.h"
#include "../device/devinst.h"

View File

@ -43,8 +43,6 @@
#include <vector>
#include <libsigrok4DSL/libsigrok.h>
namespace pv {
class SigSession;

View File

@ -19,7 +19,6 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "mainframe.h"
#include "toolbars/titlebar.h"

View File

@ -83,7 +83,6 @@
#include <stdarg.h>
#include <glib.h>
#include <list>
#include <libsigrok4DSL/libsigrok.h>
using boost::shared_ptr;
using boost::dynamic_pointer_cast;

View File

@ -30,7 +30,6 @@
#include <QString>
#include <libsigrok4DSL/libsigrok.h>
#include "binding.h"
namespace pv {

View File

@ -26,7 +26,6 @@
#include "sigsession.h"
#include "mainwindow.h"
#include "devicemanager.h"
#include "device/device.h"
#include "device/file.h"

View File

@ -20,7 +20,6 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef DSVIEW_PV_SIGSESSION_H
#define DSVIEW_PV_SIGSESSION_H

View File

@ -19,6 +19,9 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
/* __STDC_FORMAT_MACROS is required for PRIu64 and friends (in C++). */
#define __STDC_FORMAT_MACROS
#include "storesession.h"
#include <pv/sigsession.h>

View File

@ -19,7 +19,6 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <boost/bind.hpp>
#include <boost/foreach.hpp>
#include <boost/shared_ptr.hpp>

View File

@ -19,7 +19,6 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <boost/bind.hpp>
#include <boost/foreach.hpp>

View File

@ -19,15 +19,10 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <extdef.h>
#include <assert.h>
#include <boost/foreach.hpp>
#include <libsigrok4DSL/libsigrok.h>
#include <QAction>
#include <QDebug>
#include <QLabel>

View File

@ -24,7 +24,6 @@
#define DSVIEW_PV_TOOLBARS_SAMPLINGBAR_H
#include <stdint.h>
#include <list>
#include <map>
@ -36,8 +35,6 @@
#include <QAction>
#include <QMenu>
#include <libsigrok4DSL/libsigrok.h>
#include "../sigsession.h"
struct st_dev_inst;

View File

@ -30,11 +30,6 @@
#include <QApplication>
#include <QPainter>
#ifdef Q_OS_WIN
#pragma comment(lib, "user32.lib")
#include <qt_windows.h>
#endif
namespace pv {
namespace toolbars {

View File

@ -19,7 +19,6 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "trigbar.h"
#include "../sigsession.h"
#include "../device/devinst.h"

View File

@ -20,7 +20,6 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <extdef.h>
#include <math.h>

View File

@ -20,7 +20,6 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "cursor.h"
#include "ruler.h"

View File

@ -18,6 +18,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
extern "C" {
#include <libsigrokdecode4DSL/libsigrokdecode.h>
}

View File

@ -19,7 +19,6 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "devmode.h"
#include "view.h"
#include "trace.h"

View File

@ -19,9 +19,7 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <extdef.h>
#include <math.h>
#include "../../extdef.h"

View File

@ -19,9 +19,7 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <extdef.h>
#include <math.h>
#include "groupsignal.h"

View File

@ -20,7 +20,6 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "header.h"
#include "view.h"
@ -332,6 +331,8 @@ void Header::leaveEvent(QEvent*)
void Header::contextMenuEvent(QContextMenuEvent *event)
{
(void)event;
int action;
const boost::shared_ptr<Trace> t = get_mTrace(action, _mouse_point);
@ -339,15 +340,18 @@ void Header::contextMenuEvent(QContextMenuEvent *event)
if (!t || !t->selected() || action != Trace::LABEL)
return;
QMenu menu(this);
if (t->get_type() == SR_CHANNEL_LOGIC)
menu.addAction(_action_add_group);
else if (t->get_type() == SR_CHANNEL_GROUP)
menu.addAction(_action_del_group);
/*
* disable group function for v0.97 temporarily
*/
// QMenu menu(this);
// if (t->get_type() == SR_CHANNEL_LOGIC)
// menu.addAction(_action_add_group);
// else if (t->get_type() == SR_CHANNEL_GROUP)
// menu.addAction(_action_del_group);
_context_trace = t;
menu.exec(event->globalPos());
_context_trace.reset();
// _context_trace = t;
// menu.exec(event->globalPos());
// _context_trace.reset();
}
void Header::on_action_set_name_triggered()

View File

@ -17,22 +17,21 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <extdef.h>
#include "mathtrace.h"
#include <extdef.h>
#include <algorithm>
#include <math.h>
#include <boost/foreach.hpp>
#include <boost/functional/hash.hpp>
#include "mathtrace.h"
#include "../sigsession.h"
#include "../data/dso.h"
#include "../data/dsosnapshot.h"
#include "../view/dsosignal.h"
#include "../view/viewport.h"
#include "../device/devinst.h"
#include "../data/mathstack.h"
using namespace boost;

View File

@ -20,7 +20,6 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "ruler.h"
#include "cursor.h"

View File

@ -20,7 +20,6 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <extdef.h>
#include <math.h>

View File

@ -35,7 +35,7 @@
#include <stdint.h>
#include <list>
#include "libsigrok4DSL/libsigrok.h"
#include <libsigrok4DSL/libsigrok.h>
#include "trace.h"
namespace pv {

View File

@ -20,7 +20,6 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "timemarker.h"
#include "view.h"

View File

@ -20,7 +20,6 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef DSVIEW_PV_VIEW_MARKER_H
#define DSVIEW_PV_VIEW_MARKER_H

View File

@ -21,7 +21,6 @@
*/
#include <extdef.h>
#include <assert.h>
#include <math.h>

View File

@ -31,8 +31,6 @@
#include <stdint.h>
#include <libsigrok4DSL/libsigrok.h>
#include "selectableitem.h"
#include "dsldial.h"

View File

@ -20,7 +20,6 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <assert.h>
#include <limits.h>
#include <math.h>

View File

@ -25,7 +25,6 @@
#define DSVIEW_PV_VIEW_VIEW_H
#include <stdint.h>
#include <set>
#include <vector>

View File

@ -20,7 +20,6 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "viewport.h"
#include "ruler.h"

View File

@ -24,6 +24,8 @@
#ifndef DSVIEW_PV_VIEW_VIEWPORT_H
#define DSVIEW_PV_VIEW_VIEWPORT_H
#include <stdint.h>
#include <boost/shared_ptr.hpp>
#include <boost/weak_ptr.hpp>
@ -31,10 +33,8 @@
#include <QTimer>
#include <QWidget>
#include <stdint.h>
#include "../../extdef.h"
#include "../view/view.h"
#include "../../extdef.h"
class QPainter;
class QPaintEvent;

View File

@ -18,10 +18,10 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <glib.h>
#include "config.h" /* Needed for HAVE_LIBUSB_1_0 and others. */
#include "libsigrok.h"
#include "libsigrok-internal.h"
#include <glib.h>
#include "config.h" /* Needed for HAVE_LIBUSB_1_0 and others. */
/**
* @mainpage libsigrok API

View File

@ -17,11 +17,11 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "libsigrok.h"
#include "libsigrok-internal.h"
#include <stdio.h>
#include <glib.h>
#include "config.h" /* Needed for HAVE_LIBUSB_1_0 and others. */
#include "libsigrok.h"
#include "libsigrok-internal.h"
/* Message logging helpers with subsystem-specific prefix string. */
#define LOG_PREFIX "device: "

View File

@ -17,6 +17,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "libsigrok.h"
#include "libsigrok-internal.h"
//#include <libusb.h>
#include "command.h"
//#include "libsigrok.h"

View File

@ -18,6 +18,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "libsigrok.h"
#include "libsigrok-internal.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@ -35,10 +37,10 @@
#define min(a,b) ((a)<(b)?(a):(b))
static const int single_buffer_time = 20;
static const int total_buffer_time = 200;
static const int buffer_size = 1024 * 1024;
static const int instant_buffer_size = 1024 * 1024;
static const int cons_buffer_size = 128;
static const int total_buffer_time = 200;
static struct sr_dev_mode mode_list[] = {
{"OSC", DSO},
@ -47,8 +49,7 @@ static struct sr_dev_mode mode_list[] = {
static const char *opmodes[] = {
"Normal",
"Internal Test",
"External Test",
"DRAM Loopback Test",
"Internal Test",
};
static const char *thresholds[] = {
@ -1542,10 +1543,6 @@ static int config_set(int id, GVariant *data, struct sr_dev_inst *sdi,
devc->op_mode = SR_OP_BUFFER;
} else if (!strcmp(stropt, opmodes[SR_OP_INTERNAL_TEST])) {
devc->op_mode = SR_OP_INTERNAL_TEST;
} else if (!strcmp(stropt, opmodes[SR_OP_EXTERNAL_TEST])) {
devc->op_mode = SR_OP_EXTERNAL_TEST;
} else if (!strcmp(stropt, opmodes[SR_OP_LOOPBACK_TEST])) {
devc->op_mode = SR_OP_LOOPBACK_TEST;
} else {
ret = SR_ERR;
}
@ -2690,10 +2687,10 @@ static int dev_acquisition_start(struct sr_dev_inst *sdi, void *cb_data)
(void)cb_data;
struct DSL_context *devc;
struct drv_context *drvc;
struct sr_usb_dev_inst *usb;
struct libusb_transfer *transfer;
struct ds_trigger_pos *trigger_pos;
struct drv_context *drvc;
const struct libusb_pollfd **lupfd;
unsigned int i;
int ret;

View File

@ -18,6 +18,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "libsigrok.h"
#include "libsigrok-internal.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@ -2367,7 +2369,7 @@ static unsigned int get_timeout(struct DSL_context *devc)
total_size = get_buffer_size(devc) * get_number_of_transfers(devc);
timeout = total_size / to_bytes_per_ms(devc);
//return timeout + timeout / 4; /* Leave a headroom of 25% percent. */
if (devc->op_mode == SR_OP_STREAM)
return timeout + timeout / 4; /* Leave a headroom of 25% percent. */
else
@ -2531,8 +2533,8 @@ static int dev_acquisition_start(struct sr_dev_inst *sdi, void *cb_data)
(void)cb_data;
struct DSL_context *devc;
struct drv_context *drvc;
struct sr_usb_dev_inst *usb;
struct drv_context *drvc;
const struct libusb_pollfd **lupfd;
unsigned int i;
int ret;

View File

@ -20,15 +20,14 @@
/*
* Helper functions for the Cypress EZ-USB / FX2 series chips.
*/
#include "libsigrok.h"
#include "libsigrok-internal.h"
//#include <libusb.h>
#include <glib.h>
#include <glib/gstdio.h>
#include <stdio.h>
#include <errno.h>
#include <string.h>
#include "libsigrok.h"
#include "libsigrok-internal.h"
/* Message logging helpers with subsystem-specific prefix string. */
#define LOG_PREFIX "ezusb: "

View File

@ -17,11 +17,11 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "libsigrok.h"
#include "libsigrok-internal.h"
#include <stdlib.h>
#include <glib.h>
//#include <libusb.h>
#include "libsigrok.h"
#include "libsigrok-internal.h"
/* SR_CONF_CONN takes one of these: */
#define CONN_USB_VIDPID "^([0-9a-z]{4})\\.([0-9a-z]{4})$"

View File

@ -20,6 +20,8 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "libsigrok.h"
#include "libsigrok-internal.h"
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
@ -29,8 +31,6 @@
#include <fcntl.h>
#define pipe(fds) _pipe(fds, 4096, _O_BINARY)
#endif
#include "libsigrok.h"
#include "libsigrok-internal.h"
/* Message logging helpers with subsystem-specific prefix string. */
#define LOG_PREFIX "demo: "

View File

@ -17,6 +17,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "libsigrok.h"
#include "libsigrok-internal.h"
#include <stdlib.h>
#include <stdio.h>
#include <sys/types.h>
@ -24,8 +26,6 @@
#include <string.h>
#include <glib.h>
#include "config.h" /* Needed for HAVE_LIBUSB_1_0 and others. */
#include "libsigrok.h"
#include "libsigrok-internal.h"
/* Message logging helpers with subsystem-specific prefix string. */
#define LOG_PREFIX "hwdriver: "

View File

@ -17,14 +17,14 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "libsigrok.h"
#include "libsigrok-internal.h"
#include <stdlib.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <sys/time.h>
#include "libsigrok.h"
#include "libsigrok-internal.h"
/* Message logging helpers with subsystem-specific prefix string. */
#define LOG_PREFIX "input/binary: "

View File

@ -57,12 +57,12 @@
/* */
#include "libsigrok.h"
#include "libsigrok-internal.h"
#include <stdlib.h>
#include <glib.h>
#include <stdio.h>
#include <string.h>
#include "libsigrok.h"
#include "libsigrok-internal.h"
/* Message logging helpers with subsystem-specific prefix string. */
#define LOG_PREFIX "input/vcd: "

View File

@ -17,13 +17,13 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "libsigrok.h"
#include "libsigrok-internal.h"
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <fcntl.h>
#include <string.h>
#include "libsigrok.h"
#include "libsigrok-internal.h"
/* Message logging helpers with subsystem-specific prefix string. */
#define LOG_PREFIX "input/wav: "

View File

@ -20,21 +20,14 @@
#ifndef LIBSIGROK_SIGROK_H
#define LIBSIGROK_SIGROK_H
#include <sys/time.h>
#include <stdio.h>
#include <sys/time.h>
#include <stdint.h>
#include <inttypes.h>
#include <glib.h>
#ifndef _WIN32
#include <sys/time.h>
#else
#define WINVER 0x0501
#define _WIN32_WINNT WINVER
#include <Winsock2.h>
#include <usbiodef.h>
#endif
#ifdef __cplusplus
extern "C" {
#endif

View File

@ -18,10 +18,10 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <stdarg.h>
#include <stdio.h>
#include "libsigrok.h"
#include "libsigrok-internal.h"
#include <stdarg.h>
#include <stdio.h>
/**
* @file

View File

@ -18,12 +18,12 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "libsigrok.h"
#include "libsigrok-internal.h"
#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include "config.h" /* Needed for PACKAGE_STRING and others. */
#include "libsigrok.h"
#include "libsigrok-internal.h"
#define LOG_PREFIX "output/csv"

View File

@ -18,12 +18,14 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include "config.h" /* Needed for PACKAGE_STRING and others. */
#include "libsigrok.h"
#include "libsigrok-internal.h"
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <inttypes.h>
#include <glib.h>
#include "config.h" /* Needed for PACKAGE_STRING and others. */
#define LOG_PREFIX "output/gnuplot"
@ -189,7 +191,7 @@ static int receive(const struct sr_output *o, const struct sr_datafeed_packet *p
memcpy(ctx->prevsample, sample, logic->unitsize);
/* The first column is a counter (needed for gnuplot). */
g_string_append_printf(*out, "%" PRIu64 "\t", ctx->samplecount);
g_string_append_printf(*out, "%"PRIu64"\t", ctx->samplecount);
/* The next columns are the values of all channels. */
for (p = 0; p < ctx->num_enabled_channels; p++) {

View File

@ -17,9 +17,9 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <string.h>
#include "libsigrok.h"
#include "libsigrok-internal.h"
#include <string.h>
/** @cond PRIVATE */
#define LOG_PREFIX "output"

View File

@ -17,6 +17,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "libsigrok.h"
#include "libsigrok-internal.h"
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
@ -24,8 +26,6 @@
#include <glib.h>
#include <glib/gstdio.h>
#include <zip.h>
#include "libsigrok.h"
#include "libsigrok-internal.h"
#define LOG_PREFIX "output/srzip"

View File

@ -19,12 +19,12 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "libsigrok.h"
#include "libsigrok-internal.h"
#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include "config.h" /* Needed for PACKAGE and others. */
#include "libsigrok.h"
#include "libsigrok-internal.h"
#define LOG_PREFIX "output/vcd"

View File

@ -17,13 +17,13 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "libsigrok.h"
#include "libsigrok-internal.h"
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <glib.h>
#include "libsigrok.h"
#include "libsigrok-internal.h"
/* Message logging helpers with subsystem-specific prefix string. */
#define LOG_PREFIX "session: "

View File

@ -17,6 +17,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "libsigrok.h"
#include "libsigrok-internal.h"
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
@ -25,8 +27,6 @@
#include <zip.h>
#include <assert.h>
#include <string.h>
#include "libsigrok.h"
#include "libsigrok-internal.h"
/* Message logging helpers with subsystem-specific prefix string. */
#define LOG_PREFIX "virtual-session: "

View File

@ -17,6 +17,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "libsigrok.h"
#include "libsigrok-internal.h"
#include <string.h>
#include <stdlib.h>
#include <unistd.h>
@ -27,8 +29,6 @@
#include <glib.h>
#include <glib/gstdio.h>
#include "config.h" /* Needed for PACKAGE_VERSION and others. */
#include "libsigrok.h"
#include "libsigrok-internal.h"
/* Message logging helpers with subsystem-specific prefix string. */
#define LOG_PREFIX "session-file: "

View File

@ -18,9 +18,9 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <glib.h>
#include "libsigrok.h"
#include "libsigrok-internal.h"
#include <glib.h>
/**
* Standard sr_driver_init() API helper.

View File

@ -18,11 +18,12 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "libsigrok.h"
#include "libsigrok-internal.h"
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include "libsigrok.h"
#include "libsigrok-internal.h"
#include <stdio.h>
/* Message logging helpers with subsystem-specific prefix string. */
#define LOG_PREFIX "strutil: "
@ -67,26 +68,26 @@ SR_API char *sr_si_string_u64(uint64_t x, const char *unit)
if (unit == NULL)
unit = "";
if ((x >= SR_GHZ(1)) && (x % SR_GHZ(1) == 0)) {
return g_strdup_printf("%" PRIu64 " G%s", x / SR_GHZ(1), unit);
} else if ((x >= SR_GHZ(1)) && (x % SR_GHZ(1) != 0)) {
return g_strdup_printf("%" PRIu64 ".%" PRIu64 " G%s",
x / SR_GHZ(1), x % SR_GHZ(1), unit);
} else if ((x >= SR_MHZ(1)) && (x % SR_MHZ(1) == 0)) {
return g_strdup_printf("%" PRIu64 " M%s",
x / SR_MHZ(1), unit);
} else if ((x >= SR_MHZ(1)) && (x % SR_MHZ(1) != 0)) {
return g_strdup_printf("%" PRIu64 ".%" PRIu64 " M%s",
x / SR_MHZ(1), x % SR_MHZ(1), unit);
} else if ((x >= SR_KHZ(1)) && (x % SR_KHZ(1) == 0)) {
return g_strdup_printf("%" PRIu64 " k%s",
x / SR_KHZ(1), unit);
} else if ((x >= SR_KHZ(1)) && (x % SR_KHZ(1) != 0)) {
if ((x >= SR_GHZ(1)) && (x % SR_GHZ(1) == 0)) {
return g_strdup_printf("%" PRIu64 " G%s", x / SR_GHZ(1), unit);
} else if ((x >= SR_GHZ(1)) && (x % SR_GHZ(1) != 0)) {
return g_strdup_printf("%" PRIu64 ".%" PRIu64 " G%s",
x / SR_GHZ(1), x % SR_GHZ(1), unit);
} else if ((x >= SR_MHZ(1)) && (x % SR_MHZ(1) == 0)) {
return g_strdup_printf("%" PRIu64 " M%s",
x / SR_MHZ(1), unit);
} else if ((x >= SR_MHZ(1)) && (x % SR_MHZ(1) != 0)) {
return g_strdup_printf("%" PRIu64 ".%" PRIu64 " M%s",
x / SR_MHZ(1), x % SR_MHZ(1), unit);
} else if ((x >= SR_KHZ(1)) && (x % SR_KHZ(1) == 0)) {
return g_strdup_printf("%" PRIu64 " k%s",
x / SR_KHZ(1), unit);
} else if ((x >= SR_KHZ(1)) && (x % SR_KHZ(1) != 0)) {
return g_strdup_printf("%" PRIu64 ".%" PRIu64 " K%s",
x / SR_KHZ(1), x % SR_KHZ(1), unit);
} else {
return g_strdup_printf("%" PRIu64 " %s", x, unit);
}
x / SR_KHZ(1), x % SR_KHZ(1), unit);
} else {
return g_strdup_printf("%" PRIu64 " %s", x, unit);
}
sr_err("%s: Error creating SI units string.", __func__);
return NULL;
@ -115,19 +116,19 @@ SR_API char *sr_iec_string_u64(uint64_t x, const char *unit)
if ((x >= SR_GB(1)) && (x % SR_GB(1) == 0)) {
return g_strdup_printf("%" PRIu64 " G%s", x / SR_GB(1), unit);
} else if ((x >= SR_GB(1)) && (x % SR_GB(1) != 0)) {
return g_strdup_printf("%" PRIu64 ".%" PRIu64 "G%s",
return g_strdup_printf("%" PRIu64 ".%" PRIu64 " G%s",
x / SR_GB(1), x % SR_GB(1), unit);
} else if ((x >= SR_MB(1)) && (x % SR_MB(1) == 0)) {
return g_strdup_printf("%" PRIu64 " M%s",
x / SR_MB(1), unit);
} else if ((x >= SR_MB(1)) && (x % SR_MB(1) != 0)) {
return g_strdup_printf("%" PRIu64 ".%" PRIu64 "M%s",
return g_strdup_printf("%" PRIu64 ".%" PRIu64 " M%s",
x / SR_MB(1), x % SR_MB(1), unit);
} else if ((x >= SR_KB(1)) && (x % SR_KB(1) == 0)) {
return g_strdup_printf("%" PRIu64 " k%s",
x / SR_KB(1), unit);
} else if ((x >= SR_KB(1)) && (x % SR_KB(1) != 0)) {
return g_strdup_printf("%" PRIu64 ".%" PRIu64 "K%s",
return g_strdup_printf("%" PRIu64 ".%" PRIu64 " K%s",
x / SR_KB(1), x % SR_KB(1), unit);
} else {
return g_strdup_printf("%" PRIu64 " %s", x, unit);

View File

@ -2,14 +2,14 @@
* This file is part of the DSLogic project.
*/
#include "libsigrok.h"
#include "libsigrok-internal.h"
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <assert.h>
#include <glib.h>
#include "libsigrok.h"
#include "libsigrok-internal.h"
/* Message logging helpers with subsystem-specific prefix string. */
#define LOG_PREFIX "session: "
@ -244,7 +244,7 @@ SR_PRIV uint64_t ds_trigger_get_mask0(uint16_t stage)
for (i = TriggerProbes - 1; i >= 0 ; i--) {
mask = (mask << 1);
mask += (trigger->trigger0[stage][i] == 'X' || trigger->trigger0[stage][i] == 'C');
mask += ((trigger->trigger0[stage][i] == 'X') | (trigger->trigger0[stage][i] == 'C'));
}
return mask;

View File

@ -142,9 +142,9 @@ static int searchpath_add_xdg_dir(const char *datadir)
SRD_API int srd_init(const char *path)
{
const char *const *sys_datadirs;
const char *env_path;
size_t i;
int ret;
const char *env_path;
if (max_session_id != -1) {
srd_err("libsigrokdecode is already initialized.");
@ -158,7 +158,6 @@ SRD_API int srd_init(const char *path)
/* Initialize the Python interpreter. */
Py_InitializeEx(0);
/* Locations relative to the XDG system data directories. */
sys_datadirs = g_get_system_data_dirs();
for (i = g_strv_length((char **)sys_datadirs); i > 0; i--) {
@ -168,13 +167,13 @@ SRD_API int srd_init(const char *path)
return ret;
}
}
#ifdef DECODERS_DIR
#ifdef DECODERS_DIR
/* Hardcoded decoders install location, if defined. */
if ((ret = srd_decoder_searchpath_add(DECODERS_DIR)) != SRD_OK) {
Py_Finalize();
return ret;
}
#endif
#endif
/* Location relative to the XDG user data directory. */
ret = searchpath_add_xdg_dir(g_get_user_data_dir());
if (ret != SRD_OK) {