X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=hardware%2Fsysclk-lwla%2Fprotocol.c;h=c4d99d82ab0d10c8c64b866b7cb9f4038373e564;hb=e6e54bd2537ac423977f5574292f2cb987ce8629;hp=5b1f2483e6ba0b38a875a0f0a1ef6b41c99d7ef0;hpb=e0df15d43600737fe225f5c68dbdbcf84d5fa326;p=libsigrok.git diff --git a/hardware/sysclk-lwla/protocol.c b/hardware/sysclk-lwla/protocol.c index 5b1f2483..c4d99d82 100644 --- a/hardware/sysclk-lwla/protocol.c +++ b/hardware/sysclk-lwla/protocol.c @@ -63,6 +63,7 @@ static int capture_setup(const struct sr_dev_inst *sdi) struct dev_context *devc; struct acquisition_state *acq; uint64_t divider_count; + uint64_t trigger_mask; uint64_t memory_limit; uint16_t command[3 + 10*4]; @@ -102,10 +103,18 @@ static int capture_setup(const struct sr_dev_inst *sdi) command[17] = LWLA_WORD_2(devc->trigger_edge_mask); command[18] = LWLA_WORD_3(devc->trigger_edge_mask); - command[19] = LWLA_WORD_0(devc->trigger_mask); - command[20] = LWLA_WORD_1(devc->trigger_mask); - command[21] = LWLA_WORD_2(devc->trigger_mask); - command[22] = LWLA_WORD_3(devc->trigger_mask); + trigger_mask = devc->trigger_mask; + /* Set bits to select external TRG input edge. */ + if (devc->cfg_trigger_source == TRIGGER_EXT_TRG) + switch (devc->cfg_trigger_slope) { + case SLOPE_POSITIVE: trigger_mask |= (uint64_t)1 << 35; break; + case SLOPE_NEGATIVE: trigger_mask |= (uint64_t)1 << 34; break; + } + + command[19] = LWLA_WORD_0(trigger_mask); + command[20] = LWLA_WORD_1(trigger_mask); + command[21] = LWLA_WORD_2(trigger_mask); + command[22] = LWLA_WORD_3(trigger_mask); /* Set the capture memory full threshold. This is slightly less * than the actual maximum, most likely in order to compensate for