Bugzilla – Attachment 458 Details for
Bug 1287
Add metadata defaults for the Logic Pirate device
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Changes to the OLS driver to use device-specific metadata defaults
libsigrok-logic-pirate.patch (text/plain), 2.07 KB, created by
pascal martin
on 2018-09-24 01:13:08 CEST
(
hide
)
Description:
Changes to the OLS driver to use device-specific metadata defaults
Filename:
MIME Type:
Creator:
pascal martin
Created:
2018-09-24 01:13:08 CEST
Size:
2.07 KB
patch
obsolete
>diff --git a/src/hardware/openbench-logic-sniffer/protocol.c b/src/hardware/openbench-logic-sniffer/protocol.c >index 0d6efeb8..9178c46e 100644 >--- a/src/hardware/openbench-logic-sniffer/protocol.c >+++ b/src/hardware/openbench-logic-sniffer/protocol.c >@@ -157,6 +157,8 @@ SR_PRIV struct sr_dev_inst *get_metadata(struct sr_serial_dev_inst *serial) > GString *tmp_str, *devname, *version; > guchar tmp_c; > >+ uint32_t channel_count = 0; >+ > sdi = g_malloc0(sizeof(struct sr_dev_inst)); > sdi->status = SR_ST_INACTIVE; > devc = ols_dev_new(); >@@ -222,9 +224,7 @@ SR_PRIV struct sr_dev_inst *get_metadata(struct sr_serial_dev_inst *serial) > switch (token) { > case 0x00: > /* Number of usable channels */ >- for (ui = 0; ui < tmp_int; ui++) >- sr_channel_new(sdi, ui, SR_CHANNEL_LOGIC, TRUE, >- ols_channel_names[ui]); >+ channel_count = tmp_int; > break; > case 0x01: > /* Amount of sample memory available (bytes) */ >@@ -258,9 +258,7 @@ SR_PRIV struct sr_dev_inst *get_metadata(struct sr_serial_dev_inst *serial) > switch (token) { > case 0x00: > /* Number of usable channels */ >- for (ui = 0; ui < tmp_c; ui++) >- sr_channel_new(sdi, ui, SR_CHANNEL_LOGIC, TRUE, >- ols_channel_names[ui]); >+ channel_count = (uint32_t)tmp_c; > break; > case 0x01: > /* protocol version */ >@@ -278,6 +276,24 @@ SR_PRIV struct sr_dev_inst *get_metadata(struct sr_serial_dev_inst *serial) > } > } > >+ /* Use defaults based on each model. >+ * (Do not override any possible actual value--new firmware?) >+ * TBD: default configuration from user file? >+ */ >+ if (strstr(devname->str, "Logic Pirate") != NULL) { >+ if (channel_count == 0) >+ channel_count = 8; >+ if (devc->max_samplerate == 0) >+ devc->max_samplerate = 40000000; // 40 MHz. >+ if (devc->max_samples == 0) >+ devc->max_samples = 256*1024; // 256KSamples >+ } >+ >+ /* Declare all usable channels */ >+ for (ui = 0; ui < channel_count; ui++) >+ sr_channel_new(sdi, ui, SR_CHANNEL_LOGIC, TRUE, >+ ols_channel_names[ui]); >+ > sdi->model = devname->str; > sdi->version = version->str; > g_string_free(devname, FALSE);
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 1287
: 458 |
459