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

Function update_old_pins_array

libsigrokdecode4DSL/instance.c:838–859  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

836}
837
838static void update_old_pins_array(struct srd_decoder_inst *di)
839{
840 uint8_t sample;
841 int i, bit_offset;
842 const uint8_t *sample_pos;
843
844 if (!di || !di->dec_channelmap)
845 return;
846
847 oldpins_array_seed(di);
848 for (i = 0; i < di->dec_num_channels; i++) {
849 if (*(di->inbuf + i) == NULL) {
850 sample = *(di->inbuf_const + i) ? 1 : 0;
851 di->old_pins_array->data[i] = sample;
852 } else {
853 sample_pos = *(di->inbuf + i) + ((di->abs_cur_samplenum - di->abs_start_samplenum) / 8);
854 bit_offset = (di->abs_cur_samplenum - di->abs_start_samplenum) % 8;
855 sample = *sample_pos & (1 << bit_offset) ? 1 : 0;
856 di->old_pins_array->data[i] = sample;
857 }
858 }
859}
860
861static void update_old_pins_array_initial_pins(struct srd_decoder_inst *di)
862{

Callers 1

find_matchFunction · 0.85

Calls 1

oldpins_array_seedFunction · 0.85

Tested by

no test coverage detected