rdtech-dps: Make it work in SmuView

Without the mutex, concurrent reception from the ModBus port leads to CRC
errors.
This commit is contained in:
v1ne 2020-04-03 03:51:09 +02:00 committed by Uwe Hermann
parent 56a1bf7b4b
commit 69c5d959e7
1 changed files with 2 additions and 0 deletions

View File

@ -305,7 +305,9 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi)
devc = sdi->priv;
/* Prefill actual states */
g_mutex_lock(&devc->rw_mutex);
ret = rdtech_dps_read_holding_registers(modbus, REG_PROTECT, 3, registers);
g_mutex_unlock(&devc->rw_mutex);
if (ret != SR_OK)
return ret;
devc->actual_ovp_state = RB16(registers + 0) == STATE_OVP;