Skip to content

Commit

Permalink
Fixed JS110 to only issue one CTRL IN status request at a time.
Browse files Browse the repository at this point in the history
  • Loading branch information
mliberty1 committed Mar 20, 2024
1 parent 889a92d commit a3f539f
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 5 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@
This file contains the list of changes made to the Joulescope driver.


## 1.4.10

2024 Mar 20

* Fixed JS110 to only issue one CTRL IN status request at a time.


## 1.4.9

2024 Mar 18
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ else()
endif()

project(JOULESCOPE_DRIVER
VERSION 1.4.9
VERSION 1.4.10
LANGUAGES C)
SET(PROJECT_PREFIX JSDRV)
SET(VERSION_STRING "${PROJECT_VERSION}")
Expand Down
2 changes: 1 addition & 1 deletion include/jsdrv/version.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
*
* Changes in the patch version indicate bug fixes and improvements.
*/
#define JSDRV_VERSION_PATCH 9
#define JSDRV_VERSION_PATCH 10

/**
* \brief The maximum version string length.
Expand Down
2 changes: 1 addition & 1 deletion pyjoulescope_driver/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# limitations under the License.


__version__ = "1.4.9"
__version__ = "1.4.10"

__title__ = "pyjoulescope_driver"
__description__ = 'Joulescope™ driver'
Expand Down
9 changes: 7 additions & 2 deletions src/js110_usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -463,6 +463,7 @@ struct js110_dev_s {
struct js110_stats_s stats;
uint64_t sample_id;
struct jsdrv_tmf_s * time_map_filter;
struct jsdrvp_msg_s * status_msg;

int64_t sstats_samples_total_prev;
struct jsdrv_tmf_s * sstats_time_map_filter;
Expand Down Expand Up @@ -670,6 +671,9 @@ static struct jsdrvp_msg_s * d_status_req(struct js110_dev_s * d) {
}

static int32_t d_status_rsp(struct js110_dev_s * d, struct jsdrvp_msg_s * msg) {
if (msg == d->status_msg) {
d->status_msg = NULL;
}
if (msg->value.size > STATUS_SETUP.s.wLength) {
JSDRV_LOGW("d_status_rsp: returned too much data");
return JSDRV_ERROR_TOO_BIG;
Expand Down Expand Up @@ -1524,8 +1528,8 @@ static THREAD_RETURN_TYPE driver_thread(THREAD_ARG_TYPE lpParam) {
duration_ms = time_now_ms - time_prev_ms;
if (duration_ms >= INTERVAL_MS) {
time_prev_ms += INTERVAL_MS;
if ((d->state == ST_OPEN) && (d->param_values[PARAM_SSTATS_CTRL].value.u8)) {
d_status_req(d); // async poll status for on-instrument statistics
if ((NULL == d->status_msg) && (d->state == ST_OPEN) && (d->param_values[PARAM_SSTATS_CTRL].value.u8)) {
d->status_msg = d_status_req(d); // async poll status for on-instrument statistics
}
} else {
duration_ms = INTERVAL_MS - duration_ms;
Expand Down Expand Up @@ -1580,6 +1584,7 @@ int32_t jsdrvp_ul_js110_usb_factory(struct jsdrvp_ul_device_s ** device, struct
d->state = ST_CLOSED;
d->time_map_filter = jsdrv_tmf_new(SAMPLING_FREQUENCY, 60, JSDRV_TIME_SECOND);
d->sstats_time_map_filter = jsdrv_tmf_new(SAMPLING_FREQUENCY, 60, JSDRV_TIME_SECOND);
d->status_msg = NULL;
on_sampling_frequency(d, &jsdrv_union_u32(SAMPLING_FREQUENCY));
js110_sp_initialize(&d->sample_processor);
js110_stats_initialize(&d->stats);
Expand Down

0 comments on commit a3f539f

Please sign in to comment.