From: Gerhard Sittig Date: Sun, 30 Jan 2022 07:06:28 +0000 (+0100) Subject: kingst-la2016: identify device type in scan() already X-Git-Url: http://sigrok.org/gitweb/?a=commitdiff_plain;ds=sidebyside;h=d466f61cdcf2eb49dad3849a416e141da1435755;hp=d466f61cdcf2eb49dad3849a416e141da1435755;p=libsigrok.git kingst-la2016: identify device type in scan() already The vendor's design choice won't let us detect the device type from USB enumeration data alone. EEPROM content must be read, which involves MCU firmware communication, which only becomes available after the recently uploaded firmware image becomes available. This extends the execution time of the Kingst LA driver's scan() routine, but only if devices are connected, and only for their first occurance after plugin. Subsequent scans are quick. Knowing the device type in the scan routine simplifies the open routine, and allows model specific default parameters. The vendor's design choice again won't let us read back previously configured values, each program startup must assume a default configuration. This implementation uses lots of small helpers to avoid open coding USB communication details in several places. In theory up to 32 channels are prepared, but all currently supported models have 16 channels. Different memory sizes and channel counts are not yet effective in the acquisition setup or session feed. The previous implementation of device open still did too many things (configure PWM before user specs were received). A future implementation needs to better pick which activities to run at which points in time. ---