Esempio n. 1
0
        public Waveform Build()
        {
            this.m_gpio.WaveFormNew();

            const int sliceSize = 10;

            for (int slice = 0; slice < this.m_lst.Count; slice += sliceSize)
            {
                int remain = Math.Min(sliceSize, this.m_lst.Count - slice);
                if (remain == 0)
                {
                    break;
                }
                Pulse[] data = new Pulse[remain];
                for (int i = 0; i < remain; i++)
                {
                    data[i] = this.m_lst[slice + i];
                }
                this.m_gpio.WaveformAppend(data);
            }
            int id = this.m_gpio.WaveformCreate();

            return(new Waveform(this.m_gpio, id));
        }
Esempio n. 2
0
 public WaveformBuilder Append(Pulse pulse)
 {
     this.m_lst.Add(pulse);
     return(this);
 }