MCPcopy Create free account
hub / github.com/DreamSourceLab/DSView / update_old_pins_array_initial_pins

Function update_old_pins_array_initial_pins

libsigrokdecode4DSL/instance.c:861–885  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

859}
860
861static void update_old_pins_array_initial_pins(struct srd_decoder_inst *di)
862{
863 uint8_t sample;
864 int i, bit_offset;
865 const uint8_t *sample_pos;
866
867 if (!di || !di->dec_channelmap)
868 return;
869
870 oldpins_array_seed(di);
871 for (i = 0; i < di->dec_num_channels; i++) {
872 if (di->old_pins_array->data[i] != SRD_INITIAL_PIN_SAME_AS_SAMPLE0)
873 continue;
874
875 if (*(di->inbuf + i) == NULL) {
876 sample = *(di->inbuf_const + i) ? 1 : 0;
877 di->old_pins_array->data[i] = sample;
878 } else {
879 sample_pos = *(di->inbuf + i) + ((di->abs_cur_samplenum - di->abs_start_samplenum) / 8);
880 bit_offset = (di->abs_cur_samplenum - di->abs_start_samplenum) % 8;
881 sample = *sample_pos & (1 << bit_offset) ? 1 : 0;
882 di->old_pins_array->data[i] = sample;
883 }
884 }
885}
886
887static gboolean term_matches(struct srd_decoder_inst *di,
888 struct srd_term *term, gboolean *skip_allow)

Callers 1

find_matchFunction · 0.85

Calls 1

oldpins_array_seedFunction · 0.85

Tested by

no test coverage detected