Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Raptor Engineering Public Development
dsview
Commits
45abe48a
Commit
45abe48a
authored
7 years ago
by
DreamSourceLab
Browse files
Options
Download
Email Patches
Plain Diff
Fix issue #87: Hangs at 100% on Arch Linux
parent
79fdd36d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
22 deletions
+24
-22
DSView/pv/storesession.cpp
DSView/pv/storesession.cpp
+14
-4
libsigrok4DSL/hardware/DSL/dscope.c
libsigrok4DSL/hardware/DSL/dscope.c
+9
-17
libsigrok4DSL/hardware/DSL/dslogic.c
libsigrok4DSL/hardware/DSL/dslogic.c
+1
-1
No files found.
DSView/pv/storesession.cpp
View file @
45abe48a
...
...
@@ -160,11 +160,16 @@ bool StoreSession::save_start()
_error
=
tr
(
"Generate temp file failed."
);
return
false
;
}
else
{
sr_session_save_init
(
_file_name
.
toLocal8Bit
().
data
(),
int
ret
=
sr_session_save_init
(
_file_name
.
toLocal8Bit
().
data
(),
meta_file
.
toLocal8Bit
().
data
(),
decoders_file
.
toLocal8Bit
().
data
());
_thread
=
boost
::
thread
(
&
StoreSession
::
save_proc
,
this
,
snapshot
);
return
!
_has_error
;
if
(
ret
!=
SR_OK
)
{
_error
=
tr
(
"Failed to create zip file. Please check write permission of this path."
);
return
false
;
}
else
{
_thread
=
boost
::
thread
(
&
StoreSession
::
save_proc
,
this
,
snapshot
);
return
!
_has_error
;
}
}
}
...
...
@@ -239,7 +244,7 @@ QString StoreSession::meta_gen(boost::shared_ptr<data::Snapshot> snapshot)
{
GSList
*
l
;
GVariant
*
gvar
;
FILE
*
meta
;
FILE
*
meta
=
NULL
;
struct
sr_channel
*
probe
;
int
probecnt
;
char
*
s
;
...
...
@@ -262,6 +267,11 @@ QString StoreSession::meta_gen(boost::shared_ptr<data::Snapshot> snapshot)
const
sr_dev_inst
*
sdi
=
_session
.
get_device
()
->
dev_inst
();
meta
=
fopen
(
metafile
.
toLocal8Bit
().
data
(),
"wb"
);
if
(
meta
==
NULL
)
{
qDebug
()
<<
"Failed to create temp meta file."
;
return
NULL
;
}
fprintf
(
meta
,
"[version]
\n
"
);
if
(
sdi
->
mode
==
DSO
)
fprintf
(
meta
,
"version = %d
\n
"
,
1
);
// should be updated in next version
...
...
This diff is collapsed.
Click to expand it.
libsigrok4DSL/hardware/DSL/dscope.c
View file @
45abe48a
...
...
@@ -2532,7 +2532,7 @@ static unsigned int get_number_of_transfers(struct DSL_context *devc)
total_buffer_time * to_bytes_per_ms(devc));
/* Total buffer size should be able to hold about 500ms of data. */
//n = 500 * to_bytes_per_ms(devc) / get_buffer_size(devc);
n
=
ceil
(
total_size
*
1
.
0
/
get_buffer_size
(
devc
));
n = ceil(total_size * 1.0
f
/ get_buffer_size(devc));
if (n > NUM_SIMUL_TRANSFERS)
return NUM_SIMUL_TRANSFERS;
...
...
@@ -2620,15 +2620,12 @@ static int receive_data(int fd, int revents, const struct sr_dev_inst *sdi)
struct timeval tv;
struct drv_context *drvc;
struct DSL_context *devc;
struct
sr_usb_dev_inst
*
usb
;
int
ret
;
(void)fd;
(void)revents;
drvc = di->priv;
devc = sdi->priv;
usb
=
sdi
->
conn
;
tv.tv_sec = tv.tv_usec = 0;
libusb_handle_events_timeout_completed(drvc->sr_ctx->libusb_ctx, &tv, &completed);
...
...
@@ -2638,19 +2635,7 @@ static int receive_data(int fd, int revents, const struct sr_dev_inst *sdi)
}
if (devc->status == DSL_FINISH) {
if
(
libusb_try_lock_events
(
drvc
->
sr_ctx
->
libusb_ctx
)
==
0
)
{
if
(
libusb_event_handling_ok
(
drvc
->
sr_ctx
->
libusb_ctx
))
{
/* Stop GPIF acquisition */
usb
=
((
struct
sr_dev_inst
*
)
devc
->
cb_data
)
->
conn
;
if
((
ret
=
command_stop_acquisition
(
usb
->
devhdl
))
!=
SR_OK
)
sr_err
(
"%s: Sent acquisition stop command failed!"
,
__func__
);
else
sr_info
(
"%s: Sent acquisition stop command!"
,
__func__
);
remove_sources
(
devc
);
}
libusb_unlock_events
(
drvc
->
sr_ctx
->
libusb_ctx
);
}
remove_sources(devc);
}
return TRUE;
...
...
@@ -2841,6 +2826,7 @@ static int dev_acquisition_stop(const struct sr_dev_inst *sdi, void *cb_data)
struct DSL_context *devc;
struct sr_usb_dev_inst *usb;
int ret;
devc = sdi->priv;
usb = sdi->conn;
...
...
@@ -2848,6 +2834,12 @@ static int dev_acquisition_stop(const struct sr_dev_inst *sdi, void *cb_data)
if (!devc->abort) {
devc->abort = TRUE;
command_wr_reg(usb->devhdl, bmFORCE_RDY, EEWP_ADDR);
} else if (devc->status == DSL_FINISH) {
/* Stop GPIF acquisition */
if ((ret = command_stop_acquisition (usb->devhdl)) != SR_OK)
sr_err("%s: Sent acquisition stop command failed!", __func__);
else
sr_info("%s: Sent acquisition stop command!", __func__);
}
return SR_OK;
...
...
This diff is collapsed.
Click to expand it.
libsigrok4DSL/hardware/DSL/dslogic.c
View file @
45abe48a
...
...
@@ -2352,7 +2352,7 @@ static unsigned int get_number_of_transfers(struct DSL_context *devc)
{
unsigned
int
n
;
/* Total buffer size should be able to hold about 100ms of data. */
n
=
total_buffer_time
*
to_bytes_per_ms
(
devc
)
/
get_buffer_size
(
devc
);
n
=
ceil
(
total_buffer_time
*
1
.
0
f
*
to_bytes_per_ms
(
devc
)
/
get_buffer_size
(
devc
)
)
;
if
(
n
>
NUM_SIMUL_TRANSFERS
)
return
NUM_SIMUL_TRANSFERS
;
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment