This special trigger source mimics the trigger mode that is called
"Auto" in the original Hantek's "DSO2090 Software" and in
https://github.com/OpenHantek/OpenHantek6022 open-source project.
In the original https://github.com/OpenHantek/openhantek open-source
project the trigger mode is called "Wait/Force".
This feature can be used to immediately capture a single frame.
Example usage with sigrok-cli:
```
sigrok-cli --driver hantek-dso --frames 1 --config triggersource=forced
```
This enables us to use the oscilloscope for data logging in scripts.
Only after I implemented this I realized that if you have an extra probe,
you can set the triggersource to "EXT" and connect the EXT input
to the 1kHz calibration signal output on the back of the device
and that will trigger every millisecond. However, I still think that
the "forced" trigger source can be useful.
};
static const char *trigger_sources[] = {
- "CH1", "CH2", "EXT",
- /* TODO: forced */
+ "CH1", "CH2", "EXT", "forced"
};
static const char *trigger_slopes[] = {
break;
if (dso_enable_trigger(sdi) != SR_OK)
break;
-// if (dso_force_trigger(sdi) != SR_OK)
-// break;
+ if (!strcmp("forced", devc->triggersource)) {
+ if (dso_force_trigger(sdi) != SR_OK)
+ break;
+ }
sr_dbg("Successfully requested next chunk.");
}
break;
tmp = 3;
else if (!strcmp("CH1", devc->triggersource))
tmp = 2;
- else if (!strcmp("EXT", devc->triggersource))
+ else if (!strcmp("EXT", devc->triggersource) || !strcmp("forced", devc->triggersource))
tmp = 0;
else {
sr_err("Invalid trigger source: '%s'.", devc->triggersource);
tmp = 0;
else if (!strcmp("CH1", devc->triggersource))
tmp = 1;
- else if (!strcmp("EXT", devc->triggersource))
+ else if (!strcmp("EXT", devc->triggersource) || !strcmp("forced", devc->triggersource))
tmp = 2;
else {
sr_err("Invalid trigger source: '%s'.", devc->triggersource);